I tried at least three ways before I found a working way to install OneDrive on Linux (in my case openSUSE distro).
Well, I did it nevertheless, it just took me more time. The first thing I’d like to say is that none of this is my work, I just wanted to make it easier to find a way to install OneDrive on Linux. I’ll just summarise the way I did it on Red Hat based distro (openSUSE) and I’ll add credits to the real author and a link to the original guide at the end, so you can see how to do it on Debian and Ubuntu.
STEP 1 – Install the dependencies:
sudo yum install libcurl-devel
sudo yum install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd
I used apt-get here instead of yum, it also worked, so it is up to your personal preferences (I was too lazy to go install yum) 😀
STEP 2 – Installation
git clone https://github.com/skilion/onedrive.git
cd onedrive
make
sudo make install
STEP 3 – Configuration (optional)
onedrive than onedrive will serve you a link you should copy to your web browser and login to OneDrive after succesfull login copy the url from the address bar back to the terminal cd ~/.config/onedrive vi config
You can skip making the config file, but if you want OneDrive folder to be in in a different folder then it is by default (~/oneDrive) like I didn’t then you will have to make it and specify the path
The config file should look like this:
sync_dir = "~/OneDrive" skip_file = ".*|~*"
sync_dir is the path where you want your files to be synced to and with the skip_file line you can specify which of the files/folders shouldn’t be synced on your computer
STEP 4 – Running OneDrive
After setting the config file, you can freely run OneDrive, here are some of the commands:
onedrive [ opens onedrive and synchronises new files and folder (it stays open in terminal) ] onedrive --resync [ this should be used if you changed the sync_dir or if you need all synced files and folders to be rechecked and resynced ] onedrive --monitor & [ this command opens onedrive and monitors for new or changed files on OneDrive, runs in the background as a process ]
To run OneDrive as a service:
systemctl --user enable onedrive
systemctl --user start onedrive
As I’ve said in the first paragraph, none of this is my work nor did I figure out the guide to install OneDrive on Linux, I’m just replicating it so it is easier to find. I have also elaborated on some things I found unclear when reading the guide there.