Installation of Backintime on CentOS7

Back-in-time
Back-in-time

Introduction

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.

But…

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.

To install a recent version of Python3 on CentOS, I have made use of the CentOS IUS repository.  I find this much simpler and easier to use than Redhat’s Software Collections.

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:

  • meld-3.16.4-2.el7.noarch
  • 1:dbus-devel-1.6.12-17.el7.x86_64
  • glib2-devel-2.46.2-4.el7.x86_64
  • dbus-glib-devel-0.100-7.el7.x86_64
  • sip-4.14.6-4.el7.x86_64
  • 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

  • qt5-qtbase-5.6.1-10.el7.x86_64
  • qt5-qtbase-gui-5.6.1-10.el7.x86_64
  • qt5-qtbase-devel-5.6.1-10.el7.x86_64
  • python36u-3.6.2-1.ius.centos7.x86_64
  • python36u-libs-3.6.2-1.ius.centos7.x86_64
  • python36u-devel-3.6.2-1.ius.centos7.x86_64
  • python36u-setuptools-33.1.1-1.ius.centos7.noarch
  • python36u-pip-9.0.1-1.ius.centos7.noarch
$ 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, dbus.mainloop.pyqt5 support.

SIP

Download SIP from the riverbankcomputing website. Then follow their install Instructions. The following is a TL;DR version.

$ 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

PyQt5

Download PyQt5 from the riverbankcomputing website. Then follow their install Instructions. The following is a TL;DR.

$ 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:

$ backintime-qt

or via the menu.

Go forth, and backup your CentOS workstation!

backintime-centos7
Screenshot of Back-in-time running on CentOS7

8 thoughts on “Installation of Backintime on CentOS7

Add yours

  1. I am having a couple of problems with your steps:
    yum groupinstall “Development Tools”
    There is no installed groups file.

    Then when I run backintime-qt, I get:
    Traceback (most recent call last):
    File “/usr/share/backintime/qt/app.py”, line 35, in
    import qttools
    File “/usr/share/backintime/qt/qttools.py”, line 21, in
    from PyQt5.QtGui import (QFont, QColor, QKeySequence)
    ModuleNotFoundError: No module named ‘PyQt5’

    Suggestions?

    1. Hi Randy,

      Has been a while since I have used this procedure. What do you mean by “There is no installed groups file”?

      Keep in mind also that version numbers are likely to have updated since I wrote the document, so you may need to substitute accordingly.

      Damien.

  2. Hello,

    Almost everything agrees until:
    $ cd dbus
    $ patch -p0 dbus.pro
    23a24,25
    > INCLUDEPATH += /usr/include/dbus-1.0
    > INCLUDEPATH += /usr/lib64/dbus-1.0/include

    there is no such file as dbus.pro
    is only dbus.cpp

    1. Hi Roman,

      If the file to be patched no longer exists, then it may be that this bug has already been resolved and the step is no longer necessary. The article was written almost a year ago now.

      Let us know how you go.

      Damo.

      1. Unfortunately, without this step, the installation PyQt5_gpl-5.9 ends with a no files “dbus/dbus.h” then error
        I tried to install PyQt5_gpl-5.11.2 requires 4.19.11 sip
        I installed sip 4.19.11 he can still see in the 4.19.3 system

  3. Hello Damo,

    Thank you for sharing these instructions. I would have had no chance of getting BackInTime working without them.

    Unfortunately I have encountered an error when trying to start BackInTime

    The installation steps appeared to complete successfully

    But this is what I see when I try to start

    Traceback (most recent call last):
    File “/usr/share/backintime/qt/app.py”, line 35, in
    import qttools
    File “/usr/share/backintime/qt/qttools.py”, line 21, in
    from PyQt5.QtGui import (QFont, QColor, QKeySequence)
    ModuleNotFoundError: No module named ‘PyQt5’

    Thanks again

    VW

  4. Hello Damo,

    Results from find:

    $ find . -name “PyQt5*”
    ./sip-4.19.3/PyQt5_gpl-5.9.tar.gz
    ./sip-4.19.3/PyQt5_gpl-5.9
    ./sip-4.19.3/PyQt5_gpl-5.9/PyQt5.pro

  5. Hi Vedub,

    I can’t really be of much assistance as I haven’t used Backintime with CentOS for some time now. If you need this combination, perhaps a container-based solution would work for you, like singularity, snap, appimage and so on. If you can find a bundled version of Backintime using one of these container system you might have more success. If you find one of these works for you, share your success with us here.

    Good luck.

    Damo.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: