Debian / Ubuntu package Management

You can search for a package by packagename or a word within the package description:
apt-cache search apache2
apt-cache search "Apache "

You can also search by a file that is within the package:
apt-file search apache2.conf

Show package information:
apt-cache show apache2
apt-cache showpkg apache2

List files in a package:
apt-file list apache2 | less

List dependent packages:
apt-cache depends apache2

Check if package installed:
dpkg -l | grep -i apache

Install Package:
sudo apt-get install apache2

Delete Package:
sudo apt-get purge apache2
sudo apt-get remove apache2

Upgrade a Package:
sudo apt-get -u install apache2

Upgrade all Packages:
sudo apt-get -u upgrade

If the package isn’t available from the package manager, download the .deb and:
sudo dpkg -i package_file.deb

To remove:
sudo dpkg -r package_name

You can leave a response, or trackback from your own site.

Leave a Reply