Social Icons

Pages

Saturday, September 27, 2014

Ubuntu apt-get update error

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
  1. Go to Ubuntu Sources List Generator
  2. Select your country and Ubuntu release
  3. ubuntu sources list generaor
    Select country and ubuntu version

  4. Select required sources. First 12 sources are recommended.
  5. ubuntu sources list generaor
    Select required sources
  6. Hit Generate List Button
  7. Copy generated list

  8. apt-get sources list
    My sources list. Yours can be different.
  9. Backup the old sources list
  10. sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
  11. Create new source list
  12. sudo vi /etc/apt/sources.list
    If you prefer graphical text editor
    sudo gedit /etc/apt/sources.list
  13. Paste newly generated sources list and save
  14. Retry sudo apt-get update or any other apt-get command
Voila! should be working perfectly

No comments:

Post a Comment

 
Blogger Templates