abraunegg-onedrive/docs/INSTALL.md
abraunegg 7857a5057f
Update INSTALL.md
* Explicitly add details re process to upgrade client
2021-07-31 10:26:11 +10:00

25 KiB
Raw Blame History

Installing or Upgrading using Distribution Packages or Building the OneDrive Client for Linux from source

Installing or Upgrading using Distribution Packages

This project has been packaged for the following Linux distributions as per below. The current client release is: Version

Only the current release version or greater is supported.

Important Note:

Distribution packages may be of an older release when compared to the latest release that is available. If a package is out of date, please contact the package maintainer for resolution.

Distribution Package Name & Package Link   PKG_Version    i686  x86_64 ARMHF AARCH64 Extra Details
Alpine Linux onedrive Alpine Linux Edge package not_supported supported not_supported supported
Arch Linux

Manjaro Linux
onedrive-abraunegg AUR package supported supported supported supported Install via: pamac build onedrive-abraunegg from the Arch Linux User Repository (AUR)

Note: If asked regarding a provider for 'd-runtime' and 'd-compiler', select 'liblphobos' and 'ldc'

Note: System must have at least 1GB of memory & 1GB swap space
Debian onedrive Debian Testing package supported supported supported supported It is recommended that for Debian that you install from OpenSuSE Build Service using the Debian Package Install Instructions
Fedora onedrive Fedora Rawhide package supported supported supported supported
Gentoo onedrive No API Available supported supported not_supported not_supported
NixOS onedrive nixpkgs unstable package not_supported supported not_supported not_supported Use package onedrive either by adding it to configuration.nix or by using the command nix-env -iA <channel name>.onedrive. This does not install a service. To install a service, use unstable channel (will stabilize in 20.09) and add services.onedrive.enable=true in configuration.nix. You can also add a custom package using the services.onedrive.package option (recommended since package lags upstream). Enabling the service installs a default package too (based on the channel). You can also add multiple onedrive accounts trivially, see documentation.
OpenSuSE onedrive openSUSE Tumbleweed package supported supported not_supported not_supported
OpenSuSE Build Service onedrive No API Available supported supported supported supported Package Build Service for Debian and Ubuntu
Raspbian onedrive Raspbian Stable package not_supported not_supported supported not_supported
Slackware onedrive SlackBuilds package supported supported not_supported not_supported
Solus onedrive Solus package supported supported not_supported not_supported
Ubuntu 18.04 onedrive Ubuntu 18.04 package supported supported supported not_supported Note: Do not install from Ubuntu Universe

You must compile from source for this version of Ubuntu
Ubuntu 20.04 onedrive Ubuntu 20.04 package not_supported supported supported supported Note: Do not install from Ubuntu Universe

Install from OpenSuSE Build Service using the Ubuntu Package Install Instructions
Ubuntu 20.10 onedrive Ubuntu 20.10 package not_supported supported supported supported Note: Do not install from Ubuntu Universe

Install from OpenSuSE Build Service using the Ubuntu Package Install Instructions
Ubuntu 21.04 onedrive Ubuntu 21.04 package not_supported supported supported supported Note: Do not install from Ubuntu Universe

Install from OpenSuSE Build Service using the Ubuntu Package Install Instructions
Void Linux onedrive Void Linux x86_64 package supported supported not_supported not_supported

Important information for all Ubuntu and Ubuntu based distribution users:

This information is specifically for the following platforms and distributions:

  • Ubuntu
  • Lubuntu
  • Linux Mint
  • POP OS
  • Peppermint OS

Whilst there are onedrive packages available for Ubuntu, do not install 'onedrive' from these packages via apt install onedrive. The default Ubuntu Universe packages are out-of-date and are not supported and should not be used. If you wish to use a package, it is highly recommended that you utilise the OpenSuSE Build Service to install packages for these platforms. If the OpenSuSE Build Service does not cater for your version, your only option is to build from source.

If you wish to change this situation so that you can just use 'apt install onedrive', consider becoming the Ubuntu package maintainer and contribute back to the community.

Building from Source - High Level Requirements

Note: DMD version >= 2.083.1 or LDC version >= 1.12.0 is required to compile this application

Example for installing DMD Compiler

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

Example for installing LDC Compiler

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

Distribution Package Dependencies

Dependencies: Ubuntu 16.x

