Two KeePassX's?

Ubuntu-MATE is my distro for work and basically any situation in which I need a computer that’s compatible with the most amount of stuff. One of the things I’ve noticed is that it’s the only distro I run that seems to use the KeePassX 2.x versions instead of the 0.4 versions. I think 0.4 actually runs a bit better and was wondering if there’s a way to make MATE use 0.4 instead.
Thanks!

Does it run better or is it more convenient?
The trade-off between convenience and security is important to consider.

Unless they use a weird version numbering scheme wouldn’t 2.X be more secure than 0.4?
Might be important for something that’s a security software.

2 Likes

Well KeePassX 0.4 version can start in the tray and minimize to the tray without fully closing, as well as lock when minimized, which is something to the 2.x version cannot do. It’s mainly that each of my other distros (Arch, Tails, etc) uses the 0.4 version, and MATE is the lone 2.x user, which means I have to do a bunch of witchcraft to get the files readable by 0.4 to work on 2.x, and 2.x files aren’t readable on 0.4

I just checked keepassx on my machine (v2.0.2) and it has all those features, which can be enabled in settings. I believe that Tails is based on Debian. Debian has v2 of keepassx if you add the backports repository. Arch also has keepassx v2 available, the package name is keepassx2.

1 Like

It gets close, but non exact. Even still, because of how Tails works I don’t really have the option of adding additional software and having it work in any meaningful way.

If you don’t mind compiling from source, that the best way. You can get the source for the (I agree excellent) 0.4.4 version at the KeePassX website: https://www.keepassx.org/downloads/0-4

You’ll need at least the following two Qt4 dev packages:

  • libdev-qt4
  • qt4-qmake

You may need some more, but you’ll get compilation errors that will let you know what to install if anything else is missing.

To compile, download and unpack somewhere, then move inside the new directory, and…

$ qmake-qt4 PREFIX=$HOME/bin/
$ make
$ make install

This will install KeePassX to your $HOME/bin folder. This way it won’t conflict with the version in the repositories and that you can now uninstall.

Thanks for the instructions! I did get some errors though, and they don’t seem to be telling me what else to install.

Here’s the output of the terminal

[email protected]:~/Downloads/keepassx-0.4.4$ qmake-qt4 PREFIX=/home/chas/bin/
Project MESSAGE: See ‘INSTALL’ for configuration options.
Project MESSAGE: Install Prefix: /home/chas/bin/
Project MESSAGE: *** Makefile successfully generated.
Project MESSAGE: *** Start make now.
[email protected]:~/Downloads/keepassx-0.4.4$ make
cd src/ && make -f Makefile
make[1]: Entering directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/AutoTypeDlg.ui -o …/build/ui/ui_AutoTypeDlg.h
make[1]: /usr/lib/x86_64-linux-gnu/qt4/bin/uic: Command not found
Makefile:411: recipe for target ‘…/build/ui/ui_AutoTypeDlg.h’ failed
make[1]: *** […/build/ui/ui_AutoTypeDlg.h] Error 127
make[1]: Leaving directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
Makefile:39: recipe for target ‘sub-src-make_default’ failed
make: *** [sub-src-make_default] Error 2
[email protected]:~/Downloads/keepassx-0.4.4$ make install
cd src/ && make -f Makefile install
make[1]: Entering directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/AutoTypeDlg.ui -o …/build/ui/ui_AutoTypeDlg.h
make[1]: /usr/lib/x86_64-linux-gnu/qt4/bin/uic: Command not found
Makefile:411: recipe for target ‘…/build/ui/ui_AutoTypeDlg.h’ failed
make[1]: *** […/build/ui/ui_AutoTypeDlg.h] Error 127
make[1]: Leaving directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
Makefile:49: recipe for target ‘sub-src-install_subtargets’ failed
make: *** [sub-src-install_subtargets] Error 2
[email protected]:~/Downloads/keepassx-0.4.4$

It’s missing ‘make’, the actual built automation tool that will build and install the application. This means you are probably missing the development tools.

$ sudo apt-get install build-essential

This will install the essential tools for building.applications. I’m unsure if this includes the compiler, but will soon know if you get any more errors :slight_smile:

And the plot thickens!

