The Temporary Failure Resolving archive.ubuntu.com error is usually encountered when running an update command on Ubuntu. While this error can happen occasionally and is certainly frustrating, rest assured that it is a common issue with well-known solutions.
Why Does the Temporary Failure Resolving archive.ubuntu.com Error Occur?
This temporary failure resolving archive.ubuntu.com error usually happens because your VPS or PC running Ubuntu cannot connect to the Ubuntu server. This can be due to issues with the Ubuntu server configuration on your PC or VPS, or network-related problems.
Actually, this error is usually temporary and will resolve itself after a short while. However, if the error persists after a few hours, you can perform some troubleshooting steps to fix it.
How to Fix Temporary Failure Resolving archive.ubuntu.com
Since there are two common causes for this error, we can use different methods to resolve the temporary failure.
These two methods involve using a public DNS on your server or PC, or using the second method, which is changing the repository used for Ubuntu updates. (List of Local Ubuntu Repositories from 14.04 to 22.04)
1. Using Public DNS
This method can be used to check if the error is caused by your internet connection or ISP. If this method still fails, it is recommended to try the second method.
To check if the error is caused by your ISP, you can temporarily add a DNS server. For example, you can use Google's public DNS.
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/nullAfter adding or using the public DNS mentioned above, you can try checking for Ubuntu updates again.
sudo apt-get updateIf the update process does not show an error, it means the issue on your VPS was caused by your ISP. You can wait until your ISP returns to normal or contact them directly.
But if your ISP is difficult to reach when issues occur, can you add a DNS permanently? Since the method mentioned above is only temporary?
To use a public DNS permanently, you can run the following command.
echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/nullAlready using a public DNS but still getting the error? You might need to try checking the second method below.
2. Check Repository Packages
This error can also be caused by a conflict in the repository packages, so we need to check and update the stored repository packages.
First, open the repository package file. You can use VI or you can also use Nano
sudo vi /etc/apt/sources.listOnce you are inside the sources.list file editor, check each package to see if it has a different release name. For example, if you are using Ubuntu 20.04.6 LTS, everything should use the name Focal, for example deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
If you find a name other than Focal, for example deb http://archive.ubuntu.com/ubuntu/ bionic main restricted then you need to temporarily disable that repository by adding a pound sign at the beginning, so it becomes #deb http://archive.ubuntu.com/ubuntu/ bionic main restricted
After everything is checked, save the changes to your sources.list file, then try running the update again. The temporary failure resolving archive.ubuntu.com error should be gone.
sudo apt-get update && apt-get upgradeIf there are no errors in your sources.list, you can try changing the repository used on your Ubuntu to a local repository (How to Use a Local Ubuntu Repository)
Conclusion
Although this is a common error, it usually occurs on Ubuntu versions named lucid, maverick, natty, oneiric, precise, quantal, raring, saucy, trusty, utopic, and vivid.
Even so, it is still possible for other Ubuntu versions to experience this error.
Additionally, if the VPS you are using is an Indonesian server, it is highly recommended to use a local repository so that the update process and speed will be faster.
COMMENTS
Loading...