sudo apt install keepass2
Goto https://keepass.info/download.html and download KeePass Portable (zip file) or use the following command:
curl -Lo KeePass.zip https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.51/KeePass-2.51.zip/download
# Login root user
sudo su
mkdir -p /usr/lib/keepass2/temp /usr/lib/keepass2/_archives
# Extract zip file to temp directory
unzip KeePass-2.50.zip -d /usr/lib/keepass2/temp
# Backup keepass files of the existing version
cd /usr/lib/keepass2/
mv KeePass.exe KeePass.exe.config Plugins /usr/lib/keepass2/_archives
# Update keepass files of the new version
cd /usr/lib/keepass2/temp
mv KeePass.exe KeePass.exe.config Plugins ../
# Remove temp directory
rm -rf /usr/lib/keepass2/temp
exit