Study/Linux

Linux 우분투에서 Onedrive 동기화 하기

AC 2023. 7. 16. 01:39

https://github.com/abraunegg/onedrive

 

GitHub - abraunegg/onedrive: #1 Free OneDrive Client for Linux

#1 Free OneDrive Client for Linux. Contribute to abraunegg/onedrive development by creating an account on GitHub.

github.com

위 주소를 참조한다.

 

설명은 위에서 보는 것을 추천하고 아래의 명령어들은 빠르게 설치하기 위해서 기록한다.

 

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

 

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.x 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

Ubuntu Linux 18.x LTS reached the end of its five-year LTS window on May 31th 2023 and is no longer supported.

Dependencies: Debian 9

Debian 9 reached the end of its five-year support window on June 30th 2022 and is no longer supported.

Dependencies: Ubuntu 20.x -> Ubuntu 23.x / Debian 10 -> Debian 11 - 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 libsqlite3-dev pkg-config git 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 sqlite-devel
curl -fsS https://dlang.org/install.sh | bash -s dmd-2.099.0

 

For notifications the following is also necessary:

sudo yum install libnotify-devel

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

sudo dnf groupinstall 'Development Tools'
sudo dnf install libcurl-devel 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) and Ubuntu 22.x / Debian 11 / Raspbian (ARM64)

Note: The minimum LDC compiler version required to compile this application is now 1.18.0, which is not available for Debian Buster or distributions based on Debian Buster. You are advised to first upgrade your platform distribution to one that is based on Debian Bullseye (Debian 11) or later.

These instructions were validated using:

  • Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 (2022-01-28-raspios-bullseye-armhf-lite) using Raspberry Pi 3B (revision 1.2)
  • Linux raspberrypi 5.10.92-v8+ #1514 SMP PREEMPT Mon Jan 17 17:39:38 GMT 2022 aarch64 (2022-01-28-raspios-bullseye-arm64-lite) using Raspberry Pi 3B (revision 1.2)
  • Linux ubuntu 5.15.0-1005-raspi #5-Ubuntu SMP PREEMPT Mon Apr 4 12:21:48 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux (ubuntu-22.04-preinstalled-server-arm64+raspi) using Raspberry Pi 3B (revision 1.2)

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 libsqlite3-dev pkg-config git curl ldc

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

 

 

Compilation & Installation

High Level Steps

  1. Install the platform dependencies 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.088.0/activate` in your shell to use dmd-2.088.0.
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.088.0 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) and ARM64 Architecture (Ubuntu 22.x / Debian 11 / Raspbian)

Note: The minimum LDC compiler version required to compile this application is now 1.18.0, which is not available for Debian Buster or distributions based on Debian Buster. You are advised to first upgrade your platform distribution to one that is based on Debian Bullseye (Debian 11) or later.

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=/usr/bin/ldmd2
make clean; make
sudo make install

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, it is recommended that you first uninstall your existing 'onedrive' binary (see below), then re-install the client by re-cloning, re-compiling and re-installing the client again to install the new version.

Note: Following the uninstall process will remove all client components including all systemd files, including any custom files created for specific access such as SharePoint Libraries.

You can optionally choose to not perform this uninstallation step, and simply re-install the client by re-cloning, re-compiling and re-installing the client again - however the risk here is that you end up with two onedrive client binaries on your system, and depending on your system search path preferences, this will determine which binary is used.

Important: Before performing any upgrade, it is highly recommended for you to stop any running systemd service if applicable to ensure that these services are restarted using the updated client version.

Post re-install, to confirm that you have the new version of the client installed, use onedrive --version to determine the client version that is now installed.

Uninstalling the client

Uninstalling the client if installed from distribution package

Follow your distribution documentation to uninstall the package that you installed

Uninstalling the client if installed and built from source

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 for the correct directory storing your client configuration.

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

rm -f ~/.config/onedrive/refresh_token

 

LIST