0

I've badly damaged my package system. So I found another solution, sudo apt-get build-dep <package>

But when I typed sudo apt-get build-dep update-manager, I got,

E: You must put some 'source' URIs in your sources.list  

Then I accessed it using the sudo nano /etc/apt/sources.list. The list was blank. Now I'm unsure on how to add more source URIs. I cannot access the software updater to change it. I've tried Synaptic Package Manager.

sudo apt-get -f install   
Reading package lists...  Done  
Building dependency tree                                                                             
Reading state information... Done  
E: The package python3 needs to be reinstalled, but I can't find an archive for it.

Update:

I have edited sources.list using @karel's answer on What is the correct output of cat /etc/apt/sources.list? and replacing bionic with cosmic.

Now when I try to launch software-properties-gtk, I'm getting:

bash: /usr/bin/software-properties-gtk: /usr/bin/python3: bad interpreter: Too many levels of symbolic links

Outputs for symbolic links of python3:

$ ls -l /usr/bin/python3                                                     
lrwxrwxrwx 1 root root 18 May 27 20:30 /usr/bin/python3 -> /usr/bin/python3.6

$ ls -l /usr/bin/python3.6  
lrwxrwxrwx 1 root root 25 May 27 16:31 /usr/bin/python3.6 -> /etc/alternatives/python3

$ ls -l /etc/alternatives/python3
lrwxrwxrwx 1 root root 18 May 27 16:31 /etc/alternatives/python3 -> /usr/bin/python3.6

Output of ls -l /usr/bin/python*:

lrwxrwxrwx 1 root root      18 May 27 23:10 /usr/bin/python -> /usr/bin/python3.2   
lrwxrwxrwx 1 root root       9 Jun  7  2018 /usr/bin/python2 -> python2.7   
-rwxr-xr-x 1 root root 3691008 Apr  9 05:50 /usr/bin/python2.7
lrwxrwxrwx 1 root root      18 May 27 20:30 /usr/bin/python3 -> /usr/bin/python3.6  
lrwxrwxrwx 1 root root      25 May 27 16:31 /usr/bin/python3.6 -> /etc/alternatives/python3      
lrwxrwxrwx 1 root root      33 Apr  9 05:59 /usr/bin/python3.6-config -> x86_64-linux-gnu-python3.6-config     
-rwxr-xr-x 1 root root 4530552 Apr  9 05:59 /usr/bin/python3.6m
lrwxrwxrwx 1 root root      34 Apr  9 05:59 /usr/bin/python3.6m-config -> x86_64-linux-gnu-python3.6m-config    
-rwxr-xr-x 2 root root 4804160 Apr  9 05:56 /usr/bin/python3.7   
-rwxr-xr-x 2 root root 4804160 Apr  9 05:56 /usr/bin/python3.7m   
lrwxrwxrwx 1 root root      16 Oct 25  2018 /usr/bin/python3-config -> python3.6-config       
lrwxrwxrwx 1 root root      10 Oct 25  2018 /usr/bin/python3m -> python3.6m
lrwxrwxrwx 1 root root      17 Oct 25  2018 /usr/bin/python3m-config -> python3.6m-config 
Kulfy
  • 17,696

1 Answers1

0

You've learned a valuable lesson today: Backup files before editing them.

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

If you mess up the file, you can copy the backup and start again:

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

Things to think about:

  1. /tmp files are removed on reboot. Be careful when backing up to /tmp.
  2. Be careful and ensure backed up files don't contain and leak sensitive information.

To restore your sources.list file, you can empty out the sources.list file, and then use software-properties-gtk to re-create the list. Details about this process are found in this answer, but you use the GUI to uncheck and check which sources you want. You need at least "main", and will likely want "universe" as well. After you enable these, be sure to update your database via apt update.

earthmeLon
  • 11,247