Linux, Troubleshooting

Installing keepass2 on Ubuntu Linux 11.10 to work in Google Chrome via KeepassHTTP

Keepass2 is a Password Manager for Linux (and other operating systems) that is awesome and can be made to autofill your passwords in your browser and still keep them all safe. All this functionality at your fingertips and you only need to remember one simple (and single) password. If you really want to see the full list of features for keepass then you can take a look at their list of features.

Keep in mind that this tutorial is performed on the following version of Ubuntu:

% cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.10
DISTRIB_CODENAME=oneiric
DISTRIB_DESCRIPTION="Ubuntu 11.10"

We also are trying to install the following software:

What should installation be like?

Being an Ubuntu user you would think that you could just open up a terminal and type in something like this to install keypass2 and keepasshttp:

 sudo apt-get install keepass2
 wget https://passifox.appspot.com/KeePassHttp.plgx
 sudo mv KeePassHttp.plgx /usr/lib/keepass2

But unfortunately that does not work. The plugin even fails to load.

How to actually install it

Installing keepass2 is actually markedly more complicated then that. This is the full set of instructions that you have to perform:

 sudo apt-add-repository ppa:jtaylor/keepass
 sudo apt-get update
 sudo apt-get install keepass2 mono-complete
 git clone https://github.com/pfn/keepasshttp.git /tmp/keepasshttp
 cd /tmp/keepasshttp/KeePassHttp
 sudo cp KeePassHttp.dll Newtonsoft.Json.dll /usr/lib/keepass2

And now it works exactly like it should. The important extras required to get it to work are, in order:

  • The addition of the jtaylor/keepass Personal Package Archive (PPA).
  • The extra installation of the mono-complete package.
  • The checkout of the git repository to get the KeePassHttp.dll and Newtonsoft.Json.dll library files instead of just using the plgx package file.
We will explain the requirements of those three extra steps in the following section if you really care. But at this point in time you should have keepass2 installed.

Why it is not currently like it should be?

Lets answer each of the three extra steps in a one by one fashion.

Why did we need to install the jtaylor/keepass PPA instead of the one provided and packaged by ubuntu?

Essentially the version of keepass2 was too low to be compatible with all of the latest bug fixes in keepasshttp. As you can see Ubuntu will be getting keepass version 2.18 in Precise Pangolin but in Oneric they only have version 2.16. But if you look here the latest version of keepasshttp requires version 2.17 of keepass as a minimum. That is why we installed a newer version of keepass from a PPA. This means that when you upgrade to Pangolin you can remove this PPA from your Software Sources.

Why did we need to install the mono-complete package?

If you do not install the mono-complete package and attempt to sync Google Chrome with keepass2 through ChromeIPass and keepasshttp then the Newtonsoft.Json.dll will crash with a nasty looking stacktrace. The way to solve this is to get all of the mono libraries.

Why did we need to put the .dll files in the keepass2 directory instead of the .plgx file for keepasshttp to start working?

Because putting the plgx file in the directory did not work for me and putting the .dll files in did. And you can take a look at what this guys says here for more information.