2

I was trying to modify that file, and then somehow all the contents got deleted... does anyone know where I can get a new one? I'm using Ubuntu 11.04

Edit: Moreover, what had happened was I had changed all the occurrences of 'archive.ubuntu.com' in that file to 'old-releases.ubuntu.com', but then this caused the command sudo apt-get install [package-name] to always return with "Cannot locate package...", no matter what package name I typed. So I tried to switch all occurrences back to what they originally were, using sed, and that's when everything in that file disappeared...

user.dz
  • 49,176

2 Answers2

2

There is a copy of this file in /usr/share/doc/apt/examples/sources.list

You can make a new copy by doing:

sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
Jorge Castro
  • 73,717
0

Support for 11.04 is discontinued and you may have a difficult time completely restoring the sources.list file to your prior contents. Are you able to upgrade to a newer edition, perhaps with long term support? 12.04 LTS might be your best option, and 14.04 LTS comes out next month.

Try updating via the FromUSBStick instructions. I use this for system recovery, its a good tool to carry around in your backpack anyway. If your hardware is out of date and your worried about demand on your system, you can always do away with the 'fancier' Unity features and Compiz and such.

This blog post may be helpful

If upgrading isnt an option, you may be able to restore your sources.list as follows:

 sudo sed -i 's,http://.*ubuntu.com,http://old-releases.ubuntu.com,g' /etc/apt/sources.list

sudo apt-get -y update

If you intend on rebundling the image, you will need to run the following commands to ensure that bundled images retain the settings:

dpkg-divert --local --rename --add /etc/cloud/templates/sources.list.tmpl

sed -i  's,http://.*ubuntu.com,http://OLDRELEASEDOMAIN.com,g' \

     /etc/cloud/templates/sources.list.tmpl.distrib \

    | sudo tee /etc/cloud/templates/sources.list.tmpl

where OLDRELEASEDOMAIN is 'old-releases DOT ubuntu DOT com' (given that the url isnt allowed here, you are further encouraged to upgrade your system).

Todd
  • 401