6

I am looking for instructions on how to install Keepass2 on CentOS 7 unfortunately no luck so far. Is there any rpm available anywhere? Any info will be much appreciated!

  • may keepass.info/help/v2/setup.html help you? – Pandya Mar 7 '15 at 8:36
  • @Pandya some sane way without needing to compile. Something from some trusted repo. As it is the case with other major distros. – Abhijit N Mar 7 '15 at 10:11
  • 1
    You could use dbootstrap to put a debian into a subdirectory, then use a chroot tool to run keepass2. wiki.debian.org/Debootstrap – ctrl-alt-delor Mar 7 '15 at 23:00
  • Try downloading the source code and required libraries, then rebuilding from scratch. – Robert Jacobs Mar 9 '15 at 20:24
5
+50

Since it's missing from RHEL/CentOS supplements like Fedora EPEL, get KeePass 2.26-10-fc19 from Koji, Fedora's Build System. RHEL 7 was built atop Fedora 19, so this should work.

 

RHEL supplemental repositories

When you want a package missing from Red Hat Enterprise Linux (RHEL, which CentOS un-brands), start with Fedora EPEL (Extra Packages for Enterprise Linux). Unfortunately, EPEL lacks the mono-based KeePass 2+ and I assume the Qt-based KeePassX (0.4.4) is insufficient for you.

RPMforge, now called RepoForge, is an EPEL-like repo that can be searched on Github, but it has no matches for KeePass. Strike two.

Had either of these worked, you'd have been able to add the extra repository and install with yum.

Get Fedora's package

An older trick of mine (from back when I had to manage RPM systems) was to dig into the Fedora origins of that RHEL release and try the corresponding Fedora package. RHEL 7 maps to Fedora 19.

Just to make sure, I recommend you manually map the dependent libraries. This involves looking at DistroWatch for Redhat (or the identical CentOS) and compare with Fedora's libraries, which in this case would (probably?) be glibc (match RHEL 7's glibc 2.17 to Fedora, which would be Fedora 19) and mono ... oops, DistroWatch doesn't track that, so how about gtk+, for which RHEL 7 has 3.8.8, which Fedora doesn't match perfectly, but Fedora 19's 3.8.2 is in the right direction (you can generally assume backwards compatibility within a minor version, so something compiled for gtk+ 3.8.2 will work fine with gtk+ 3.8.8). So, you can almost certainly use Fedora 19's RPM for KeePass.

We already searched for keepass on Fedora Packages when looking for an EPEL package above. The next step is to find the Fedora 19 package, but that version is no longer supported. Click the Koji Builds link on the left, which goes farther back in time. Search for "fc19" and look for the latest successful build (with a green check box): KeePass 2.26-10-fc19.

Other RHEL-compatible builds

In the event there isn't an appropriate Fedora package: My old standby was to try PBone RPM Search, which encompasses most RPM-based distros, including Fedora and the more directly RHEL-compatible: EPEL, RepoForge, CentOS, Scientific Linux, and more (it supplants the venerable RPMfind). This is where I'd have gone if there wasn't even a Fedora package. Sometimes there's a compatible third-party package, but you have to know what you're doing. Identify the distribution and research whether it's actually compatible with RHEL. Anything not purporting to be compatible with Fedora or RHEL will likely break since package names aren't consistent. If you're lucky, you can match dependencies using Distrowatch as noted above and get a functional match.

When searching PBone, I recommend an advanced search that lists only compatible distribution releases. Here's a PBone search for keepass2 compatible with CentOS 7.

Installing the RPM

You should be able to install that RPM (rpm -i file.rpm), though traversing the dependencies can be a bit hairy (since you're not using yum or even apt-rpm). welcome to how package management worked in the 90s!

In revising this update after finding answers about package indices for Fedora and CentOS, I see another answer here copied my PBone find and noted an easier way to resolve the dependencies:

yum localinstall keepass-2.26-10.fc19.x86_64.rpm

You may or may not need to install Fedora EPEL in order to satisfy some of the dependencies. (If you do, please comment here and I'll add EPEL installation instructions.)

  • 1
    I'd like to add that I had the same issues with finding a good keepass gui for CentOS 6 a while back and was very pleased to find kpcli, a command line client that is gui agnostic. Unfortunately I dont see any packages for Centos 7 but there does appear to be one for FC19 - – echdee Mar 9 '15 at 19:42
1

EPEL method

KeePass 2.x is available in EPEL. I assume the top answer is either outdated or mistaken.

  1. Enable the EPEL repository:

    $ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
    
  2. Install and run KeePass 2.x:

    $ sudo yum install keepass
    $ keepass
    

Official method

If you want to always run the latest KeePass release, follow the official KeePass documentation as summarized below. KeePass will notify you of new versions, and updating is performed by extracting the zip file provided on the KeePass website.

  1. Install the Mono runtime by following the install instructions on the Mono website:

    $ sudo rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
    $ sudo yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/
    $ sudo yum install mono
    
  2. Download KeePass Professional Edition Portable from the KeePass website.

  3. Extract and run KeePass, either by using your available desktop environment tools, or adapting this command-line example:

    $ unzip -d keepass Downloads/KeePass-2.36.zip
    $ mono keepass/KeePass.exe
    
0

When the package is not available on EPEL you should attempt to build the packages from Fedora. In this case you should use keepassx which does not depend on mono: Click at the newer version available from:

https://apps.fedoraproject.org/packages/keepassx

Install the source RPM using the link which is available from the package information. From the application RPMS download the SRC RPM:

Perform the following procedure WITHOUT root:

Install the SRC package:

# rpm -Uvh https://kojipkgs.fedoraproject.org//packages/keepassx/2.0.0/2.fc24/src/keepassx-2.0.0-2.fc24.src.rpm

Install the build dependencies

cd ~/rpmbuild/SPECS/ && sudo yum-builddep keepassx.spec

Build the package:

rpmbuild -ba keepassx.spec

Install it:

sudo yum localinstall ~/rpmbuild/RPMS/x86_64/keepassx-2.0.0-2.el7.x86_64.rpm

  • Why install from source when you can just install the EPEL release provided in your first link? Install the EPEL repository and then yum install keepassx. See my answer above for more detail on EPEL and its guaranteed RHEL/CentOS compatibility. – Adam Katz Jul 11 '16 at 23:44
0

I successfully used the following simple procedure in CentOS 7:

  • Download the RPM from PBone
  • In a terminal window, cd to the location of the RPM and run:

    sudo yum -y localinstall <filename>.rpm
    

No need to compile anything, but you will need access to the epel repository. In my fresh installation of CentOS 7, this was already configured.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.