How to Fix: Unable to complete apt update | GPG Error in Ubuntu 20.04
Fixing GPG error in Ubuntu 20.04 during apt update.
📋 Table of Contents
The 'Unable to complete apt update' error with a GPG Error in Ubuntu 20.04 occurs when the system is unable to verify the integrity of the package repository due to an expired or missing public key.
This issue can be frustrating for users who rely on apt update to keep their system up-to-date and secure. Fortunately, there are several methods to resolve this error and ensure a secure package repository.
💡 Why You Are Getting This Error
- The primary reason for this error is that the public key used to verify the integrity of the package repository has expired or is missing. This can happen when the key is not updated regularly or if it is deleted accidentally.
- Another possible cause is that the system's clock is not synchronized with the Ubuntu mirror servers, causing the keys to become outdated.
🔧 Proven Troubleshooting Steps
Update the package repository using apt-key
- Step 1: Open a terminal and run the command `sudo apt update` to check for any available updates.
- Step 2: If the output shows an error message similar to 'The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5', it means that the public key is missing or has expired. In this case, you need to update the package repository by running `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5`.
- Step 3: After updating the public key, run `sudo apt update` again to verify that the repository is now accessible.
Use a third-party repository with a valid public key
- Step 1: If updating the package repository using apt-key does not work, you can try using a third-party repository that has a valid public key. For example, you can use the 'Infinaly' repository which provides Ubuntu packages with a valid public key.
- Step 2: To enable the Infinaly repository, run `sudo add-apt-repository 'deb http://ppa.launchpad.net/infinaty/ precise main'` and then run `sudo apt update` to verify that the repository is now accessible.
💡 Conclusion
Resolving the 'Unable to complete apt update' error with a GPG Error in Ubuntu 20.04 requires updating the package repository using apt-key or using a third-party repository with a valid public key. By following these steps, you should be able to access the package repository securely and keep your system up-to-date.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid