Back-in-time is a great backup solution for Linux written in Python 3. It provides similar features to that of Apple’s Timemachine backup system. With Back-in-time, you can automatically take snapshots of your files at regular intervals, and using a UI, restore files when needed. It’s actually pretty neat.
The developers have more or less, solely focused their development on Debian-based Linux distributions, such as Ubuntu. They provide PPA package repositories, and .deb builds of the software, but do not provide rpms for Redhat-based distros, such as CentOS.
It is however, not all their fault. They have moved onto using Python3, which is an entirely different beast to Python2, and not backwards compatible. Meanwhile, CentOS is equivalent to Canonical’s LTS releases, and only sports Python 2.7. This incompatibility between versions of Python is a real pain-in-the-arse! But I digress.
So this guide steps you through the process of installing all the necessary CentOS packages, compiles necessary libraries, and installs Back-in-time on CentOS7.
Default CentOS Configuration
This guide assumes that a
Gnome Desktop was the the chosen software installation. First thing is to update your system with all the latest package versions.
$ sudo yum -y update
CentOS/EPEL Package Requirements
Following is a list of all the packages required from either the base/updates repository for CentOS, or the EPEL repository:
- group “Development Tools”
$ sudo yum install meld dbus-devel glib2-devel dbus-glib-devel $ sudo yum groupinstall "Development Tools"
IUS Package Requirements
Now, lets go through the steps of adding the IUS repository to yum, and install the required packages.
Install IUS Package Manager
$ wget -O install.sh setup.ius.io $ sudo sh install.sh
Install the following packages from IUS
$ sudo yum install qt5-qtbase qt5-qtbase-gui qt5-qtbase-devel python36u python36u-libs python36u-devel python36u-setuptools- python36u-pip
PIP Package Requirements
Some Python3 modules are required by Back-in-time, that aren’t available from IUS. So we will use Python PIP package manager to install them. The following packages are required:
- SecretStorage (2.3.1)
- dbus-python (1.2.4)
$ sudo pip3.6 install SecretStorage dbus-python
We also need a C header file for dbus in the next step, so let’s download the source distribution for dbus-python and copy it into a common location.
$ sudo pip3.6 download dbus-python $ tar xzf dbus-python-1.2.4.tar.gz $ sudo cp -r dbus-python-1.2.4/include/dbus /usr/local/include/
Source Compile Requirements
Next, we need to compile and install SIP and PyQt5. Sadly this is necessary as the python wheel binary packages do not include pre-requisites for backintime. Sip is missing the
sip binary and PyQt5,
$ cd /usr/local/bin $ sudo ln -s /usr/bin/python3.6 python3 $ cd $ wget 'https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.3/sip-4.19.3.tar.gz' $ tar xzf sip-4.19.3.tar.gz $ cd sip-4.19.3 $ python3 configure.py $ make $ sudo make install
$ wget 'https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.9/PyQt5_gpl-5.9.tar.gz' $ tar xzf PyQt5_gpl-5.9.tar.gz $ cd PyQt5_gpl-5.9 $ python3 configure.py --dbus /usr/local/include/ --qmake /usr/bin/qmake-qt5
At this point, I have uncovered a bug in the configure.py script for generating the Makefiles for a Redhat-derived distribution. The following commands will solve the issue by way of a patch to one of the build files.
$ cd dbus $ patch -p0 dbus.pro 23a24,25 > INCLUDEPATH += /usr/include/dbus-1.0 > INCLUDEPATH += /usr/lib64/dbus-1.0/include
Now, press Ctrl-D to signal end of input and deploy the patch.
Now we rebuild the
Makefile and commence the compilation process
$ /usr/bin/qmake-qt5 -o Makefile dbus.pro $ cd .. $ make -j4 $ sudo make install
Now we can download and install backintime.
$ cd $ git clone https://github.com/bit-team/backintime.git $ cd backintime $ cd common $ ./configure && make $ sudo make install $ cd ../qt $ ./configure && make $ sudo make install
All things going well, you should now be able to start up backintime from an X session with:
or via the menu.
Go forth, and backup your CentOS workstation!