Install GnuCash 3.5 on CentOS 7

These instructions will assist you in installing GnuCash 3.5 on CentOS Linux 7. These instructions will also work for the older GnuCash versions 3.2, 3.3 and 3.4. Only difference is the cmake version, that was not available at the time of publishing. Check here:
Install GnuCash 3.3 on CentOS 7

Unfortunately, installing GnuCash 3 onto CentOS 7 is not as straight forward as installing the package (as it was for the older GnuCash 2 versions). This is due to newer required OS libraries that are/will not be shipped on CentOS 7 (like boost). So you have to compile the new libraries yourself and run them in parallel to the OS libraries. The overall process can take some hours, depending on your computer speed.

Have a look...

yum update # Get the latest updates just in case...

# let's start with building cmake
cd /tmp
yum -y install gcc-c++
tar xf cmake-${CMAKE_VERSION}.tar.gz
cd cmake-${CMAKE_VERSION}
./bootstrap && make && make install

# Install boost 1.70

cd /tmp
yum -y install gcc-c++ python-devel
tar xfj boost*.tar.bz2
cd boost_*
./b2 install
export BOOST_ROOT=/tmp/boost_1_70_0

# now off to compile gnucash

cd /tmp
yum -y install # install EPEL
yum -y install glib2-devel libxml2-devel libxslt-devel webkitgtk4-devel guile-devel gwenhywfar-devel aqbanking-devel ktoblzcheck-devel libofx-devel libsecret-devel libdbi-devel libdbi-dbd-mysql gtest-devel gmock-devel  iso-codes-devel
tar -xjf gnucash*
mkdir build-gnucash-3.5
cd build-gnucash-3.5
export BOOST_ROOT=/tmp/boost_1_70_0
# Option 1: Without Python bindings
/usr/local/bin/cmake ../gnucash-3.5
# Option 2: With Python plugin and bindings.
yum -y install python36-devel
/usr/local/bin/cmake -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3.6 -DWITH_PYTHON=ON ../gnucash-3.5

# Both options:
# NOTE: Should you have seen that a different boost version is being used, remove it for the time of installation (path is mentioned in the cmake log). Otherwise you will get an error message during GnuCash compilation: ice-9/boot-9.scm:106:20: In procedure dynamic-link: file: "libtest-core-guile", message: "file not found"

make install/strip # strip removes all debug info on installing

ln -s /usr/local/lib64/python3.6/site-packages/gnucash /usr/lib64/python3.6/site-packages/gnucash # Optional: do this if you want to use the python libraries in your custom code

# To start gnucash
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib # you have to do this every time. See my comment in the section LD_LIBRARY_PATH below

This should be it. If this was helpful for you, please click and view some of the ads on my page.


I intentionally did not add /usr/local/lib to the global library path to keep aligned with RedHat/CentOS as a long term stable strategy. One of the reasons to use Red Hat/CentOS is to have a reliable and stable system. The drawback is the lack of latest versions for many components (leading us to manually compile GnuCash, boost and cmake instead of using out of the box packages).  Now when adding our self-compiled, latest boost version to the global path will directly impact all other applications that are using the boost library (or in the /usr/local/lib folder) and depend on/tested on the built in version.

If you do accept the risk and would like to add the library path to your global settings, follow the below (untested by me) steps options. Option 1 is for real global settings. Option 2 is only for specific users (so you can use different users for different applications).

Option 1: True global setting

echo "/usr/local/lib" > /etc/ # I chose gnucash.conf as a file name to clearly mark the purpose. Maybe you want to chose local.lib.conf or anything else
# reboot might be required

Option 2: User specific

This really depends on the shell you are using (bash as default). If you are unsure, run "env | grep SHELL=" . For your own user, run this (add the above export line to the file):
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~/.bashrc # replace .bashrc with .<shell>rc if you use a different shell

For other users, use this command (replacing <username>)
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib" >> ~<username>/.bashrc # replace .bashrc with .<shell>rc if you use a different shell