Recently I had to reinstall Ubuntu. When I was trying to install bind9 (bind9 installing and configuring are further discussed
here) on my fresh installation, I came across an error.
It was not a problem with bind9 installation. When I tried
sudo apt-get update
it comes up with the same error!
W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Unable to connect to archive.ubuntu.com:http:
Same error message was repeated for multiple lines. Special feature of all the error messages was that it was prone to occur from same resource
http://archive.ubuntu.com
. To be precise, this error is not limited to above mentioned server. By searching google I have found out that many people had come across the same error in different servers.
W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/precise/Release.gpg Unable to connect to extras.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Unable to connect to security.ubuntu.com:http: [IP: 91.189.92.190 80]
A solution for apt-get error
This error can be easily corrected by changing the sources list of ubuntu.
/etc/apt/sources.list
Follow the below steps in order
- Go to Ubuntu Sources List Generator
- Select your country and Ubuntu release
|
Select country and ubuntu version |
- Select required sources. First 12 sources are recommended.
|
Select required sources |
- Hit Generate List Button
- Copy generated list
|
My sources list. Yours can be different. |
- Backup the old sources list
sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
- Create new source list
sudo vi /etc/apt/sources.list
If you prefer graphical text editor
sudo gedit /etc/apt/sources.list
- Paste newly generated sources list and save
- Retry
sudo apt-get update
or any other apt-get command
Voila! should be working perfectly
No comments:
Post a Comment