Installing software under Linux doesn’t require one to hit the console anymore. Thanks to the graphical package managers available which have made the job of installing, uninstalling & updating software packages a child’s play. Still knowing how to manage software via console is necessary to make yourself a competent Linux user. In this first post I will cover installing software under Debian Linux. I will follow this post with installing softwares on Redhat, installing from source etc.

Installing software packages

Debian uses APT(A Package Tool) to manage software’s. Software packages can be installed simply by issuing;

# apt-get install foobar

Just replace foobar with the application name (e.g. firefox) and APT will download & install the requisite application from the internet.

If you have downloaded an application package for you debian system in .deb format then you can install the application manually by issuing,

# dpkg -i foobar.deb

In the above command the –i instructs the command to install the application named foobar.deb. Do note that you will need to navigate to the directory or provide the complete path to the package here. You can’t simply use dpkg –i foobar.deb if the real package is by the name foobar0.8.1.deb.

Additional Commands which can be used with Apt-get

Apt-get can be used with the following commands,

# apt-get install foobar

The above command will download the application named foobar alongwith its dependencies & will install it on your system.

# apt-get remove foobar

The above command will remove the application named foobar from your system.

# apt-get upgrade

The above command will update all the packages with a newer version if available of the same.

# apt-get update

The above command will refresh the packages from the sources mentioned in the etc/apt/sources.list file. You must use this command before you use the upgrade or dist-upgrade command.

# apt-get check

The above command will update the package cache & also will check for broken packages.

# apt-get clean

The above command will clean local repository of downloaded packages.

Removing/Uninstalling software packages

In order to remove a software from your system then you can use,

# dpkg -r foobar

In the above command the application foobar will be removed from your system. Do note again that here you won’t need to enter the complete package name as foobar0.8.1.deb. The above command will remove the application foobar from your system but will leave behind configuration files if any. Configuration files contain the settings which you might have done to customise the program according to your needs. If you wish to get rid of these files to then you will need to issue,

# dpkg –purge foobar

The above will remove each & every file related to the application foobar from your system.

About these ads