How to Compile and Install KeePassX on Ubuntu 16.04

KeePassX is compatible with KeePass on Windows, and can be compiled after installing a few extras via apt-get..

1930 views

Edited: 2017-01-08 12:20

KeePass is as a free open source password manager for Windows, but apparently it is rather difficult to make it work in Linux using Wine. So I decided to try out KeePassX in Ubuntu which is compatible with KeePass. It is not clear to me if it is still a port of KeePass, but at least it is also open source, and very similar to KeePass on Windows.

KeePassX is apparently also available in the Ubuntu software center, however, when I tried to install it, I was asked to create a Ubuntu one account, and it said it contained non-free software. So It is not clear to me if it is the same thing in software center, so I eventually decided to compile it from source.

You first need to download the source. For KeePassX the source is distributed in a compressed file that looks like this: keepassx-2.0.3.tar.gz (depending on version). Extract this file by right clicking on it in your Downloads directory and clicking "Extract here".

The directory of your source files should look like this: /home/k/Downloads/keepassx-2.0.3 where "k" should be replaced with your own username.

To compile KeePassX on Ubuntu, you may need to first install a few extra things via apt-get first. I.e.:

sudo apt-get install cmake
sudo apt-get install build-essential
sudo apt-get install qt4-qmake
sudo apt-get install qt4-default
sudo apt-get install libgcrypt11-dev
sudo apt-get install zlib1g-dev
cmake .
sudo make install

Note the "." after cmake. This tells cmake to use the current directory. Simply typing cmake as suggested elsewhere will result in an error for some reason.

After compiling, a .desktop launcher will be located in /usr/local/share/applications and the binery will be located at /usr/local/bin/keepassx

For some reason it will not show up in Dash after installing with make install, but when you run KeePassX, you can right click it's icon in unity, and click on "Lock to Launcher". However, since this is a password manager, you might not want to make it obvious that you are using it anyway. Instead you could just launch it from terminal or navigate to the directory whenever you need it, which may also help lower the chance of accidentally leaving it open in unity, and encourage memorization.

To launch KeePassX from the terminal after installing with make install, simply type "KeePassX" into a terminal window and hit enter.

Remember to keep backups of your database file with all the passwords just in case something happens to the file, your hard disk goes bad, or whatever!!

Tell us what you think:

Marcus Widerberg

Hello,
I get error early on from "moc", see below paste.

Any clues?

br! /mawi

https://pastebin.com/7cAGwtU9

or:


[ 7%] Built target translations
[ 7%] Generating streams/moc_SymmetricCipherStream.cxx
moc: Cannot open options file specified with @
Usage: moc [options] <header-file>
-o<file> write output to file rather than stdout
-I<dir> add dir to the include path for header files
-E preprocess only; do not generate meta object code
-D<macro>[=<def>] define macro, with optional definition
-U<macro> undefine macro
-i do not generate an #include statement
-p<path> path prefix for included file
-f[<file>] force #include, optional file name
-nn do not display notes
-nw do not display warnings
@<file> read additional options from file
-v display version of moc
src/CMakeFiles/keepassx_core.dir/build.make:414: recipe for target 'src/streams/moc_SymmetricCipherStream.cxx' failed
make[2]: *** [src/streams/moc_SymmetricCipherStream.cxx] Error 1
CMakeFiles/Makefile2:127: recipe for target 'src/CMakeFiles/keepassx_core.dir/all' failed
make[1]: *** [src/CMakeFiles/keepassx_core.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2


  1. Generate a GPG key that can be used with KWallet.
  2. How to extract and install FileZilla from tar.bz2 in Ubuntu.
  3. About the problem with using sudo with graphical programs in Linux.
  4. Tutorial showing how to configure a VirtualBox Guest VM with HOST-only and NAT adapter, while using the WWW folder from the HOST OS.
  5. My experience with do-release-upgrade is that it rarely breaks anything, so I would say it is generally a safe and reliable way to upgrade Ubuntu.

More in: Ubuntu