Install these packages without verification? [y/N] on Linux

Why am I getting authentication errors and prompt for packages from an Ubuntu Linux system when I type

sudo apt update
sudo apt upgrade
sudo apt install nginx

Show I say “yes” to “Install these packages without verification?” on Ubuntu ? Please tell me what to do and fix it?

On Ubuntu, Debian and all other modern Linux distro gpg keys are used by apt/apt-get to authenticate packages. This is a security feature. Never install packages without verification.

How to fix apt error

Try update gpg keys as follows on Ubuntu:

sudo apt-key net-update
sudo apt update
sudo apt upgrade

On Debian Linux it should as follows:

sudo apt-key net-update
sudo apt update
sudo apt upgrade

Where,

  • update - Update the local keyring with the archive keyring and remove from the local keyring the archive keys which are no longer valid. The archive keyring is shipped in the archive-keyring package of your distribution, e.g. the ubuntu-keyring package in Ubuntu. Note that a distribution does not need to and in fact should not use this command any longer and instead ship keyring files in the /etc/apt/trusted.gpg.d/ directory directly as this avoids a dependency on gnupg and it is easier to manage keys by simply adding and removing files for maintainers and users alike.
  • net-update - Perform an update working similarly to the update command above, but get the archive keyring from a URI instead and validate it against a master key. This requires an installed wget(1) and an APT build configured to have a server to fetch from and a master keyring to validate. APT in Debian does not support this command, relying on update instead, but Ubuntu’s APT does.

See apt-key man page http://manpages.ubuntu.com/manpages/bionic/man8/apt-key.8.html or type:

man apt-key
man apt
1 Like

yes, it worked. any reasons why security gpg keys will run into problems like this as i never touched them??

Hard to say. Some times disk error or other conditions/bugs/race conditions may cause weird issues. Hence, it would be best if you kept verified backups of all critical data. You make backups, don’t you?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki