Restore your Sources List to Defaults in Ubuntu

Ubuntu Sources List Generator is available for all the current Ubuntu releases. It is a website which generates a sources list with your intended repositories/server and then you can copy it to your /etc/apt/sources.list

How to generate a new sources.list 

Go to this website.

http://repogen.simplylinux.ch/

Select your County and Ubuntu Release. For a default set of repositories, you need to enable these repositories.

1. All of Ubuntu Branches repositories.
2. Security - Important Security Updates.
3. Security Sources Repository
4. Updates - Recommended Updates
5. Updates Sources Repository

If you want to install software from  Canonical Partner Repositories (closed source software), enable the Ubuntu Partner Repositories (both of them) or if you choose not to, leave them alone.

If you want to install latest versions of some software say AWN, enable the 3rd party repository for AWN and any others you wish to enable.

Now, click the Generate List button at the bottom of that page and you'll see your generated sources.list. 
How to replace old sources.list with the new one

Go to Applications > Accessories > Terminal:

First Backup your old sources.list in case you need to revert to the older one under any circumstances.

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

Generate a new one.

sudo gedit /etc/apt/sources.list

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

sudo apt-get update

It would update your repository index to the current sources.list and now can install any software using Software Center, Synaptic or apt-get.

No comments:

Post a Comment