You also can read compressed dpkg logs using the zgrep command instead of grep, as shown in the example below. If you want to display information on upgraded packages only, you can achieve it using the command below.
As explained previously, with installed packages, you also can check compressed logs for upgraded packages using the wildcard, as shown in the following example.
As you can see, Debian-based Linux distributions offer various ways to check a specific package status or list all installed, upgraded and removed packages.
Commands explained in this tutorial are easy to apply and learning them is mandatory for any Debian-based distribution user. As you saw, these commands can also provide information on software versions, needed disk space, and more. You can get additional tips to list packages information with the tutorial See dpkg and apt history. I hope this tutorial explaining how to check if a package is installed on Debian or Ubuntu was useful. Now I can see the full version number, which is 0.
I get the feeling that this is not the proper way to find the version number of an installed package. This never really was a problem in the past, but with the tacking on of "ubuntu" in the versions and the proliferation of PPAs these strings are getting longer and longer.
Is there an easier way? It's not using the dpkg command but apt-show-versions. I think aneeshep's is the best answer as your question specifies using dpkg. But for completeness sake, here's another way:. This standard output was fed as input to the awk command. And finally prints the value of column 3 which was actually represents the package version.
According to the above, column 2 represents the package name , column 3 represents the package version , column 4 represents the architecture and column 5 represents package description. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How can I find the version number of an installed package via dpkg? Ask Question.
Asked 10 years, 11 months ago. Active 10 months ago. Viewed k times. If your system lacks a prerequisite package or if the specified package conflicts with a package installed on your system, dpkg will report the error and terminate. If the problem is the lack of one or more prerequisite packages, you can obtain and install them, and then install the desired package. If the problem is a package conflict, you must decide which of the conflicting packages you want. If you decide to remove an installed package, you can do so using the technique described in the following subsection.
This command does not remove package configuration files, which may facilitate subsequent re-installation of the package. If you want to remove the configuration files as well, use the command:. The Debian package management facility maintains a database that contains information about installed packages. You can use the dpkg command to query this database. For example, to print the description of the package gnome-guile , issue the command:. Only packages with names matching the pattern will be listed.
Indicates the selection status established using dselect , which may be any one of:. Indicates that the selection status is not known.
Indicates that the package is marked for installation. Indicates that the package is marked for removal. Indicates that the package and its configuration files are marked for removal. Indicates that the package has not been installed. Indicates that the package has been successfully installed.
Indicates that only the package's configuration files are currently installed.
0コメント