How do I enable the "backports" repository?

Command-line/Server Instructions

Backports are enabled by default, here's how you can check to make sure they are turned on.

Ensuring Backports are enabled

To enable the backports manually make sure the following line is in your /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu release-backports main restricted universe multiverse  

Replacing release with the current distribution you are using ( precise for 12.04 for example).

Now the next steps will depend on whether you want apt to always use packages from the backports or whether you want to only use the backports only when manually specified.

Always use the backports..

Ubuntu 11.04 and newer are automatically configured to only use the backports when manually specified. If you want to always use the backports when installing you'll need to add the following lines to /etc/apt/preferences (the file might not exist yet; that's fine):

Package: *
Pin: release a=<release>-backports
Pin-Priority: 500  

Make sure you substitute release with your current release.

Using the backports manually..

If you only want to install packages from the backports when manually specified you'll need to add this to /etc/apt/preferences:

Package: *
Pin: release a=<release>-backports
Pin-Priority: 100  

Again substituting <release> for your current release.

note: You will need root privileges to modify /etc/apt/preferences.

Installing from the backports..

If the backports are configured to be used manually you will need to add /release-backports to the end of the package name when installing a package (substituting release for your current release).

For example, if you're using 12.10 Quantal and have configured the backports for manual install you would install amarok with this command:

sudo apt-get install amarok/quantal-backports  

Source: Ubuntu Backports - Ubuntu Wiki


Ubuntu Backports are enabled by default in Ubuntu.

If for some motive you still don't get the backports use any of these 2 ways:

  1. Click the Ubuntu button on the launcher and search for "Software Sources". Search for "Software" if using 12.04+.

  2. Press ALT+F2 and Type: gksu software-properties-gtk

Any of the 2 Ways will get you to the Software Sources Manager or Software & Updates. In here Activate all 4 options in the Ubuntu Software Tab and in the Updates Tab. This should enable the Extras for your Ubuntu Version.

Ubuntu Software Sources - Ubuntu Software Tab

Ubuntu Software Sources - Updates Tab

After this just click on the CLOSE Button and it should let you know that it needs to update because of the changes you made. Note that in the Updates tab, the Backport option is the 4th one in there. It's the one that says Unsupported updates.

To activate the backports (Which is automatically enabled since 11.10) from the terminal (In cases where you are working on a server and want the backports enabled) do the following after opening the terminal (This example is using Ubuntu 13.04):

sudo nano /etc/apt/sources.list

And look for a commented line that mentions the keyword backport, should look something like raring-backports for 13.04, precise-backports for 12.04 and son. In this case it looks like this:

  ##deb http://archive.ubuntu.com/ubuntu raring-backports main restricted universe multiverse
  ##deb-src http://archive.ubuntu.com/ubuntu raring-backports main restricted universe multiverse

uncomment this lines so they look like this:

  deb http://archive.ubuntu.com/ubuntu raring-backports main restricted universe multiverse
  deb-src http://archive.ubuntu.com/ubuntu raring-backports main restricted universe multiverse

save the file and run the following to receive the backport updates:

sudo apt-get update  
sudo apt-get upgrade

NOTE - If the lines are not found, simply add them and change the name of the version to the one you are using as explained above.

Reference

  • https://help.ubuntu.com/community/UbuntuBackports