TOTAL
Since dec 2006
1'942'871 Visitors
4'218'042 Pages

Nov 2010 Stats
82'909 Visitors
146'476 Pages
196 countries
Full statistics



Help us translate
our tutorials!

JOIN the
OpenManiak Team.
OM TEAM
Director:
Blaise Carrera
Tutorials creation:
Blaise Carrera
Translaters:
Giovanni Fredducci
Angel Chraniotis
Moham. H. Karvan
Alexandro Silva
Blaise Carrera
Andrei Chertolyas
Sergiy Uvarov
Nickola Kolev
Łukasz Nowatkowski
Ivo Raisr
Catalin Bivolaru
Bogdan A. Costea
Kirill Simonov
Oliver Mucafir
JaeYoung Jeon
Seungyoon Lee
Jie Yu & Si Cheng
Tao Wei
YukiAlex
Fumihito Yoshida
Muhammad Takdir
Çağdaş Tülek
Auditors
Leslie Luthi
Joe Anderson
Jennifer Ockwell
Nigel Titley
Alison Rees
Sabrina Barbey
Webmaster:
Blaise Carrera
OpenManiak.com - The APT tools

OS APT
Last Change : Aug 21 2009 french flagenglish flag




If you like our tutorials, don't hesitate to support us and visit our sponsors!
Si vous aimez nos tutoriaux, n'hésitez pas à nous supporter et visiter nos sponsors!


The APT tools are a very powerful package management system. They are available on the Debian Linux and Debian-like linux such as Ubuntu.

In the old linux days, 15 years ago, people had to compile their softwares before installing them with the three famous commands, "./configure", "make" and "make install".
See below for more details.

This way of doing was (is) a bit complex for beginners and was (is) more used by administrators or experts. To make things simpler, packages were created and stored in directories called repositories. Packages are compiled software ready to be installed. They have the deb file extension. To manage these packages, the dpkg tool was created. The APT (Advanced Packaging Tool) tools based on the dpkg tool were then created because dpkg did not support dependency management and was not able to install packages directly from a repository via ftp or http.
the APT tools can:

- install/remove/update package with apt-get
- manage the dependencies with apt-get
- querying packages and repositories with apt-cache

(see below for more details)

In this page, we will give commands as if you didn't have any graphical interface but it is important to say that you could use one without any problem to manage the apt Tools. For example, with the Ubuntu Gnome graphical interface, Navigate to: System -> Administration -> Software Properties.

Let's take a look at the different package categories. It is recommended to use Debian package on Debian and Ubuntu packages on Ubuntu. You may experience compatibility problems if you don't use a package on its corresponding system.

1. Debian packages

As you can see on the Debian package website, there are several ways to search for a package. You can search by "distribution" for package stability or by "sections" for licensing type. Click on the column titles to get details.

Stability :
- Stable
- Unstable
- Testing
License:
- Main
- Non-free
- Contrib
2. Ubuntu packages

On the Ubuntu package website, you can search packages by Ubuntu version (distribution), by licensing type (section) or by type of package. Click on the column titles to get details.

Release:
- Warty
- Hoary
- Hoary-backports
- Breezy
- Breezy-backports
- Dapper
- Edgy
License:
- Main
- Restricted
- Universe
- Multiverse
 
 
 
package type:
- Main-distribution
- Updates
- Backports
- Security
 
 
 
For more details about the software management under Ubuntu, have a look at the Ubuntu community documentation.

For Ubuntu and Debian, the apt repository configuration can be seen in the /etc/apt/sources.list file.

There is a funny tool called vrms that checks whether or not your system is using "non-free" packages by reading the /var/lib/dpkg/status file.
Check the Free Software Foundation for more details about what is considered as "free software".

# apt-get install vrms
# vrms
These 2 commands will install and launch vrms.



COMPILING SOFTWARES

When there is no package available for a software, or if you want to compile it yourself, you have to proceed in three steps:

- ./configure
 
 
Checks the software requirements like dependencies (libraries required to use the software), then to prepare the compilation, takes its instructions in Makefile.ini and builds the Makefile file.
- make Compiles the software and hence create a binary files
- make install
 
 
Copies the binary files to the appropriate directories, it needs to be runned with super-user powers.
Compiling softwares will require some tools included the famous gcc compiler. The simplest way to get these tools is to use ... atp-get and the metapackage (group of packages) build-essential.

#apt-get install build-essential
Be very careful when compiling your softwares because you have to manage dependencies by yourself.



APT TOOLS USEFUL COMMANDS:

#apt-get --help Give help about the apt-get command.
#apt-get update Update the packages repositories.
#apt-get install ... Install the package(s) and the dependencies.
#apt-get remove ... Remove the no longer used package and dependencies.
#apt-get upgrade Upgrade the packages if new packages are available.
#apt-get dist-upgrade Upgrade your OS to a new version.
#apt-get search ... Search for packages inside the repositories.
#apt-cache depends ... Show the dependencies for a package.
#apt-cache show ... Details about a package.
#apt-cache policy ... Details about the versions of your installed packages.
#apt-get -f install Install missing dependencies.
History of the packages management:

#cat /var/log/dpkg.log | less
If you are behind a firewall and go to the internet trough a proxy, use the following command:

#export "http_proxy=http://login:password@proxy_address:proxy_port"





If you liked our tutorials, don't hesitate to support us and visit our sponsors!
Si vous aimez nos tutoriaux, n'hésitez pas à nous supporter et visiter nos sponsors!