August 4, 2016 - rob

Installing older keepassx on Ubuntu / Linux Mint

I recently upgraded to Linux Mint 18 from 17.3.   While the upgrade went well, it did break my keepass install.   While I could get the newer version via the software manager, it is not backwards compatible with the 0.4.3 or 0.4.4 databases.   Since I share one of mine with another person, upgrading at this point is not an option.

When trying to install keepass 0.4.3 from source, it kept failing trying to make “error: ‘getpid’ was not declared in this scope”.   I finally found a patch that fixes that issue and allows the rest of the install to work.   The fix is here:



  1. Navigate to download all old versions – specifically keepassx-0.4.3.tar.gz
  2. Use this patch or copy from the code pasted below and save to a file keepassx-0.4.3-gcc47.patch

keepassx-0.4.3-gcc47.patch file contents:

diff -Naur keepassx-0.4.3/src/lib/random.cpp
--- keepassx-0.4.3/src/lib/random.cpp   2009-06-28 16:22:31.000000000 +0200
+++   2012-04-19 00:20:15.757415510 +0200
@@ -19,6 +19,7 @@

 #include "random.h"
+#include <unistd.h>

 #if defined(Q_WS_X11) || defined(Q_WS_MAC)
  1. tar -xzf keepassx-0.4.3.tar.gz extract your keepass source folder
  2. cd into the folder
  3. sudo apt-get install cmake (or if using .4.4 you will need sudo apt-get install qt-qmake.)
    • You may need some build packages too like sudo apt-get install libxtst-dev build-essential libqt4-dev you may need to look those up separately because I ended up installing a lot of those but not really sure which packages were actually necessary
  4. Add the patch, assuming you’re in your keepass dir and your patch file is one level up: patch -p1 < ../keepassx-0.4.3-gcc47.patch
  5. run cmake ./
  6. make
  7. sudo make install