[email protected]:~$ sudo apt-get install build-essential
[sudo] password for chas:
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version (12.1ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
[email protected]:~$

That’s my bad. I’m inexperienced in this distro still and I always thought for some reason build-essentials was the equivalent to other distros base dev packages.

No problem. Just install it by name:

$ sudo apt-get install make gcc

Get ready for me to really confuse you then!

[email protected]:~$ sudo apt-get install make gcc
[sudo] password for chas:
Reading package lists… Done
Building dependency tree
Reading state information… Done
gcc is already the newest version (4:5.3.1-1ubuntu1).
gcc set to manually installed.
make is already the newest version (4.1-6).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
[email protected]:~$

We’ll figure this one out yet!

I did misread the initial error. “make command not found” made me dismiss everything else too quickly. It’s however “make” that is reporting that error, so it obviously exists in your system.

However, I’m at abit of a loss as to what it is missing, except for one thing:

I just compiled it myself and the only error I got so far was a lib dependency that you will also get once your build actually starts.

Are you sure you installed the libqt4-dev package as I mentioned earlier? This package will also install libqt4-bin, which contains a few tools needed to build qt applications.

$ sudo apt-get install libqt4-dev

If you don’t see libqt4-dev-bin being installed with it, install that too.

1 Like

Well, that appeared to have done something, but when trying the initial steps I got this:

[email protected]:~/Downloads/keepassx-0.4.4$ qmake-qt4 PREFIX=/home/chas/bin/
Project MESSAGE: See ‘INSTALL’ for configuration options.
Project MESSAGE: Install Prefix: /home/chas/bin/
Project MESSAGE: *** Makefile successfully generated.
Project MESSAGE: *** Start make now.
[email protected]:~/Downloads/keepassx-0.4.4$ make
cd src/ && make -f Makefile
make[1]: Entering directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/AutoTypeDlg.ui -o …/build/ui/ui_AutoTypeDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/TargetWindowDlg.ui -o …/build/ui/ui_TargetWindowDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/AboutDlg.ui -o …/build/ui/ui_AboutDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/AddBookmarkDlg.ui -o …/build/ui/ui_AddBookmarkDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/CalendarDlg.ui -o …/build/ui/ui_CalendarDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/CollectEntropyDlg.ui -o …/build/ui/ui_CollectEntropyDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/CustomizeDetailViewDlg.ui -o …/build/ui/ui_CustomizeDetailViewDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/DatabaseSettingsDlg.ui -o …/build/ui/ui_DatabaseSettingsDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/EditEntryDlg.ui -o …/build/ui/ui_EditEntryDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/EditGroupDlg.ui -o …/build/ui/ui_EditGroupDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/ExpiredEntriesDlg.ui -o …/build/ui/ui_ExpiredEntriesDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/HelpDlg.ui -o …/build/ui/ui_HelpDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/MainWindow.ui -o …/build/ui/ui_MainWindow.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/ManageBookmarksDlg.ui -o …/build/ui/ui_ManageBookmarksDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/PasswordDlg.ui -o …/build/ui/ui_PasswordDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/PasswordGenDlg.ui -o …/build/ui/ui_PasswordGenDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/SearchDlg.ui -o …/build/ui/ui_SearchDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/SelectIconDlg.ui -o …/build/ui/ui_SelectIconDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/SettingsDlg.ui -o …/build/ui/ui_SettingsDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/SimplePasswordDlg.ui -o …/build/ui/ui_SimplePasswordDlg.h
/usr/lib/x86_64-linux-gnu/qt4/bin/uic forms/WorkspaceLockedWidget.ui -o …/build/ui/ui_WorkspaceLockedWidget.h
g++ -m64 -pipe -O2 -Wall -W -D_REENTRANT -DAUTOTYPE -DGLOBAL_AUTOTYPE -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g+±64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I. -Ilib -Icrypto -Iplugins/interfaces -Iexport -Iimport -Idialogs -I…/build/ui -I…/build/moc -x c+±header -c keepassx.h -o …/build/keepassx.gch/c++
g++ -c -include …/build/keepassx -m64 -pipe -O2 -Wall -W -D_REENTRANT -DAUTOTYPE -DGLOBAL_AUTOTYPE -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g+±64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I. -Ilib -Icrypto -Iplugins/interfaces -Iexport -Iimport -Idialogs -I…/build/ui -I…/build/moc -o …/build/HelperX11.o lib/HelperX11.cpp
In file included from lib/HelperX11.cpp:21:0:
lib/HelperX11.h:30:34: fatal error: X11/extensions/XTest.h: No such file or directory
compilation terminated.
Makefile:688: recipe for target ‘…/build/HelperX11.o’ failed
make[1]: *** […/build/HelperX11.o] Error 1
make[1]: Leaving directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
Makefile:39: recipe for target ‘sub-src-make_default’ failed
make: *** [sub-src-make_default] Error 2
[email protected]:~/Downloads/keepassx-0.4.4$ make install
cd src/ && make -f Makefile install
make[1]: Entering directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
g++ -c -include …/build/keepassx -m64 -pipe -O2 -Wall -W -D_REENTRANT -DAUTOTYPE -DGLOBAL_AUTOTYPE -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g+±64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4 -I. -Ilib -Icrypto -Iplugins/interfaces -Iexport -Iimport -Idialogs -I…/build/ui -I…/build/moc -o …/build/HelperX11.o lib/HelperX11.cpp
In file included from lib/HelperX11.cpp:21:0:
lib/HelperX11.h:30:34: fatal error: X11/extensions/XTest.h: No such file or directory
compilation terminated.
Makefile:688: recipe for target ‘…/build/HelperX11.o’ failed
make[1]: *** […/build/HelperX11.o] Error 1
make[1]: Leaving directory ‘/home/chas/Downloads/keepassx-0.4.4/src’
Makefile:49: recipe for target ‘sub-src-install_subtargets’ failed
make: *** [sub-src-install_subtargets] Error 2
[email protected]:~/Downloads/keepassx-0.4.4$

Good to know. It was becoming spooky.
Ok. That’s the dependency library I was talking about on the previous post. You need to:

$ sudo apt-get install libxtst-dev

Then run make again.
You are almost there :slight_smile:

EDIT:
Ater you do that, there’s another error down the line with another file. This is an actual source code error. To solve it you get to do a little programming! :muscle:

Go to your Downloads/keepassx-0.4.4/src/lib and open the file random.cpp

Add another line, right after line 21 (that reads #include "random.h") and write the following:

#include "unistd.h"

Save, close and run make again . And that should be the end of it. After it is finished, run:

make install

1 Like

BOOM!
You Sir, are the man. And quite possibly psychic.
Final question: I assume the only way to update the program is to recompile whenever there’s a new version? Or as there a convenient, Arch Linux style way of doing so?

Not psychic, hehe. I just decided to fully compile it myself and bumped into that error.

As for updating, I think 0.4.4 was the end of that branch, no? There won’t be more upgrades to that version. The main development branch now is KeePassX 2.X and you won’t need to compile for that, because as you know, it’s what Ubuntu-MATE is already offering through the repositories. 0.4.4 is however a very stable version. It can serve you for years.

One final note:

I noticed the makefile doesn’t do a standard installation. It should create a folder for you inside $HOME/bin. Instead it considers that the root folder for the installation. So you end up with a $HOME/bin/bin and a $HOME/bin/share folder. That is ugly!

Since you can already fully compile it, I advise you to delete $HOME/bin/bin and $HOME/bin/share and start over. Only this time, you are going to give it the folder name, like so:

First clean all the object files that were created during the build. So, trom inside Downloads/keepass:

$ make clean

Then build again, time time giving it the folder name (manually create it first):

$ qmake-qt4 PREFIX=$HOME/bin/keepass/
$ make
$ make install 

And this time it will be neatly installed into ~/bin/keepass

EDIT 2:
Oh, and don’t forget to mark the thread as solved, so that any future reader with a similar problem, knows there is a solution.

Excellent. Thanks for all your help there. (Although knowing my luck, the next version of Tails will use 2.0.2 and I’ll have to change all the programs again haha)

That’s one of the advantages of installing to your home folder. You can just back your new keepassx directory (and the database, of course) and copy into the new Tails installation. No need to recompile anymore.

Hi marfig and chasbel2112 - Thank you very much for chasing this down. I had the same problem under Ubuntu 16.04 and this fixed it for me. :grin:

2 Likes