Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are now errors when updating and I cannot install most software due to a corrupted


file. Is there a copy I can download to replace it?

The file would be for Ubuntu 12.04 (Final Beta) in the United States.

share|improve this question
Have you tried the "Software Sources" GUI app? I'm not running 12.04, but in the past, this is where you could choose the repository location, and edit which ones to use from that location. – Marty Fried Apr 21 '12 at 18:14
I did, and none of the errors listed were in that. I just want to find a copy of the sources.list file as it was when I had freshly installed Ubuntu. – Klikini Apr 21 '12 at 18:15
Error: W: Duplicate sources.list entry testing/non-free amd64 Packages (/var/lib/apt/lists/‌​Packages) W: Duplicate sources.list entry testing/non-free i386 Packages (/var/lib/apt/lists/‌​ackages) W: You may want to run apt-get update to correct these problems – Klikini Apr 21 '12 at 18:18
You should be able to go to the "Other Software" tab, and delete the duplicate entries. Or, if you're not sure, you can uncheck a few and see if that fixes the problem. Also, did you run "sudo apt-get update" like it suggested? – Marty Fried Apr 21 '12 at 18:34
Yes, I did. It gives me W: Failed to fetch 404 Not Found W: Failed to fetch‌​kages 404 Not Found W: Failed to fetch‌​ages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. – Klikini Apr 21 '12 at 19:09
up vote 57 down vote accepted

You can use this trick. Open a terminal ( Pressing Ctrl+Alt+T ) and do these

  • Remove the corrupted one

     sudo rm /etc/apt/sources.list
  • Open software-properties-gtk

     sudo software-properties-gtk

    This will open software-properties-gtk and a new sources.list will be created automatically.

    Then change the server to US or to any other server of your choice. You must enable repositories from the new dialog in order to create new sources.list .

    enter image description here

share|improve this answer
And if i was in Ubuntu server?! – Mr.Hyde Jul 6 '15 at 9:58
This did not work for me -new sources.list was not generated. – hydroxide Aug 10 '15 at 20:26
I have tested this again now, it generates a new one. You have to enable some repository, like main, universe etc – Anwar Shah Aug 11 '15 at 2:37

Go to

Select your Country and Ubuntu Release.

For the default set of repositories, you need to enable these repositories.

  • All of the Ubuntu Branches repositories.
  • Security - Important Security Updates.
  • Security Sources Repository
  • Updates - Recommended Updates
  • Updates Sources Repository

If you want to install software from Canonical Partner Repositories (closed source software), enable the Ubuntu Partner Repositories (both of them).

Enable any 3rd party repository you wish to enable.

Now, click the Generate List button at the bottom of that page and you'll see your generated sources.list.

Replace the old sources.list with the new one

Run the following commands in a Terminal.

sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
gksudo gedit /etc/apt/sources.list

Copy/paste all the text from the newly generated sources.list to this file. Save it and close Gedit.

Now, update apt.

sudo apt-get update

This will update your repository index with the current sources.list and then you can install any software using Software Center, Synaptic or apt-get.

share|improve this answer
Somewhere in the past, you added… to your list. Did you last have the natty version before the beta? I suspect the upgrader changed natty to precise, but there is no precise version available for this package. I would delete it from "Other Software". The error isn't hurting anything, by the way. – Marty Fried Apr 21 '12 at 20:27
Can you please put your new information in your question instead of the comments, it's hard to see what part you're having a problem you're stuck on now. – Jorge Castro Apr 21 '12 at 21:20
Will this make me reinstall all programs again and link all of PPAs again? I really think I need refreshing sources.list, but I don't know how long will it take to install all...:D And it is totally safe, rigth? It can't do such things as suddenly stop using such things as Kernel, grub etc., right? – Adrians Netlis Dec 25 '15 at 22:10

By default there will be a backup for your sources.list file on the same directory itself.

sudo cp /etc/apt/ /etc/apt/sources.list

Answer from similar question here:

share|improve this answer
cp: cannot stat `/etc/apt/': No such file or directory – Mr.Hyde Jul 6 '15 at 9:58

protected by Community Apr 17 '15 at 21:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.