Ubuntu Linux 16.04 LTS reached the end of its five-year LTS window on April 30th 2021 and is no longer supported.

Dependencies: Ubuntu 18.x / Lubuntu 18.x / Debian 9 - i386 / i686

These dependencies are also applicable for all Ubuntu based distributions such as:

  • Lubuntu
  • Linux Mint
  • POP OS
  • Peppermint OS

Important: The DMD compiler cannot be used in its default configuration on Ubuntu 18.x / Lubuntu 18.x / Debian 9 i386 / i686 architectures due to an issue in the Ubuntu / Debian linking process. See https://issues.dlang.org/show_bug.cgi?id=19116 for further details.

Note: Ubuntu 18.x validated with the DMD compiler on the following Ubuntu i386 / i686 platform:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"

Note: Lubuntu 18.x validated with the DMD compiler on the following Lubuntu i386 / i686 platform:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.10
DISTRIB_CODENAME=cosmic
DISTRIB_DESCRIPTION="Ubuntu 18.10"

Note: Debian 9 validated with the DMD compiler on the following Debian i386 / i686 platform:

cat /etc/debian_version 
9.11

First install development dependencies as per below:

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git
sudo apt install curl

For notifications the following is also necessary:

sudo apt install libnotify-dev

Second, install the DMD compiler as per below:

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

Thirdly, reconfigure the default linker as per below:

sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
sudo update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10

Dependencies: Ubuntu 18.x, Ubuntu 19.x, Ubuntu 20.x / Debian 9, Debian 10 - x86_64

These dependencies are also applicable for all Ubuntu based distributions such as:

  • Lubuntu
  • Linux Mint
  • POP OS
  • Peppermint OS
sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git
sudo apt install curl
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is also necessary:

sudo apt install libnotify-dev

Dependencies: CentOS 6.x / RHEL 6.x

CentOS 6.x and RHEL 6.x reached End of Life status on November 30th 2020 and is no longer supported.

Dependencies: Fedora < Version 18 / CentOS 7.x / RHEL 7.x

sudo yum groupinstall 'Development Tools'
sudo yum install libcurl-devel
sudo yum install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is also necessary:

sudo yum install libnotify-devel

Dependencies: Fedora > Version 18 / CentOS 8.x / RHEL 8.x

sudo dnf groupinstall 'Development Tools'
sudo dnf install libcurl-devel
sudo dnf install sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd

For notifications the following is also necessary:

sudo dnf install libnotify-devel

Dependencies: Arch Linux & Manjaro Linux

sudo pacman -S make pkg-config curl sqlite ldc

For notifications the following is also necessary:

sudo pacman -S libnotify

Dependencies: Raspbian (ARMHF)

Validated using:

  • Linux raspberrypi 5.4.79-v7+ #1373 SMP Mon Nov 23 13:22:33 GMT 2020 armv7l GNU/Linux (2020-12-02-raspios-buster-armhf) using Raspberry Pi 2 Model B
  • Linux raspberrypi 5.4.83-v8+ #1379 SMP PREEMPT Mon Dec 14 13:15:14 GMT 2020 aarch64 (2021-01-11-raspios-buster-armhf) using Raspberry Pi 3 Model B+

Note: Build environment must have at least 1GB of memory & 1GB swap space. Check with swapon.

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git
sudo apt install curl
wget https://github.com/ldc-developers/ldc/releases/download/v1.17.0/ldc2-1.17.0-linux-armhf.tar.xz
tar -xvf ldc2-1.17.0-linux-armhf.tar.xz

For notifications the following is also necessary:

sudo apt install libnotify-dev

Dependencies: Ubuntu 20.x / Debian 10 (ARM64)

Validated using:

  • Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1028-raspi aarch64) (ubuntu-20.04.2-preinstalled-server-arm64+raspi) using Raspberry Pi 3 Model B+

Note: Build environment must have at least 1GB of memory & 1GB swap space. Check with swapon.

sudo apt install build-essential
sudo apt install libcurl4-openssl-dev
sudo apt install libsqlite3-dev
sudo apt install pkg-config
sudo apt install git
sudo apt install curl
wget https://github.com/ldc-developers/ldc/releases/download/v1.25.1/ldc2-1.25.1-linux-aarch64.tar.xz
tar -xvf ldc2-1.25.1-linux-aarch64.tar.xz

For notifications the following is also necessary:

