Keepass kdb support?

I ended up installing an older version of KeePassX from this URL:

Package Page:

Direct Download Link: (it is for Trusty, but works well in Xenial)

The newer version (2.X) dropped support for kdb files.

The following command will pin the package to the older version so that it doesn't get updated when you do apt-get upgrade:

# hold package, so that it doesn't get upgraded
echo "keepassx hold" | sudo dpkg --set-selections

# for posterity, same as above
apt-mark hold keepassx

# since aptitude doesn't respect the above
aptitude hold keepassx

For those of you who prefer to compile old or missing packages or who want to have both KeepassX version 2 and 0.4, you may follow this instructions:

  • Install the build dependencies (sudo apt-get install build-essential libqt4-dev libxtst-dev qt4-make).
  • Download the source code of the last 0.4 version (0.4.4) keepassx-0.4.4.tar.gz
  • Decompress it (tar xvf keepassx-0.4.4.tar.gz).
  • Get into the directory (cd keepassx-0.4.4/).
  • Edit the file src/lib/random.cpp to add the line #include <unistd.h> around line 22 (this is a requiremente to compile with the version of GCC in latest Ubuntu versions).
  • Run qmake to create the Makefile (qmake PREFIX=/usr/local).
  • Run make to build the executable (make).
  • Install the executable (sudo make install). This will put the binary executable in /usr/local/bin/keepassx.

Now, you can create a new launcher icon to /usr/local/bin/keepassx to run the 0.4 version. (You may need to edit the old keepassx launcher to point to /usr/bin/keepassx to run version 2).

This should work at least for Ubuntu 16.04 (Xenial) to 17.10 (Artful).

This is a screenshot of both versions running side by side in Ubuntu Mate 16.04: enter image description here