Debian - apt-get and apt-cache common operation or usage

Initially there was tar.gz. Packages are distributed through compressed archive. Users will have to de-compress themself then compile it, finally, install it. The famous "configure; make; make install" 3 step. If the installation break the halfway, due to library dependencies, users will have to figure a way to fulfill it. Cross your finger, no more breaks happen after fulfilling the dependencies. Talking about nightmares.

After a while later, Debian come out with a way to manage all these "nightmares". A package system that manages its library dependencies, Advanced Packaging Tools. Since then, installing packages on linux have never been so easy. It not only make installation of packages a fun, but also made patching hassle free. Below are the commonly used operation on apt :

- update the local repositories with lates list of packages
apt-get update

- search for available packages in the repositories
apt-cache search <package glob name>

- get more info on the interested packages
apt-cache showpkg <package name>

- install multiple package at a time
apt-get install <package nam1> <package name2>

- re-configure package options
dpkg-reconfigure <package name>

- un-install packages
apt-get remove <package>

- remove libraries which is not in used by any packages
apt-get autoremove

- remove packages source downloaded during installation
apt-get autoclean

- to make an upgrade all of the packages
apt-get upgrade

- distribution upgrade, e.g. from debian 4 (etch) to debian 5 (lenny)
apt-get dist-upgrade

some notes :
  • apt config files are store at /etc/apt/
  • downloaded packages (from apt-get install operation) are stored at /var/cache/apt/archives

Hasta la vista !!!

No comments: