Menu

Installation instructions

Lester Hightower

kpcli Installation Instructions

This document is intended to assist users in installing kpcli. It provides both general instructions and some operating system specific ones.

As of 04/17/2023, most Linux and BSD distributions package a version 3.x of kpcli and so if you do not need KDBX4 support, using your distributions package may be adequate. If you do intend to use kpcli version 4.x or higher, and it is not yet packaged by your distribution, starting by installing and then removing your distribution's kpcli package will pull in the requirements for you and make getting kpcli 4.x to run easier.

General Requirements

Required, non-core perl modules for KDB and KDBX3 support

  - Crypt::Rijndael - libcrypt-rijndael-perl on Ubuntu
  - Term::ReadKey   - libterm-readkey-perl on Ubuntu
  - Sort::Naturally - libsort-naturally-perl on Ubuntu
  - File::KeePass   - libfile-keepass-perl on Ubuntu
  - Term::ShellUI   - libterm-shellui-perl on Ubuntu

Required, non-core perl modules for KDBX4 support

  - Crypt::Argon2 - not packaged on Ubuntu as of 04/17/2023
  - File::KDBX - not packaged on Ubuntu as of 04/17/2023

Both of these modules install cleanly with cpanminus (see below) and both successfully build to *.deb packages with dh-make-perl. Crypt::Argon2 has no dependencies beyond core perl. File::KDBX requires this list of dependencies beyond core perl, names as they are packaged by Ubuntu, plus Crypt::Argon2 which I built with dh-makeperl: libboolean-perl, libcrypt-argon2-perl, libcryptx-perl, libdevel-globaldestruction-perl, libencode-perl, libiterator-simple-perl, libmath-bigint-perl, libnamespace-clean-perl, libref-util-perl, libscalar-list-utils-perl, libscope-guard-perl, libxml-libxml-perl

You will likely want to use apt to install all of those dependencies prior to using cpanm to install Crypt::Argon2 and File::KDBX, to reduce non-packaged perl modules installed on your machine.

Optional, non-core perl modules

Term::ReadLine::Gnu will provide more fluid signal handling on Unix-like systems, making kpcli robust to suspend, resume, and interrupt - SIGSTP, SIGCONT and SIGINT. That module is in the libterm-readline-gnu-perl package on Ubuntu.

Term::ReadLine::Perl5 is often preferred on platforms without GNU readline (MacOS, Windows, etc.) and is available from https://metacpan.org/pod/Term::ReadLine::Perl5. Term::ReadLine::Perl is also supported (libterm-readline-perl-perl on Ubuntu).

Clipboard and Tiny::Capture are needed to use the clipboard features. Those are available from https://metacpan.org/pod/Clipboard and package libcapture-tiny-perl on Ubuntu.

Sub::Install is needed to use the --timeout feature and is libsub-install-perl on Ubuntu.

Data::Password is needed to use the pwck feature (Password Quality Check) and is package libdata-password-perl on Ubuntu.

XData::Password::zxcvbn is preferred by the pwck feature if it is available. That module is not commonly packaged and its list of dependencies is quite long, but cpanminus installs it nicely on Linux Mint. Because it is a binding to a C library, XData::Password::zxcvbn is much faster than Data::Password and also seems to have a bit more strict password rules.

Data::Password::passwdqc is preferred by the pwck feature if it is available, behind XData::Password::zxcvbn. That module is not commonly packaged and its list of dependencies is quite long, but cpanminus installs it nicely on Linux Mint. It appeared that all of its upstream dependencies were packaged in Linux Mint and so I apt-get install'ed them first, and then cpanminus only installed Data::Password::passwdqc. Because it is a binding to a C library, Data::Password::passwdqc is much faster than Data::Password and also seems to have a bit more strict password rules.

