3

How can I recover sources.list which has crash and I can not do any software update. When I click on the update icon I do not get any response. I try to edit the sources.list file the “vi”editor did not work. I was try to enter the following line on the “Software Updater”:

deb http://deb.torproject.org/torproject.org trusty main
deb-src http://deb.torproject.org/torproject.org trusty main

I will appreciate if you can help me; I am not good in using the terminal.

muru
  • 197,895
  • 55
  • 485
  • 740

3 Answers3

2

Note:

By default you can find a backup of this file inside /etc/apt dir called sources.list.save

So you can use it to recover your lost one.

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

Else, if you don't have this file,you can visit this link:http://repogen.simplylinux.ch/ Enter your information and you'll get your customized sources.list file For the default set of repositories, you need to enable these repositories.

  1. All of the Ubuntu Branches repositories.
  2. Security - Important Security Updates.
  3. Security Sources Repository
  4. Updates - Recommended Updates
  5. Updates Sources Repository
Maythux
  • 84,289
1

Default sources.list file on 14.04:


# deb http://be.archive.ubuntu.com:80/ubuntu/ trusty main restricted

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates main restricted

deb http://security.ubuntu.com/ubuntu trusty-security main restricted

See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

newer versions of the distribution.

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty main restricted deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty main restricted

Major bug fix updates produced after the final release of the

distribution.

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates main restricted deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates main restricted

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team. Also, please note that software in universe WILL NOT receive any

review or updates from the Ubuntu security team.

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty universe deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty universe deb http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates universe deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates universe

N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

team, and may not be under a free licence. Please satisfy yourself as to

your rights to use the software. Also, please note that software in

multiverse WILL NOT receive any review or updates from the Ubuntu

security team.

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty multiverse deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty multiverse deb http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates multiverse deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty-updates multiverse

N.B. software from this repository may not have been tested as

extensively as that contained in the main release, although it includes

newer versions of some applications which may provide useful features.

Also, please note that software in backports WILL NOT receive any review

or updates from the Ubuntu security team.

deb http://be.archive.ubuntu.com:80/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://be.archive.ubuntu.com:80/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted deb http://security.ubuntu.com/ubuntu trusty-security universe deb-src http://security.ubuntu.com/ubuntu trusty-security universe deb http://security.ubuntu.com/ubuntu trusty-security multiverse deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

Uncomment the following two lines to add software from Canonical's

'partner' repository.

This software is not part of Ubuntu, but is offered by Canonical and the

respective vendors as a service to Ubuntu users.

deb http://archive.canonical.com/ubuntu trusty partner

deb-src http://archive.canonical.com/ubuntu trusty partner

Uncomment the following two lines to add software from Ubuntu's

'extras' repository.

This software is not part of Ubuntu, but is offered by third-party

developers who want to ship their latest software.

deb http://extras.ubuntu.com/ubuntu trusty main

deb-src http://extras.ubuntu.com/ubuntu trusty main

The location of the file is: /etc/apt/source.list

You can edit it by issuing sudo vi /etc/apt/source.list or sudo nano /etc/apt/source.list (nano might be easier for you).

If you want to add those repositories mentioned, you should add these lines to the bottom of the file:

# Tor Project Repositories
deb http://deb.torproject.org/torproject.org trusty main
deb-src http://deb.torproject.org/torproject.org trusty main
Pablo Bianchi
  • 15,657
aairey
  • 168
1

Simply remove the file sources.list

sudo rm /etc/apt/sources.list

or make a backup if you don't trust me.

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

After that

  1. Start Software & Updates via Unity Dash
  2. Click on the checkbox Canonical-supported free and open-source software (main)
  3. Enter your password
  4. Close the dialog

and you will have a new file

A.B.
  • 90,397
  • the top answer repo generator link only has old ubuntu, the second answer is only for ubuntu 14.04. But this answer is timeless and still work for the latest ubuntu as of now – izzulmakin Mar 01 '23 at 03:40