apt-get unable to resolve archive.ubuntu.com

May 30, 2014 1.9k views
Trying to install iptables-persistent with apt-get. It stucks with resolving archive.ubuntu.com resulting in "Temporary failure resolving" this hostname. I checked resolv.conf - it has & nameservers Also apt/sources.list has 5 deb entries with archive.ubuntu.com/ubuntu Infact I can't even ping those nameservers along with other domains I've tried. Iptables set to output accept policy with no rules.
3 Answers
You need to change repository link from archive.ubuntu.com and security.ubuntu.com to old-releases.ubuntu.com
Ref: http://www.warpconduit.net/2011/07/31/apt-repository-for-old-ubuntu-releases/
Does it work if you temporarily reset your IPTables rules?
Run the following commands to take a backup of your rules and then reset everything to the defaults:
sudo iptables-save | sudo tee iptables.backup

sudo iptables -F
sudo iptables -X

Then, check if the apt-get command works.
You can restore your rules by running this command:
sudo iptables-restore < iptables.backup
@hungbc2811: You would only need to use old-releases.ubuntu.com if you were on an unsupported version of Ubuntu. If that is the case, I'd highly advise you to upgrade to a current release so that you still receive security support. "old-releases" just allows you to access the existing packages, you won't get any update or security fixes.
Have another answer? Share your knowledge.