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!
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.
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!
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.)
KeePass 2.x is available in EPEL. I assume the top answer is either outdated or mistaken.
Enable the EPEL repository:
$ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Install and run KeePass 2.x:
$ sudo yum install keepass $ keepass
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.
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
Download KeePass Professional Edition Portable from the KeePass website.
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
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:
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:
Install the build dependencies
cd ~/rpmbuild/SPECS/ && sudo yum-builddep keepassx.spec
Build the package:
rpmbuild -ba keepassx.spec
sudo yum localinstall ~/rpmbuild/RPMS/x86_64/keepassx-2.0.0-2.el7.x86_64.rpm
I successfully used the following simple procedure in CentOS 7:
- Download the RPM from PBone
In a terminal window,
cdto 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.