Programming Tutorials

Installing using Debian apt-get in Linux

By: Jason Lambert in Linux Tutorials on 2011-03-02  

Apt-Get is a wonderful package management system for Debian GNU/Linux. Apt-Get, like RPM make installing and managing installed software easy, and once again has the same disadvantages that binaries are pre-built and cannot really be fine tuned to your system very well. I really like Apt-Get because of its automatic software download and upgrade mechanisms, and unlike RedHat doesn't keep trying to sell you something, and doesn't try to limit your use of the system.

The most powerful feature of apt-get surely is that you don't manually have to find & download the software you want to install, apt-get will do this for you, and also resolve any software dependencies. Before you can use apt-get for the first time, you must do a small bit of configuration.

You need to edit your /etc/apt/sources.list file, to specify the locations of Debian packages. You will probably want your default sources.list file to look something like this:

deb https://http.us.debian.org/debian stable main contrib non-free
deb https://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
deb https://security.debian.org stable/updates main contrib non-free

If you would like to use more upto date software on your machine, you will probably want your sources file like this:

deb https://ftp.debian.org/debian/ sid main contrib
deb https://non-us.debian.org/debian-non-US sid/non-US contrib
deb https://security.debian.org/ stable/updates main

The first sources.list file uses the stable branch of debian packages. Software installed when using the stable version has undergone more testing, and in theory has less bugs. However, the software on the stable branch is usually much older versions, so you may be missing out on new features etc. The second example sources.list uses the UnStable branch. This means you will get newer versions of software, but you may occasionally run into bugs which have not yet been fixed. I myself use and recommend using the unstable branch, the software on the stable branch is 2 or 3 years behind the unstable.

Once you have confirmed your sources.list file, we need to update our local list of packages that are available for installation. To do this, use the following command after logging in as the root user:

apt-get update

After updating the list, you can install applications like so:

apt-get install <program>

To see a list of available programs that you can install, or to find a particular program, we can use apt-cache, like so:

apt-cache search <something>

Replace <something> with a application name or word. Eg, to find an irc client to install, you could execute

apt-cache search irc

To uninstall software is fairly straight forward also.

apt-get remove <application>

replace <application> with the name of the program you want to remove.

A word of caution: If you try to remove a piece of software that other pieces of software depend on, apt-get will also want to un-install those other pieces of software as well. Be careful you don't end up uninstalling your entire system!. apt-get will prompt you before removing any additional packages so watch carefully!






Add Comment

* Required information
1000

Comments

No comments yet. Be the first!

Most Viewed Articles (in Linux )

Latest Articles (in Linux)