Introducing Grive

Grive source code is available at GitHub if you want to tinker with it. Setup is a bit of a pain right now, and it requires some command-line work, which is not uncommon in Linux. But, I am here to show you how to install it on RPM-based Linux (CentOS, Fedora and Red Hat).

For starters, you need a dedicated machine or virtual server, as well as a reliable Internet connection.

In this scenario, let's use CentOS. As you may know, CentOS is an enterprise-class Linux distribution derived from sources freely provided to the public by the Upstream OS Provider (

I strongly recommend using CentOS 6.0, because CentOS 6.0 has been completely rebuilt with a newer build system and library checks to confirm upstream binary compatibility. It also brings a new kernel, new versions of key server components and improved virtualization support.

Before you install Grive, you need to do some preparatory work. Note: all the following commands must be run as root.

First, update your CentOS. This is optional, but I strongly recommend it. Run the yum command:

[root@system ~]# yum update 

Next, disable SELINUX, and simply edit the /etc/selinux/config file:

[root@system ~]# vi /etc/selinux/config

Then add a line like:


Now, you need to enable an extra repository, ATrpms.

ATrpms is a third-party RPM repository. Its original focus was upon software used in natural sciences, especially in the field of high-energy physics, such as tools for numerical programming or for scientific publications. Since then, this repository includes many non-scientific software titles, like system tools or multimedia packages, resulting in a far more generic repository. Currently, packages are built only for Red Hat Linux flavors.

Install and enable ATrpms in CentOS by running the following commands:

[root@system ~]# cd /tmp
[root@system ~]# wget
[root@system ~]# wget
[root@system ~]# rpm --import RPM-GPG-KEY.atrpms
[root@system ~]# rpm -ivh atrpms-repo-6-5.el6.i686.rpm

Next, you must run the following commands to install the required packages:

[root@system ~]# yum install automake autoconf  \
openssl openssl-devel json-c json-c-devel curl \ 
curl-devel libcurl-devel libcurl libarchive \
libarchive-devel libidn libidn-devel expat \
expat-devel binutils binutils-devel

CMake is a cross-platform build system generator. CMake is used to control the software compilation process using simple platform- and compiler-independent configuration files. Check your CMake package version:

[root@system ~]# rpm -qa | grep -i cmake

If the version of CMake is <2.8, you need to update the CMake package by running the following commands:

[root@system ~]# yum remove cmake
[root@system ~]# yum install cmake  \ 
--disablerepo=*  --enablerepo=atrpms-testing 

Boost provides free peer-reviewed portable C++ source libraries. Boost libraries are intended to be widely useful and usable across a broad spectrum of applications.

Now, check your Boost package version:

[root@system ~]# rpm -qa | grep -i boost

If the version of Boost is <1.46, you need to update the Boost package by running the following commands:

[root@system ~]# yum remove boost boost-devel 
[root@system ~]# cd /tmp
[root@system ~]# wget
[root@system ~]# tar -xvf boost_1_49_0.tar.gz
[root@system ~]# cd boost_1_49_0
[root@system ~]# ./ --prefix=/usr
[root@system ~]# ./b2 install

Installing the Boost libraries will take up to 15 minutes, depending on your hardware, so be patient.

Make sure your system time and date are correct. Run the following command if required:

[root@system ~]# ntpdate -b -p 8 -u

With all the pieces in place, you are ready to install Grive. The project's Web site offers access to the source code using Git. To download Grive, run:

[root@system ~]# cd ~
[root@system ~]# mkdir -p ~/.grive
[root@system ~]# cd /tmp
[root@system ~]# git clone
[root@system ~]# cd grive
[root@system ~]# cmake \
[root@system ~]# make all install

The first time you run Grive, use the -a argument to grant permission to Grive to access to your Google Drive. The -a option is needed only the very first time you run Grive:

[root@system ~]# cd ~/.grive/
[root@system ~]# /usr/bin/grive -a

