Install OneDrive Free Client on Gentoo without Root Permission

OneDrive Free Client is “a complete tool to interact with OneDrive on Linux”.

Install the D language compiler:

curl -fsS https://dlang.org/install.sh | bash -s dmd

Run the full source command provided by the output of the above install script.

Download OneDrive Free Client’s source:

git clone https://github.com/skilion/onedrive.git

Change to the source directory:

cd onedrive

Use the following command to edit the prefix defined in Makefile:

sed -i 's|/usr/local|/home/username|g' Makefile

Compile and install OneDrive Free Client:

make && make install

Deactivate the source command:

deactivate

Add ~/bin to your PATH so that you can run binaries in ~/bin without specifying the path. Ignore this step if you have performed it for a different program.

echo "PATH=\$HOME/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc

You can now run OneDrive Free Client with onedrive. To run it in the background, you can use:

screen -dmS onedrive onedrive -m

Run the following command to create a sync list, which let onedrive only syncs specific directories:

vi ~/.config/onedrive/sync_list

In sync_list (one directory per line):

Apps/Datasets-1/
Datasets-Prepare/