How To Install gpg on Ubuntu 20.04
Introduction
In this tutorial we learn how to install gpg
on Ubuntu 20.04.
What is gpg
gpg is:
GnuPG is GNU’s tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC4880.
This package contains /usr/bin/gpg itself, and is useful on its own only for public key operations (encryption, signature verification, listing OpenPGP certificates, etc). If you want full capabilities (including secret key operations, network access, etc), please install the “gnupg” package, which pulls in the full suite of tools. Task: server, ubuntu-desktop-minimal, samba-server, ubuntu-desktop, cloud-image, mail-server, ubuntu-core, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Package: gpg Architecture: amd64 Version: 2.2.19-3ubuntu2 Multi-Arch: foreign Priority: optional Section: utils Source: gnupg2 Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian GnuPG Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1135 Depends: gpgconf (= 2.2.19-3ubuntu2), libassuan0 (>= 2.5.0), libbz2-1.0, libc6 (>= 2.25), libgcrypt20 (>= 1.8.0), libgpg-error0 (>= 1.35), libreadline8 (>= 6.0), libsqlite3-0 (>= 3.7.15), zlib1g (>= 1:1.1.4) Recommends: gnupg (= 2.2.19-3ubuntu2) Breaks: gnupg (« 2.1.21-4) Replaces: gnupg (« 2.1.21-4) Filename: pool/main/g/gnupg2/gpg_2.2.19-3ubuntu2_amd64.deb Size: 482096 MD5sum: 3163acbdc9014376af98ea7d1b009bde SHA1: c554eff64112f588040a521f180da282fe9fa8e0 SHA256: 08cb0075b5bd23aca773643633b053ee6c57c3668dde9d1ef253c7ec5b03d33d Homepage: https://www.gnupg.org/ Description-en: GNU Privacy Guard – minimalist public key operations GnuPG is GNU’s tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC4880.
This package contains /usr/bin/gpg itself, and is useful on its own only for public key operations (encryption, signature verification, listing OpenPGP certificates, etc). If you want full capabilities (including secret key operations, network access, etc), please install the “gnupg” package, which pulls in the full suite of tools. Task: server, ubuntu-desktop-minimal, samba-server, ubuntu-desktop, cloud-image, mail-server, ubuntu-core, kubuntu-desktop, xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
There are three methods to install gpg
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install gpg Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install gpg
using apt-get
by running the following command:
sudo apt-get -y install gpg
Install gpg Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install gpg
using apt
by running the following command:
sudo apt -y install gpg
Install gpg Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install gpg
using aptitude
by running the following command:
sudo aptitude -y install gpg
How To Uninstall gpg on Ubuntu 20.04
To uninstall only the gpg
package we can use the following command:
sudo apt-get remove gpg
Uninstall gpg And Its Dependencies
To uninstall gpg
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove gpg
Remove gpg Configurations and Data
To remove gpg
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge gpg
Remove gpg configuration, data, and all of its dependencies
We can use the following command to remove gpg
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge gpg
References
Summary
In this tutorial we learn how to install gpg
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.