After running the command above, a URL should be displayed in the terminal—copy that URL and paste it in a Web browser.

You will need to log in to your Google account if you have not done so. In the newly loaded page, you will be asked to give Grive permission to access your Google Drive, and after clicking "Allow access", an authentication code will be displayed. Copy this code and paste it in the terminal where you ran Grive:

Please go to this URL and get an authentication code:

Please input the authentication code here

That's it. Now, each time you want to sync Google Drive with your local grive folder, navigate to the .grive folder and run /usr/bin/grive (this time without the -a, because you already have authenticated Grive with Google Drive). You can set up a cron job if you want to do this on a regular basis.

If everything works fine, Grive will create a .grive file in your home directory. It also will start downloading files from your Google Drive to your current directory. After all this business is done, all you need to do to refresh your Google Drive files is run Grive from the terminal.

Is it as convenient as Google's official desktop solutions? No, but you are not running Linux because you are looking for easy solutions.

Ending Notes

If you get a "crash" (a bunch of error messages on the screen), you should run:

[root@system ~]# /usr/bin/grive   -l   log.txt

Because the file will contain a log of the sync operation, you may want to edit the file first to remove personally sensitive information and then send it to Grive developers.

Keep up with the posts at and for the latest information, especially regarding news on newly discovered bugs and when you need to download and build again!


The Grive Project—an Open-Source Linux Client for Google Drive:

The Official Google Blog, "Introducing Google Drive":!/2012/04/introducing-google-drive-yes-really.html

"Grive: Open Source Google Drive Client for Linux":

The Google Drive FAQ:


Sayyed Mehdi Poustchi Amin is currently a PhD research student in computer science at SIU. His research is focused on developing honeypot decoys for analysis of Internet attacks. His professional certifications include CCNA, MCTS, MCITP and MCSE.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

لقد تم استخدام محرر مستندات جوجل / محرك لعدة سنوات.

Clipping Path's picture

لقد تم استخدام محرر مستندات جوجل / محرك لعدة سنوات.

قرأت عن مادتين في اليوم الواحد يمكن أن يوحي تعطيل ميزة SELinux إذا أريد تثبيت هذا، أو ذلك.

Reply to comment | Linux Journal

Leather Sofas's picture

Article writing is also a fun, if you be familiar
with then you can write otherwise it is complicated to write.

what's the difference of

Dzak's picture

what's the difference of other online storage services? it depends on every user and what interface likes.
i ll give a try on this...

Grive & Google Docs

Don Desjardin's picture

Yes, the basic sync function works like DropBox. I can put a file in the Grive folder, run "grive", and it shows up in the cloud.

The only problem I see (and it's a big one) is that Grive doesn't pull/sync any of the docs created by Google Docs.

ایول داره. زنده باشی. این تو

AliAli's picture

ایول داره.
زنده باشی.

این تو ایرانم کار میکنه؟


salder's picture

Ditto all of the SELinux comments.

Use Insync instead

Anonymous's picture

I've been using Google Docs/Drive for several years. Following the switch to "Drive", I didn't care much for the interface of their syncing program and found a great alternative: Insync. I currently have it running on Win7, Mac OS X, Linux Mint and Ubuntu 10.04. Works great, check it out at:


Colin's picture

Ok article. Although I would like to know about who else is putting out Gdrive services.

On SELINUX. You should never DISABLE it.


Will keep the SELINUX configuration and file permissions in place but it will only chuck out warning messages. If you set SELINUX to disabled then you are killing off your opportunity to enable it in the future.

SELinux is good for you

Gergely Polonkai's picture

I read about two articles per day that suggests disabling SELinux if I want to install this-or-that. I think it's a very bad practice. SELinux is good for you. It's not a coincidence that more and more vendors enable it by default. Please stop giving such bad advices already!

The article is a great showcase of Drive and Grive in general otherwise. Keep up the good work!