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
- 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
May be interested
- How to fix 'apt-get: command not found' error in Linux Terminalif you want to install software on a debian-based linux distribution, apt-get is a reliable terminal command. however, sometimes you may get stuck with 'command not found' error as response.
- 20+ essential Linux security commandshere are some of the most important security commands for everyday work on linux systems. if you're interested in security issues on your linux system, don't ignore these helpful security commands.
- Instructions for using find command in Linuxthe find command is one of the most important and handy commands on a linux system. as its name suggests, the command can find files on a linux pc based on a variety of conditions and variables you set.
- How to use the stat command on Linuxthe linux stat command shows you more details than the ls command. the following article will show you how to use the stat command in linux. like ls, the stat command has many options. this makes it a great candidate for the use of alias.
- 14 interesting Linux commands in Terminalterminal is a very powerful tool, but it can become 'interesting' through a few bash commands that quantrimang will introduce to you later. let's follow up and find out because some commands are quite useful.
- Basic Linux commands everyone needs to knowwhen using linux, you should also learn basic linux commands to make operations quicker and easier. here are some basic commands on linux you should know.
- 18 Interesting Linux Commands in Terminalterminal is a very powerful tool, but it can be made 'interesting' through a few bash commands that tipsmake.com will introduce to you below. let's follow and learn because some commands are quite useful.
- Notable changes and additions in Debian 11 'Bullseye'debian is one of the oldest, most stable and flexible linux distributions in the free and open source world.
- The Cat command in Linuxthe cat command (short for 'concatenate') is one of the most frequently used commands in operating systems like linux / unix. the cat command allows users to create one or more files, view file contents, join files, and redirect output in a terminal or file.
- How to use the last command in Linuxwant to know who, what time and which device to access your linux computer? please read the following article.