Your Guide To Ubuntu Repositories and Package Management

UbuntuLogo   Your Guide To Ubuntu Repositories and Package ManagementOne of the amazing things about the Linux world that other operating systems lack is the software and package management. Everything is taken care of for you. The updates, the dependencies, the missing files, you need not think about anything everything is done for you. That being said, there are things that are not completely obvious to starters. Here is a quick rundown of commands, files and tools that should get you up to speed with package management.

Most Linux distributions that are aimed at average users have a package management tool. RedHat and Fedora have RPM, Debian/Ubuntu/Mint has APT, Arch has Pacman and so on. Each of them essentially do the same thing — keep track of what is installed, lets you install and remove software as well as prompt you to update the installed software whenever necessary. Choosing one to have a detailed look at, it would be APT package management in Ubuntu. So here we go:

Repositories

There are tons of software application and tools available in Linux. There has to be a way to organise them somehow. Repositories do that. Repositories are like archives of software that runs on your computer. In Ubuntu world, repositories are classified into 4 categories – Main, Restricted, Universe and Multiverse. This categorization is based different levels of support. Main – contains software that is officially supported, Restricted – has software that is supported but is not available under a free (doesn’t refer to cost, but the license) license, Universe – contains software that is not officially supported but is maintained by the Linux Community, Multiverse – houses software that is not free.

Configure Software Sources

Now, all of the repositories are not enabled by default on every Ubuntu installation. There are a number of reasons why it is this way, reasons like the ones that don’t allow Ubuntu to ship with codecs and drivers out of the box. Anyhow, enabling repositories is very easy. Go to System > Administration > Software Sources and then you can simply check/uncheck to enable/disable repositories.

softwaresources   Your Guide To Ubuntu Repositories and Package Management

Install/Remove Software and Package Management in Ubuntu

The recent versions of Ubuntu include what is called the “Ubuntu Software Center” that lets you install and remove software as easy as installing applications from your iPhone App Store. The choices however, are limited. If you can find what you want in the Ubuntu Software Center, by all means go ahead and install if from there. It is the easiest way to do so. For a little more control, and what used to be the easiest way 6 months back, you can look up the Synaptic Package Manager.

synaptic   Your Guide To Ubuntu Repositories and Package Management

It can be accessed via System > Administration > Synaptic Package Manager. The default view will list categories on the left side and clicking on any one of them shows you the packages on the right hand side. You can also use the search functionality to find what you need. Once you have the required package in sight, just check it and Synaptic will take care of the dependencies for you. Then click Apply and you will be shown an overview of what all will be changed on your computer. Accept or Cancel as the case may be.

Configuring “Other Software” or PPAs

It takes some time and backing up before a software can make into the repositories. This however is the age of the Internet and we don’t want to wait all that time. So how can you install software that is not in the repositories? Keep in mind that Google Picasa, Google Earth, Chrome are not available via repositories. Likes of Banshee and Gwibber were not in the repositories till some time back.

In that case, you need to use what’s called Personal Package Archives. There is nothing new or scary about these puppies. We have used them a number of times in the past when we installed latest software that was not available via the repositories. Once you add the PPA for your favorite software, you will get automatic updates and bug fixes for the software just like you would get for any software in the repositories. To add a PPA:

Visit the PPA page of the software (An example). It houses the important details that you would need in the following steps.

reposinfo   Your Guide To Ubuntu Repositories and Package Management

Go to System > Administration > Software Sources, then onto the Other Software tab.

addsource   Your Guide To Ubuntu Repositories and Package Management

Click on the Add button and then paste in the line that starts with deb and corresponds to your Ubuntu version. Karmic users would enter in a line that looks like :

deb http://<something, something, something> karmic main

Click Add source and you are done. Click Close and Ubuntu will reload package information.

Importing keys

PPAs generally list a OpenPGP key that is used by Package management tools to confirm the authenticity of the packages that are being installed. So once you have added the PPA, you also import the corresponding keys before you can install and use the software. Open up the terminal and issue the following command:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys <A number>

signingkey   Your Guide To Ubuntu Repositories and Package Management

Where “A number” is a hexadecimal number that is listed on the PPA’s page. See the screen above.

You can now install, update and remove the software just as easily as you do with any other package from the repositories. Did you find that brief explanation helpful?

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

27 Comments -

Giannis

I only recently started following makeuseof, and I was gonna quit following cause of too many windows articles. I’m glad to see an article about linux. Fairly basic stuff for me, but I’m happy to see something about linux on your website nontheless. Keep it up ;)

Trevor

Linux would be much better if they could provide offline install files…. your stuffed when you dont have the interenet and you need to install something, missing libraries here and there and it takes a long time. I am a Suse user and am seeing the build project trying to over come this but its still not completed… this is one advantage Windows and Mac will always have over Linux in a user friendly enviroment. Please quote me if im wrong….

Aibek

Giannis, in case you’re interested here are some more Linux articles

http://www.makeuseof.com/servi

Philip

I think that the titles should be changed to better reflect contents. This one should be entitled “Your Guide To Ubuntu Repositories and Package Management (Gnome Desktop). Or better still a walkthrough using the Terminal. Am I a super user, my friends may tell you I am, I am just one chapter in front that’s all. When they have a problem they will call me. I no longer ask which ‘DE’ they are using I take then direct to Terming then we are all on the same page.
If you want to do graphic howto’s then you should at least show Gnome and KDE.

Complememnts to you on a great website.