sudo apt install libnotify-dev

Dependencies: Gentoo

sudo emerge app-portage/layman
sudo layman -a dlang

Add ebuild from contrib/gentoo to a local overlay to use.

For notifications the following is also necessary:

sudo emerge x11-libs/libnotify

Dependencies: OpenSuSE Leap 15.0

sudo zypper addrepo https://download.opensuse.org/repositories/devel:languages:D/openSUSE_Leap_15.0/devel:languages:D.repo
sudo zypper refresh
sudo zypper install gcc git libcurl-devel sqlite3-devel dmd phobos-devel phobos-devel-static

For notifications the following is also necessary:

sudo zypper install libnotify-devel

Dependencies: OpenSuSE Leap 15.1

sudo zypper addrepo https://download.opensuse.org/repositories/devel:languages:D/openSUSE_Leap_15.1/devel:languages:D.repo
sudo zypper refresh
sudo zypper install gcc git libcurl-devel sqlite3-devel dmd phobos-devel phobos-devel-static

For notifications the following is also necessary:

sudo zypper install libnotify-devel

Dependencies: OpenSuSE Leap 15.2

sudo zypper refresh
sudo zypper install gcc git libcurl-devel sqlite3-devel dmd phobos-devel phobos-devel-static

For notifications the following is also necessary:

sudo zypper install libnotify-devel

Compilation & Installation

High Level Steps

  1. Install the platform dependancies for your Linux OS
  2. Activate your DMD or LDC compiler
  3. Clone the GitHub repository, run configure and make, then install
  4. Deactivate your DMD or LDC compiler

Building using DMD Reference Compiler

Before cloning and compiling, if you have installed DMD via curl for your OS, you will need to activate DMD as per example below:

Run `source ~/dlang/dmd-2.081.1/activate` in your shell to use dmd-2.081.1.
This will setup PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1.
Run `deactivate` later on to restore your environment.

Without performing this step, the compilation process will fail.

Note: Depending on your DMD version, substitute 2.081.1 above with your DMD version that is installed.

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure
make clean; make;
sudo make install

Build options

Notifications can be enabled using the configure switch --enable-notifications.

Systemd service files are installed in the appropriate directories on the system, as provided by pkg-config systemd settings. If the need for overriding the deduced path are necessary, the two options --with-systemdsystemunitdir (for the Systemd system unit location), and --with-systemduserunitdir (for the Systemd user unit location) can be specified. Passing in no to one of these options disabled service file installation.

By passing --enable-debug to the configure call, onedrive gets built with additional debug information, useful (for example) to get perf-issued figures.

By passing --enable-completions to the configure call, shell completion functions are installed for bash, zsh and fish. The installation directories are determined as far as possible automatically, but can be overridden by passing --with-bash-completion-dir=<DIR>, --with-zsh-completion-dir=<DIR>, and --with-fish-completion-dir=<DIR> to configure.

Building using a different compiler (for example LDC)

ARMHF Architecture (Raspbian etc)

Note: Build environment must have at least 1GB of memory & 1GB swap space. Check with swapon.

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure DC=~/ldc2-1.17.0-linux-armhf/bin/ldmd2
make clean; make
sudo make install

ARM64 Architecture

Note: Build environment must have at least 1GB of memory & 1GB swap space. Check with swapon

git clone https://github.com/abraunegg/onedrive.git
cd onedrive
./configure DC=~/ldc2-1.25.1-linux-aarch64/bin/ldmd2
make clean; make
sudo make install

Uninstalling the client

From within your GitHub repository clone, perform the following to remove the 'onedrive' binary:

sudo make uninstall

If you are not upgrading your client, to remove your application state and configuration, perform the following additional step:

rm -rf ~/.config/onedrive

Note: If you are using the --confdir option, substitute ~/.config/onedrive above for that directory.

If you want to just delete the application key, but keep the items database:

rm -f ~/.config/onedrive/refresh_token

Upgrading the client

If you have installed the client from a distribution package, the client will be updated when the distribution package is updated by the package maintainer and will be updated to the new application version when you perform your package update.

If you have built the client from source, to upgrade your client, you must first uninstall your existing 'onedrive' binary (see above), then re-install the client by re-cloning, re-compiling and re-installing the client again to install the new version.

To confirm you have the new version installed, use onedrive --version to determine the version that is now installed.