apt-get - Ubuntu 7.x
Package Files
Ubuntu's package management is derived from the Debian GNU distro.
Package files have a *.deb suffix and are in pre-compiled binary format.
Install a Package
To install the network scanner nmap...
sudo apt-get install nmap
Remove a Package
To remove the nmap package installed in the previous example, type the following:
sudo apt-get remove nmapYou can specify multiple packages to be installed or removed by listing package names separated by spaces.
Upgrade Packages
First, update the package index, which is a database of available packages from the repositories defined in...
/etc/apt/sources.listTo update the local package index with the latest changes made in repositories...sudo apt-get updateThen perform the upgrade...
sudo apt-get upgradeYou can upgrade your entire Ubuntu system from one revision to another using...
sudo apt-get dist-upgradeAfter a fairly considerable amount of time, your computer will be upgraded to the new revision. Typically, some post-upgrade steps would be required as detailed in the upgrade notes for the revision you are upgrading to.
Actions of the apt-get command are logged to....
/var/log/dpkg.logFor further information...
apt-get help
Aptitude
Aptitude is a text-based front-end to the Advanced Packaging Tool (APT) system.
To start...
sudo aptitudeTo install a package, locate the package via the category...
Not Installed PackagesTo remove a package, locate the package via the category...
Installed PackagesTo update the package index, press the u key and you will be prompted to become root to complete the update.
To upgrade packages, perform the update of the package index as detailed above, and then press the U key to mark all packages with updates.
The first column of information displayed in the package list in the top pane, when actually viewing packages lists the current state of the package, and uses the following key to describe the state of the package:
i: Installed package c: Package not installed, but package configuration remains on system p: Purged from system v: Virtual package B: Broken package u: Unpacked files, but package not yet configured C: Half-configured - Configuration failed and requires fix H: Half-installed - Removal failed and requires fix To exit Aptitude, press the q. Other functions are available from the Aptitude menu by pressing the F10 key.
Configuration
Configuration of the APT system repositories is stored in...
/etc/apt/sources.listYou may edit the file to enable or disable repositories.
For example, to disable the requirement of inserting the Ubuntu CD-ROM whenever package operations occur, comment out the appropriate line for the CD-ROM...
# no more prompting for CD-ROM please
# deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Release i386 (20070419.1)]/ feisty main restricted
Extra Repositories
In addition to the officially supported package repositories available for Ubuntu, there exist additional community-maintained repositories. Two of the most popular are the Universe and Multiverse repositories.
By default, the Universe and Multiverse repositories are enabled. To disable, edit...
/etc/apt/sources.list...comment the following lines...
deb http://archive.ubuntu.com/ubuntu feisty universe multiverse
deb-src http://archive.ubuntu.com/ubuntu feisty universe multiverse