Useful commands
apt-cache
- apt-cache search package - search for package in local database
- apt-cache depends package - check package dependencies
- apt-cache rdepends package - check package reverse dependencies
apt-get
- apt-get update - update local package database
- apt-get upgrade - upgrade packages to newest version if available
- apt-get install package - install package
- apt-get install --reinstall package - reinstall package
- apt-get autoclean - remove packages which are not needed anymore
- apt-get clean - remove all downloaded packages from /var/cache/apt/archives
- apt-get remove package - remove package
- apt-get --purge remove package - purge package with configuration files
apt-file
- apt-file search filename - search for filename within local package database
dpkg
- dpkg -l - list all packages
- dpkg -L package - list of files and directories intalled through that package
- dpkg -S filename - search for filename
- dpkg -r package - remove package
- dpkg -P package - purge package with all configuration files
- dpkg -i package - install a package
- dpkg -i --force-all package - use only in critical situations :-)
dpkg vs. rpm
| dpkg | rpm | info |
|---|---|---|
| dpkg -l | rpm -qa | List all installed packages |
| dpkg -L package | rpm -ql package | List all files in a installed package |
| dpkg -i file.deb | rpm -i file.rpm | Install package from a file |
| dpkg -i file.deb | rpm -U file.rpm | Upgrade package from a file |
| dpkg -r package | rpm -e package | Remove installed package |
| dpkg -l file.deb | rpm -qpi file.rpm | Show information about package |
| dpkg -c file.deb | rpm -qpl file.rpm | List files in a package |
| dpkg -p package | rpm -qi package | Show information about a installed package |