Methods to Use Google Drive on Ubuntu Linux

Channel: Linux
Abstract: we will set up Rclone to sync to Google Drive. To configure rcloneSlides Provides full read/write access to ordinary files and folders Installing Goog

Its now 2020 and we are still waiting for official google drive client from google, but we have few clients that work flawlessly.

In this tutorial, we'll focus on how to use Google Drive on Ubuntu 18.04. Ready? Let's dive in and see how this can be seamlessly achieved.

1) Ubuntu GNOME built-in Method Step 1. Installing GNOME Online Accounts feature

To start off, log in to your system as the root user or as a regular user with root privileges.  Next, run the command below to install the Google Online Accounts feature.

How to Upload Files to Google Drive...

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

How to Upload Files to Google Drive Using Python 3 Using Google Drive API V3 Full Project
sudo apt install gnome-online-accounts
Step 2. Launching GNOME Online Accounts Feature

Once successfully installed, start GNOME Online Accounts by running

gnome-control-center online-accounts

This will launch the Online Accounts Window as shown. Thereafter, click on  'Google'

This will prompt you for your email address. Type it in and hit Enter.

Next, provide your Account's password as shown and click on 'Next' or hit Enter.

The next Window, will display the all the features from your Account that GNOME wants to access.

Scroll to the bottom and Click on 'Allow'

By default, all the features as shown below will be synched. You can choose either to turn the Sync functionality OFF or ON. For best practice, leave the default settings as they are.

Great! We are all set! You can access your Google Drive folder using Nautilus File Manager commonly known as Files.

The drive folder can also be accessed by double-clicking on the mounted partition located on your GNOME's desktop as shown below.

It is important to note that when using the GNOME Online Accounts feature, Drives files will not be stored locally.

2) Using google drive ocamlfuse

Ocamlfuse is a FUSE-based file system backed by Google Drive. It is written in OCaml and lets you mount your Drive folder on your Linux System and gives you access to your files and folders, either via command line or GUI file manager.

Features

Below is a summary of some of the ocamlfuse features

  • Provides support for multiple accounts
  • Provides support for Symbolic links
  • Can handle duplicate files
  • Grants access to the trash directory
  • Maintains UNIX permissions and ownership
  • Handles read-only access to Google Docs - Sheets, Slides
  • Provides full read/write access to ordinary files and folders
Installing Google Drive Ocamlfuse on Ubuntu 18.04

To install the Ocamlfuse run the following commands in that order

$ sudo add-apt-repository ppa:alessandro-strada/ppa
$ sudo apt-get update
$ sudo apt-get install google-drive-ocamlfuse

Once successfully installed, authorize google-drive-ocamlfuse client with your desired Google account using the following command.

# google-drive-ocamlfuse

This is going to pop open a page on your browser where will request you to choose a Gmail  account to continue with the setup

Next, Gdfuse will request access to your account.

Click on the 'Allow' button to allow google-drive-ocamlfuse to access your Drive.

You'll then be prompted for your password

You will then be asked to choose the account to use

Finally, create a mount point in your home directory and mount the directory

$ mkdir ~/google-drive
$ google-drive-ocamlfuse ~/google-drive

To verify the creation and mounting of the directory, run

df -h

using Nautilus, you can click on File on the Menu and be sure to find a Google drive option at the bottom. Click on it and wait for a few seconds for file synchronization to begin. After a short while, you'll have access to all your files.

3) Insync

Insynch is a paid, powerful cross-platform GUI client tool that adds  drive functionality to your Linux desktop. Some of the features include:

  • Handling of multiple accounts
  • Gmail support
  • G-Suite support
  • Sync on Demand
  • On-demand synching of shared files
  • Desktop Notifications
  • Provides a common-line for Linux
  • Support for Raspberry Pi
  • Merging folders
  • Support for symlinks

To install Insync head out to Isync's Official download page and select your System's distribution. For this case, we will download the Debian package for Ubuntu 18.04. as shown

Select accordingly your Operating System, version and architecture and click on 'Download'. This will download the Debian package for Ubuntu 18.04 version

Once the Debian package, install Insync by opening the terminal, navigating to the folder containing the Debian package and run

$ sudo dpkg -i  insync_1.5.5.37367_amd64.deb

Upon successful installation, Launch the Search Menu, search for the application and launch it.

This will pop open the Insync Window below. Click on 'Add a Google Account'

This will open a browser page where will ask for your email-id. Provide your email and click 'Next'.

Next, you will be prompted for your password. Once you've keyed in your password hit on 'Next'

Here, you will be required to Allow Insync to makes changes to your Drive account

Scroll down and hit 'Allow'

Nautilus integration with Google Drive will thereafter commence.

Click on 'Yes' to integrate Insync with Nautilus

Select your preferred pricing

Synching of files will begin

4) Rclone

Rclone is a command line tool used for synchronizing files and directories from a myriad of cloud service. These include DropBox, Amazon S3, Google Drive, OneDrive Nextcloud and many more.

Now, let's see how we can install Rclone.

Read Also: Rclone - Sync File and Directories to Cloud Storage in Linux

Installation

We'll install Rclone from a precompiled binary. To do this, open a terminal window and issue the following commands:

First, download the rclone zip file using the curl command

$ curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip


Next, unzip the rclone zipped file

$ unzip rclone-current-linux-amd64.zip

Navigate into the file

$ cd rclone-*-linux-amd64

Now, copy the binary file and give it the proper permissions with the following commands:

$ sudo cp rclone /usr/bin/
$ sudo chown root:root /usr/bin/rclone
$ sudo chmod 755 /usr/bin/rclone

Finally, install the manpage with the commands:

$ cp rclone.1 /usr/local/share/man/man1/
$ sudo mandb
Configuring Rclone

Next, we will set up Rclone to sync to Google Drive.

To configure rclone, issue the command:

# rclone config

You will be required to select the type of storage you'd want to configure. Select the appropriate number corresponding

You will be asked a number of questions, most of which are self-explanatory.

The only questions that might give you a headache are

Value "client_id"
Value "client_secret"
Value "root_folder_id"
Value "service_account_file"

To all of the above, just hit Enter.

For the Value "scope" = you can provide whatever name you want. By default, it will be drive. You can leave that or type something more meaningful.

Eventually, your default browser will pop open, prompting you to select which Google account you'd like to use. If at this point you've not already signed into your account, you'll be required to do so at this point. Once that completes, answer a few more simple questions and then quit the configuration script. Your connection is now set up.

Allow rclone to access your account by clicking on the "Allow" button

You'll get the following confirmation that it has been successful.

To copy a file to Google-drive using rclone command type

$ rclone copy /home/username/path/to/local/data/folder/ nameofconnection:remotefolder

Drive-CLI is another command line utility tool for drive to access, sync, download, upload directly to your drive. We hope that this tutorial has been helpful. Go ahead and try out some tools and let us know what your experience was! Your contribution will be appreciated.

Read Also:
  • DriveSync - Sync Local Files with Google Drive from Linux CLI

Ref From: linoxide
Channels:

Related articles