Home Frequently Asked Questions How To Add Repositories To Debian 8.1.0

How To Add Repositories To Debian 8.1.0

We recently reviewed the much touted release of Debian 8.0.

Yesterday, we witnessed the release of its first update, Debian 8.1.0.

Upon a fresh install of Debian, things are pretty basic on the ground. You might find there are packages that you need to install that are not included in the system out-of-the-box. That’s no problem! Today’s Tutorial we show you how you can quickly add some extra repositories to your Debian 8.1.0 system and clean up the APT sources file in the process. It’s time to jump right into it and get our hands dirty. Read on to learn how.

Why the Missing Repositories?

Debian prides itself on absolute freedom and open-source. Although you might not be able to live without your third-party packages on Linux, the guys at Debian beg to differ. This is primarily the reason we do not see any third-party repositories enabled in a APT source file on Debian.

Although this may seem nasty at first, it’s all about advocating and promoting absolute freedom with Debian. Thankfully though, there are repositories supported that can easily be added to your source file and of which contain most of the packages that you will probably want to install.

Adding the Repositories

The first thing we need to do is become the Root user. This can easily be done by opening your terminal console and enter the following command:

chris@debian:~$ su
password
root@debian:/home/chris#

Displayed above is the Root user shell. This is demonstrated by the different shell prompt:

  • $ = regular user
  • # = root user

 1

You should now be running as Root and be able to edit the APT source file configuration.

The file is located at the following path:

  • /etc/apt/source.list

We are going to stay in the terminal console environment and edit the file using the simple console text editor, nano.

Edit the configuration file by running the following command:

nano /etc/apt/sources.list

2

The default configuration will look something like the following image.

3

There are just a simple few additions and tweaks we need to make.

First, simply comment out the line where it says something like the following:

deb cdrom:[Debian GNU/Linux 8 _Jessie_...

The line should now look like the following:

# deb cdrom:[Debian GNU/Linux 8 _Jessie_...

Throwing a hash character at the beginning of the line simply comments the line out, effectively disabling the source.

Next, take note of the line(s) that state the following:

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

Note that we have underlined the main section of the line. That is primarily the branch of the repository of where your packages will currently be sourced from, based on the current default configuration of the file.

Change the lines(s) to the following and add the branches contrib and non-free:

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free

Also add the following line underneath the lines displayed above:

deb http://http.us.debian.org/debian jessie main contrib non-free

Once configured, your re-configured source lines should look as follows:

# deb cdrom:[Debian GNU/Linux 8 _Jessie_...
# deb cdrom:[Debian GNU/Linux 8 _Jessie_...
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
deb http://http.us.debian.org/debian jessie main contrib non-free

4

Exit nano and don’t forget to Save the file when you exit.

Updating the Repositories

Now we need to update the repositories source for the changes that we have made to come into play:

apt-get update

5

Your repositories should now update and you should now have many more software packages available at your disposal.

6

That’s it.

About the Author:

Chris Jones is the Editor-in-Chief, Secretary and Director of Global Operations of Freedom Publishers Union. He is the former Chief Editor of Unixmen.com and Unixmen Australia. Prior to this role, he run the now defunct technology news website, TheMuldyZone.net.

Mail: editor@freedompublishersunion.com