Error Updating Ubuntu 18.04.4 LTS: Unable to Verify Signatures
If you're having trouble updating your Ubuntu 18.04.4 LTS machine and encountering an error that says "following signatures couldn't be verified because the public key is not available", this article is for you. We'll go over the steps to troubleshoot and fix this issue, so you can successfully update your system and install the latest version of Node.js.
Understanding the Error
The error message "following signatures couldn't be verified because the public key is not available" typically appears when running the sudo apt-get update command. This command is used to update the package lists for upgrades and new package installations. The error occurs when the system can't verify the signatures of some packages due to missing public keys.
Fixing the Error
To resolve this issue, you need to import the missing public keys. Follow these steps to do so:
- First, you need to find the packages that are causing the error. Run the following command:
sudo apt-get update --fix-missing- After running the command, you will see a list of packages with errors. Take note of the package names.
- Next, import the missing public keys using the following command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys [KEY_ID]Replace [KEY_ID] with the key ID of the package causing the error. You can find the key ID by searching for the package name and appending /key to the end of the URL. For example, if the package name is nodejs, the key ID URL would be https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x60A6DF6BA4A33505.
- After importing the missing public key, update the package lists again:
sudo apt-get updateInstalling Node.js
Now that you've fixed the error, you can proceed with installing the latest version of Node.js. Follow these steps:
- First, update the package lists:
sudo apt-get update- Next, install Node.js and npm (Node Package Manager) using the following command:
sudo apt-get install nodejs npmIn this article, we covered the error "following signatures couldn't be verified because the public key is not available" when updating Ubuntu 18.04.4 LTS and provided steps to fix the issue. We also covered installing the latest version of Node.js and npm on Ubuntu 18.04.4 LTS.