Instructions for using dpkg command on Linux Debian
All Linux distributions come with a specific package manager. For Debian distributions based on Debian, the default package manager is 'apt' or 'apt-get' or the graphics software center. These package managers in turn rely on low-level dpkg tools to manage software packages.
This article will talk about the basics of package management in Debian and how to manage software packages using the dpkg command.
The dpkg command in the Linux distribution is based on Debian
- Learn about package management in Debian
- How to use dpkg command
- How to install software / packages with dpkg command
- List a list of currently installed packages
- Delete installed packages
- List the contents of a package
- Check if the package is installed
- Check the location of the installed package
- Displays detailed information about a package
- Install multiple packages simultaneously
- Extract a deb package
- Re-configure the deb package that has not been packaged
- Need more information about dpkg command?
Learn about package management in Debian
Package management in Debian uses several diverse package management tools - such as 'apt-get', 'aptitude', 'dpkg', 'apt-file', 'dselect', 'tasksel' and 'gdebi' - to manage software on the system. These tools are called package managers. Some, not all, these tools use dpkg low-level tool commands to provide advanced functionality.
The dpkg command allows you to easily install and remove software, as well as manipulate and upgrade the software seamlessly.
How to use dpkg command
How to install software / packages with dpkg command
You can use dpkg to install the software using the following command. This command can also upgrade a package, if it is already installed.
dpkg -i package_name.deb
The above command requires you to have a real .deb file on your computer.
List a list of currently installed packages
To list or display packages currently installed on a Debian-based distribution, you can use the following commands:
dpkg -l search_pattern
If you want to list all installed packages, just skip [search_pattern]:
dpkg -l
Delete installed packages
If you have installed a package but don't use it anymore, you can use the following command to uninstall it. This command removes the entire package, except for configuration files:
dpkg -r package_name.deb
List the contents of a package
You can use the following commands to list the contents of a package on your Linux computer:
dpkg --contents package_name.deb
You can also use -c instead of --contents.
dpkg -c package_name.deb
Check if the package is installed
Assuming you want to check if you have installed a specific package on your computer, use the following command to check:
dpkg -s package_name.deb
Check the location of the installed package
If you just want to find out where the package will be installed, use -L:
dpkg -L package_name.deb
Displays detailed information about a package
This command displays detailed information about a package:
dpkg -p package_name.deb
Install multiple packages simultaneously
If you have some deb files that you want to install, you can run the following command to install them all at once. Note that to do this, you must put all .deb files in the same directory:
dpkg -R --install / deb-files-location /
Extract a deb package
Sometimes you may want to decompress deb package to make changes to its files. Use this command to decompress the deb file:
dpkg --unpack package_name.deb
Configure the deb package that has not been packaged
After you've made changes to the files, use this command to configure and repackage them into a deb file to install:
dpkg --configure pacakge_name
Need more information about dpkg command?
If you want to know more about the dpkg command, you can use the command below. It shows detailed information about commands and dpkg options:
dpkg --help
Most Debian-based package managers rely only on dpkg to get things done. With the above commands, you can learn the basics, when all other installation methods fail.
See more:
- Basic Linux commands everyone needs to know
- Basic Shell commands in Linux
- Kali Linux commands from AZ and commonly used commands
You should read it
- 9 best Debian-based Linux distributions
- 7 best Linux distributions based on Red Hat
- Compare Debian and Ubuntu
- Introducing Kali Linux operating system
- 5 distributions based on the best Arch Linux
- How to Install Debian
- 5 best Ubuntu-based Linux distributions of all time
- The 5 best Linux server distributions
- Compare the most popular Linux distributions today
- How to install Debian on a computer
- How to Restart Debian Using the Command Line
- What is the difference between Linux distributions?
Maybe you are interested
Intel releases new driver update package with 6GHz optimization and many other improvements
Intel releases new Wi-Fi driver update package supporting Wi-Fi 7 for Windows 11 24H2
What is G Suite? Concepts and service packages
Everything you need to know about the DNF package manager
Instructions for canceling Canva package subscription
Instructions for changing application subscription packages on the App Store