Crypt::PWSafe3 can be instaled to allow Password Safe v3 files (https://pwsafe.org/) to be imported. The dependency list of this module is hefty and it is not packaged in many distros, but cpanminus installs it nicely on Linux Mint (https://cpanmin.us/).

Math::Random::ISAAC can be installed to use a more secure rand() function. It is package libmath-random-isaac-perl on Ubuntu.

Authen::OATH and Convert::Base32 can be installed to use the TOTP one time password functionality (RFC 6238). Those are packages libauthen-oath-perl and libconvert-base32-perl on Ubuntu.

Win32::Console::ANSI can be installed on MS Windows to get ANSI colors in Windows cmd terminals. Strawberry Perl is used for the kpcli port to Windows and, using cpanminus, one can install all of kpcli's dependencies.

Installing modules with cpanminus

The tool cpanminus (https://github.com/miyagawa/cpanminus/tree/devel/App-cpanminus) is a great way to install perl modules that are not packaged by your operating system. To install modules with cpanminus, simply run commands like cpanm Module::Name. On most Linux distributions, cpanminus can be installed using the package manager. Strawberry Perl on Windows has cpanminus bundled. To install cpanminus manually, you can run curl -L https://cpanmin.us | perl - --sudo App::cpanminus.

Since version v3.5, kpcli supports using modules installed in one's home directory (under ~/perl5), on Unix-like systems. Without root authority, tools like cpanminus will install to ~/perl5/ by default, and that can be very helpful on systems where you do not have root access, such as shared hosting servers.

Linux operating systems

Debian-based systems (*.deb packages)

The kpcli package is in the mainline package repositories of Debian and its derivatives, but it has not been updated in a number of years. On those operating systems, the easiest way to install and upgrade kpcli is to first install kpcli from the respository (sudo apt-get install kpcli) and then download the newest kpcli-N.n.deb package from sourceforge and install it: sudo dpkg -i ./kpcli-N.n.deb.

Fedora-based systems (*.rpm packages)

The kpcli package is in the mainline package repositories of Fedora and its derivatives, and the maintainers do a nice job of tracking kpcli updates. Install kpcli on those operating systems using yum: sudo yum install kpcli

Suse Linux (*.rpm packages)

Community packages are available at: https://software.opensuse.org/package/kpcli

Those community packages tend to lag behing the newest version of kpcli and so you might consider installing a community package, so as to bring in all of the dependencies, and then download the most recent kpcli-N.n.pl from Sourceforge and replace /usr/bin/kpcli or place it in ~/bin/ and prepend "$HOME/bin" to your PATH environment variable.

Gentoo Linux

Package app-admin/kpcli is available in Gentoo and the maintainer does a nice job of keeping it up-to-date. https://packages.gentoo.org/packages/app-admin/kpcli

Arch Linux

There is a kpcli package in the Arch User Repository (AUR) and the maintainer does a nice job keeping it up-to-date (https://aur.archlinux.org/packages/kpcli/). If installing from AUR is difficult for you, consider using cpanminus as described above.

Void Linux

Void Linux maintains a relatively up-to-date kpcli package. https://voidlinux.org/

macOS

Homebrew packages kpcli and the folks there do a nice job keeping it up-to-date: https://formulae.brew.sh/formula/kpcli

If you need to upgrade kpcli from Homebrew more quickly than an update is packaged, you likely can do so by placing the new kpcli-N.n.pl file into place at /usr/local/Cellar/kpcli/Y.y/libexec/kpcli, thereby replacing the X.y version of the kpcli program with the N.n one. For most kpcli upgrades, that should work just fine and will allow you to use a newer release prior to it being offically packaged by Homebrew.

Alternatively, macOS users can install and use cpanminus to install all of the modles that kpcli needs, as described above.

BSD

Both FreeBSD and OpenBSD package security/kpcli. Both are a little out of date versus the newest release of kpcli, but not terribly so. You might consider installing that package, so as to bring in all of the dependencies, and then download the most recent kpcli-N.n.pl from Sourceforge and replace /usr/bin/kpcli or place it in ~/bin/ and prepend "$HOME/bin" to your PATH environment variable.

Microsoft Windows

Pre-compiled binary

A precompiled kpcli-N.n.exe binary is distributed with each release.

Chocolatey Package Manager

A kpcli package is in Chocolatey: https://chocolatey.org/packages/kpcli

Using the Chocolatey Package Manager, you can install kpcli using choco install kpcli.

Strawberry Perl

Strawberry Perl bundles cpanminus and so it alone gives you access to everything needed to install all of the modules that kpcli needs. Simply install Stawberry Perl and then use cpanm to install all of the modules, as described above.

Miscellaneous

The Nix Package Manager

The Nix Package Manager maintains a fairly up-to-date version of kpcli and Nix is supported on Linux and maxOS. https://nixos.org/manual/nix/stable/


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.