In this tutorial, we will show you how to fix the apt-get update GPG error BADSIG on Ubuntu or Debian. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you the step-by-step fix apt-get on Ubuntu. You can follow the same instructions for Ubuntu and any other Debian-based distribution like Linux Mint, and more as well.
- A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Fix apt-get update GPG error BADSIG on Ubuntu or Debian
GPG error: http://au.archive.ubuntu.com precise Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <email@example.com>
After some research, I found the solution from askubuntu and StackExchange. Please use the following commands to get rid of your problem:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
Please do that with the corresponding error key from your error message log.
The next step is to clear your apt software cache:
cd /var/lib/apt sudo mv lists lists.old sudo mkdir -p lists/partial
Then you are done and may try our favorite
And you should encounter no errors anymore.
For you who didn’t know yet about
apt-get an update, it’s a Linux command specifically for Ubuntu and Debian to update apt or software repository cache.
apt-get the command itself is a powerful command-line tool to perform such functions as installation of new software packages, upgrade of existing software packages, updating the package list index, and even upgrading the entire Ubuntu/Debian system.
Thanks for using this tutorial to Fix apt-get update GPG error BADSIG on Ubuntu or Debian. For additional help or useful information, we recommend you to check the official Ubuntu website.