Google Drive is a very popular cloud-based drive and storage service. Google Drive can be used in different ways from Web, Android, iPhone, Windows, macOS, and Linux. But as today Google does not provide native Google Drive client for Linux distributions like Ubuntu, Debian, Centos, Mint, etc. Even Google advises Web Browser in order to work with Google Drive for Linux users there are some 3rd party applications, tools to connect Google Drive to the local Linux system.

Google云端硬盘是一种非常流行的基于云的驱动器和存储服务。 Google云端硬盘可以通过Web,Android,iPhone,Windows,macOS和Linux等多种方式使用。 但是,由于今天的Google尚未为Ubuntu,Debian,Centos,Mint等Linux发行版提供本地Google Drive客户端。即使Google建议Web浏览器,以便与Linux用户的Google Drive一起使用,也存在一些第三方应用程序,连接工具Google Drive到本地Linux系统。

Google Drive Linux客户端 Google Drive Linux Clients

There are a lot of different Google Drive clients for Linux operating systems but most of them are incomplete or unpractical or error-prone to use. In this tutorial, we will use the following 2 Google Drive clients that are superior to other alternatives.

Linux操作系统有很多不同的Google Drive客户端,但是大多数客户端不完整或不切实际或易于出错。 在本教程中,我们将使用以下2个优于其他替代品的Google云端硬盘客户端。

  • GNOME Online Accounts GNOME在线帐户
  • Google Drive OcamlfuseGoogle云端硬碟Ocamlfuse
带有GNOME在线帐户的Google云端硬盘 Google Drive with GNOME Online Accounts

GNOME Online Accounts is a Gnome project which is created in order to use some popular online services natively with a GNOME desktop. Google Drive is one of the supported online services by Gnome Online Accounts. Gnome Online Accounts is the most stable way to use Google Drive in a Linux operating system because of its Gnome community and support.

GNOME在线帐户是一个Gnome项目,创建该项目是为了在GNOME桌面上本地使用一些流行的在线服务。 Google云端硬盘是Gnome在线帐户支持的在线服务之一。 由于Gnome社区和支持,Gnome在线帐户是在Linux操作系统中使用Google Drive的最稳定方法。

In order to use GNOME Online Accounts first, we will install it with the following command. We can install and use the GNOME Online Accounts even we do not use the GNOME desktop environment as all dependencies will be installed automatically. So this means we can use Gnome Online Accounts with other desktop environments like KDE, XFCE, LXDE, etc.

为了首先使用GNOME在线帐户,我们将使用以下命令进行安装。 即使不使用GNOME桌面环境,我们也可以安装和使用GNOME联机帐户,因为所有依赖项都将自动安装。 因此,这意味着我们可以将Gnome在线帐户与其他桌面环境(例如KDE,XFCE,LXDE等)一起使用。

$ sudo apt install gnome-control-center gnome-online-accounts
GNOME Control Center
GNOME Control Center
Gnome Control Center
侏儒控制中心
Online AccountsGoogle
Online AccountsGoogle
Gnome Online Accounts Google Drive
Gnome在线帐户Google云端硬盘
poftut
poftut

In the following step, we will provide the password of the previously provided account. We will also display the password in clear text by clicking the eye icon in order to make sure password correctness.

在接下来的步骤中,我们将提供先前提供的帐户的密码。 通过单击眼睛图标,我们还将以明文形式显示密码,以确保密码正确。

Allow
Allow

In this step, we will allow our provided Google Account to be used with the following services. As we want to access Google Drive we will enable Documents in this case. An alternative we can enable or disable other services. For security reasons please disable the Google services you will not use.

在此步骤中,我们将允许我们提供的Google帐户与以下服务一起使用。 由于要访问Google云端硬盘,因此在这种情况下,我们将启用文档。 我们可以启用或禁用其他服务的替代方法。 出于安全原因,请禁用您将不使用的Google服务。

Now we have integrated Google Drive and use it with a native file browser like Gnome Files, Nautilus, etc. The added Google Drive account will be listed in the left location pane with the account email address as below. We can navigate Google drive files like local files and folders.

现在,我们已经集成了Google Drive,并将其与本地文件浏览器(如Gnome Files,Nautilus等)一起使用。添加的Google Drive帐户将在左侧位置窗格中列出,帐户电子邮件地址如下所示。 我们可以浏览Google驱动器文件,例如本地文件和文件夹。

带有Google云端硬盘Ocamlfuse的Google云端硬盘Google Drive with Google Drive Ocamlfuse

google-drive-ocamlfuse is a FUSE filesystem for Google Drive, written in OCaml. It lets you mount your Google Drive on Linux distributions. As a script or filesystem library it is managed via command line but can be used with GUI like File Browsers. It provides the following features.

google-drive-ocamlfuse是Google云端硬盘的FUSE文件系统,以OCaml编写。 它使您可以在Linux发行版上安装Google云端硬盘。 作为脚本或文件系统库,可通过命令行进行管理,但可与文件浏览器等GUI一起使用。 它提供以下功能。

.Trash.Trash

Let’s start the installation. As a non-standard script, we need to add some extra repository to our Linux system. Ocamlfuse packages are created for the Ubuntu distribution so in order to use other Linux distributions the source code installation should be executed which is explained here.

让我们开始安装。 作为非标准脚本,我们需要在Linux系统中添加一些额外的存储库。 Ocamlfuse的Ubuntu发行版中创建的软件包,以便使用其他Linux发行版的源代码安装应执行该解释在这里。

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

We will provide the user password with the following screen.

我们将在以下屏幕上提供用户密码。

Allow
Allow

We can also see the following screen where we need to allow the account to the Google Account.

我们还可以在以下屏幕上看到需要允许该帐户访问Google帐户的屏幕。

If everything is complete successfully we the web browser will be redirected to a success page which is like below and provided by gdfuse.

如果一切顺利完成,我们会将网络浏览器重定向到gdfuse提供的成功页面,如下所示。

googledrive
googledrive
$ google-drive-ocamlfuse googledrive

If there is no error message everything is ok. We can list the Google Drive files from the command line or a standard file manager like below.

如果没有错误消息,则一切正常。 我们可以从命令行或如下所示的标准文件管理器中列出Google云端硬盘文件。

$ ls -l googledrive/

As an extra check, we can list already mounted file systems with the df command where Google Drive will also list. We can also get information like available size, used size, total size, and percentage information.

作为一项额外的检查,我们可以使用df命令列出已经安装的文件系统,其中Google Drive也会列出。 我们还可以获得诸如可用大小,已用大小,总大小和百分比信息之类的信息。

$ df -lh