How to Fix “temporary failure resolving archive.ubuntu.com” Error

Most tasks performed on the Ubuntu operating system are done through its terminal. This includes the installation and updating of the software and packages that the user needs. To perform this action, the system repository must be updated from the official Ubuntu archives. While attempting to achieve this, a problem may be encountered with the statement “temporary failure resolving archive.ubuntu.com”.

This article will elaborate on the causes of this error and demonstrate how it can be fixed in your system.

How to Fix the “temporary failure resolving archive.ubuntu.com” Error?

A couple of major reasons will invoke this error on your system. This section will explain those causes in detail and show you how they can be resolved.

Reason 1: Internet Connection Problem

If the internet connection is not working, then the system will not be able to access the “archive.ubuntu.com” website, and hence the error will be invoked. The error can be seen in the following snippet while attempting a package update:

$ sudo apt update

Solution: Check Internet Connection

Since this problem is related to this internet connection. To check your internet, execute the below script:

$ ping -c 2 8.8.8.8

This error confirms that the internet connection on your system is not working. To fix it, ensure your system is connected to the wireless internet or via the ethernet cable. If the internet is turned off on the user system. You can turn it on by clicking on the menu in the top right corner of your Ubuntu system. The next step is to click on the wired/wireless option and then on “Connect”, as shown below:

Reason 2: DNS Nameserver Does Not Exist

The DNS, which stands for Domain Name System, exists in the operating system to help create a link between the remote server of any website and the domain name used by the system to access this server. For instance, if “www.google.com” is referred to, then the DNS will take this domain name and link it to the remote server for google so that the website can be accessed.

In the Ubuntu system, there is a command for DNS which exists in the “/etc/resolv.conf” file. If this command is unavailable in the file, the system will invoke the “temporary failure resolving archive.ubuntu.com” error.

Solution: Add DNS Nameserver Command

To fix this problem, the user needs to add the missing nameserver pattern to the “/etc/resolv.conf” file. To do so, access the file through the nano editor via the script:

$ sudo nano /etc/resolv.conf

The command above will open up the “/etc/resolv.conf” file as shown below:

The next step is to add the following command into the file through which the DNS nameserver will be added into the system, and the error will no longer occur on your system:

nameserver 8.8.8.8

Save and exit the file. You may verify whether the error has been resolved or not by using the packages update command as follows:

$ sudo apt update

The successful execution of the command shows that the error has been resolved.

That’s all from this guide!

Conclusion

The “temporary failure resolving archive.ubuntu.com” problem is invoked for two reasons. The first is that the system is having issues with the internet connection. The second reason is that the DNS nameserver does not exist in the “/etc/resolv.conf file”. The error can be fixed by checking and resolving your internet issues or adding the DNS nameserver command into the “/etc/resolv.conf” file through the terminal. This article has provided all the necessary information about the reasons for the error “temporary failure resolving archive.ubuntu.com” and the solutions.