Ubuntu – The correct output of cat /etc/apt/sources.list

12.04aptcat

I have Ubuntu 12.04 LTS. I need the correct output because I edited it because it wasn't working but it has only made it worse.

Best Answer

  • Here is a simple example of a standard /etc/apt/sources.list file for Ubuntu 12.04:

    deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
    deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
    deb http://archive.ubuntu.com/ubuntu precise-backports universe main multiverse restricted
    deb http://archive.ubuntu.com/ubuntu precise-security universe main multiverse restricted
    

    The easiest way to edit the sources.list file is from the terminal in nano editor using the following command:

    sudo nano /etc/apt/sources.list  
    

    The instructions for using nano are always displayed at the bottom of the page. Use the keyboard combination Ctrl + O and after that press Enter to save the file to its current location. Use the keyboard combination Ctrl + X to exit nano.

    Make sure to run this command after changing sources.list to refresh the list of available software.

    sudo apt update  
    

    A standard sources.list file for Ubuntu 16.04 looks like this:

    deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse  
    deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse  
    deb http://archive.canonical.com/ubuntu xenial partner  
    

    A standard sources.list file for Ubuntu 18.04 looks like this:

    deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse  
    deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse  
    deb http://archive.canonical.com/ubuntu bionic partner  
    

    A standard sources.list file for Ubuntu 20.04 looks like this:

    deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse  
    deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse  
    deb http://archive.canonical.com/ubuntu focal partner
    
  • Related Question