Wednesday, April 25, 2007

Using dpkg (debian package manager) manually

The simplest way to install a single package you've downloaded is the command dpkg -i (short for dpkg --install. Say you've downloaded the package icewm_0.8.12-1.deb and you'd like to install it. First log on as root, then type:

dpkg -i icewm_0.8.12-1.deb

and icewm version 0.8.12 will be installed. If you already had an older version, dpkg will upgrade it rather than installing both versions at once.

If you want to remove a package, you have two options. The first is most intuitive:

dpkg -r icewm

This will remove the icewm package (-r is short for --remove). Note that you give only the 'icewm' for --remove, while --install requires the entire .deb filename.

--remove will leave configuration files for the package on your system. A configuration file is defined as any file you might have edited in order to customize the program for your system or your preferences. This way, if you later reinstall the package, you won't have to set everything up a second time.

However, you might want to erase the configuration files too, so dpkg also provides a --purge option. dpkg --purge icewm will permanently delete every last file associated with the icewm package.



To check what have install by listing all using dpkg is easy.
dpkg -l
To check whether a package is install also easy.
dpkg -l | grep apache
The command above is some how redundant, because dpkg support wild characters, doing this instead
dpkg -l “apache*”
By doing this, it will also list the package that not install

No comments: