Showing posts with label Debian. Show all posts
Showing posts with label Debian. Show all posts

Thursday, January 04, 2007

Debian package management basics you should know !

For people who shift from the platforms like Fedora, Mandriva to Ubuntu or Debian - Package management is much more pleasant that you would love using it almost everyday.

These are the most basic commands & utilities that I use on my debian based
system (Ubuntu) which will enhance your package management experience even
more!

The commands are

dpkg

dpkg is at the heart of debian package management system. All the other
programs invoke dpkg which does the package operations and returns the status.

Options of dpkg that I use:

Install a deb package - dpkg -i {packagename}.deb
Remove a deb package - dpkg -r {packagename}
Search for a file in all the installed packages - dpkg -S {name_of_file}
Status of a package - dpkg -s {packagename}

apt-get

apt-get is a frontend to dpkg and is probably the most packaging command for
debian users. It finds out exactly what the dependencies are, fetches them and
installs them

Options of apt-get that I use:

Install a package and its dependencies - apt-get install {packagename}
Remove a package and its dependents - apt-get remove {packagename}
Update the list of packages - apt-get update
Upgrade the package list - apt-get upgrade
Get the source of package - apt-get source {packagename}

apt-cache

apt-cache is mostly a add-on to help you find new packages :)

Options of apt-cache that I use:

Find all the packages which have {keyword} in name/description - apt-cache search "{keyword}"

apt-cache showpkg {packagename} - same as dpkg -s

apt-file

apt-file is a nifty command to find out which package a file belongs to

This was covered a few days back - here

synaptic

Okay, don't like command line? synaptic is a graphical interface for doing all the above :)

Please Note that you will need root access to most of the above commands except for ones where you just check status, etc.

Thursday, December 21, 2006

Search package by the filename

Install apt-file using the following command

sudo apt-get install apt-file

Update the required files for apt-file using

sudo apt-file update

To search for a particular file and its related package

Use

apt-file search libtermcap.so