
Installing Microsoft OneDrive on Linux Mint 22 allows you to seamlessly sync your files between your Linux system and your Microsoft cloud storage. While there isn’t an official client from Microsoft for Linux, you can use a robust and well-maintained third-party client. This guide walks you through the process of setting up the onedrive command-line client.
This client provides reliable synchronization capabilities, allowing you to keep your files updated across all your devices connected to your OneDrive account.
Step 1: Add the onedrive PPA
The easiest way to install the latest version of the onedrive client is by using its dedicated Personal Package Archive (PPA). Open your terminal and run the following command:
sudo add-apt-repository ppa:yann1ck/onedrive
You might be prompted to press Enter to confirm adding the repository. Do so to continue.
Step 2: Update Your Package List
After adding the new repository, you need to update your system’s list of available packages. This ensures that your system knows about the software available in the newly added PPA. Run this command:
sudo apt update
Step 3: Install the onedrive Client
Now that your package list is updated, you can install the onedrive client software. Execute the following command in your terminal:
sudo apt install onedrive
Confirm the installation by pressing Y when prompted. The system will download and install the necessary files.
Step 4: Authenticate with Your OneDrive Account
After installation, you need to link the client to your OneDrive account. This is done by authenticating through your web browser. Run the onedrive command for the first time without any options:
onedrive
The client will output a special URL to your terminal. Copy this entire URL.
Open your web browser and paste the copied URL into the address bar. This will take you to a Microsoft login page. Log in with your Microsoft account credentials associated with your OneDrive storage.
After successfully logging in and authorizing the application (you might see a page asking for permissions), your browser will be redirected to a blank page with a new URL in the address bar. Copy this new URL.
Go back to your terminal where the onedrive command is still waiting. Paste the second URL you copied from the browser into the terminal and press Enter.
The client will now authenticate and create the necessary configuration files (typically located in ~/.config/onedrive/). If successful, you will see messages indicating that authentication is complete and it might start a sync process.
Step 5: Initial Synchronization and Configuration
Once authenticated, the onedrive client will perform its initial sync. By default, it might start downloading all your files from the cloud into a folder named OneDrive in your home directory (~/OneDrive).
You can configure the client’s behavior (like choosing specific folders to sync, ignoring certain files, etc.) by editing the configuration file:
nano ~/.config/onedrive/config
Use a text editor like nano or gedit to open and modify this file. Save changes and close the editor.
Step 6: Running OneDrive Automatically (Optional)
To keep your files synced automatically, you can enable and start the onedrive service using systemd (specifically, the user-level systemd service).
To enable the service to start automatically when you log in:
systemctl --user enable onedrive
To start the service immediately for the current session:
systemctl --user start onedrive
You can check the status of the service with:
systemctl --user status onedrive
This service will run in the background, monitoring your OneDrive folder for changes and syncing them with the cloud.
You have now successfully installed and configured the onedrive client on your Linux Mint 22 system, allowing you to keep your files synchronized effortlessly.
Source: https://linuxways.net/mint/how-to-install-onedrive-on-linux-mint-22/