How to download GOG games from the command line on Linux

Last updated on September 13, 2020 by Adrien Brochard

If you are a gamer and a Linux user, you probably were delighted when GOG announced that it would start proposing games for your favorite OS. If you have never heard of GOG before, I encourage you to check out their catalog of "good old games", reasonably priced, DRM-free, and packed with goodies. However, if the Windows client for GOG existed for quite some time now, an official Linux version is nowhere to be seen. So if waiting for the official version is uncomfortable for you, an unofficial open source program named LGOGDownloader gives you access to your library from the command line.

Install LGOGDownloader on Linux

Install LGOGDownloader on Ubuntu or Debian

For Debian-based users, the official page recommends that you download the sources and do:

$ sudo apt-get install build-essential libcurl4-openssl-dev liboauth-dev libjsoncpp-dev libhtmlcxx-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-program-options-dev libboost-date-time-dev libtinyxml-dev librhash-dev help2man 
$ tar -xvzf lgogdownloader-2.17.tar.gz 
$ cd lgogdownloader-2.17 
$ make release 
$ sudo make install

Install LGOGDownloader on Fedora

The credit for this build instruction goes to AM (in the comment below).

First, install prerequisite packages with yum.

$ sudo yum install tinyxml-devel jsoncpp-devel liboauth-devel libcurl-devel boost-devel help2man

Download source code of other required packages and lgogdownloader.

$ wget https://sites.google.com/site/gogdownloader/lgogdownloader-2.17.tar.gz
$ wget http://downloads.sourceforge.net/project/rhash/rhash/1.3.3/rhash-1.3.3-src.tar.gz
$ wget http://downloads.sourceforge.net/project/htmlcxx/htmlcxx/0.84/htmlcxx-0.84.tar.gz

Build and install rhash.

$ tar xfvz rhash-1.3.3-src.tar.gz; pushd rhash-1.3.3; make; make lib-shared lib-static; sudo make install-lib-shared install-lib-static; popd

To add /usr/local/lib to your LD_PATH, append /usr/local/lib line to /etc/ld.so.conf, and run the following command.

$ sudo ldconfig

Next, build and install htmlcxx.

$ tar xfvz htmlcxx-0.84.tar.gz; pushd htmlcxx-0.84; ./configure; vi html/tree.h; make; sudo make install; popd

htmlcxx source needs a fix with Fedora. After running the above command, when vi text editor opens up html/tree.h, add #include <cstddef> at line 53.

Now all dependencies are taken care of. Finally, let's compile and install lgogdownloader.

$ tar xfvz lgogdownloader-2.17.tar.gz; pushd lgogdownloader-2.17; vi Makefile; make; sudo make install; popd

lgogdownloader's Makefile needs slight editing as well. When vi editor opens up Makefile in the above command, change -I/usr/include/rhash to -I/path/to/rhash-1.3.3/librhash at line 16. Once you finish editing Makefile, the rest of the step will install lgogdownloader.

Install LGOGDownloader on Arch Linux

If you are an Arch Linux user, an AUR package is waiting for you.

Usage of LGOGDownloader

Once the program is installed, you will need to identify yourself with the command:

$ lgogdownloader --login

Notice that the configuration file if you need it is at ~/.config/lgogdownloader/config.cfg

Once authenticated, you can list all the games in your library with:

$ lgogdownloader --list

Then download one with:

$ lgogdownloader --download --game [game name]

You will notice that lgogdownloader allows you to resume previously interrupted downloads, which is nice because typical game downloads are not small.

Like every respectable command line utility, you can add various options:

As a side bonus, lgogdownloader also comes with the possibility to check for updates on the GOG website:

$ lgogdownloader --update-check

The result will list the number of forum and private messages you have received, as well as the number of updated games.

To conclude, lgogdownloader is pretty standard when it comes to command line utilities. I would even say that it is an epitome of clarity and coherence. It is true that we are far in term of features from the relatively recent Steam Linux client, but on the other hand, the official GOG windows client does not do much more than this unofficial Linux version. In other words lgogdownloader is a perfect replacement. I cannot wait to see more Linux compatible games on GOG, especially after their recent announcements to offer DRM free movies, with a thematic around video games. Hopefully we will see an update in the client for when movie catalog matches the game library.

What do you think of GOG? Would you use the unofficial Linux client? Let us know in the comments.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal (Credit Card) or Bitcoin (1M161JGAkz3oaHNvTiPFjNYkeABox8rb4g).

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Xmodulo © 2021 ‒ AboutWrite for UsFeed ‒ Powered by DigitalOcean