4 Commands for Checking If a Package is Installed in Ubuntu and Debian

In this article I will show you 4 ways to verify if a package is installed or not, in Debian, Ubuntu, Linux Mint, Knoppix and other Debian Based distros.

1. With aptitute:

$ aptitude show vim | grep -i state
State: installed

2-3. With dpkg:

$ dpkg -s vim | grep -i status
Status: install ok installed

$ dpkg -l | grep vim
ii vim 2:7.3.154+hg~74503f6ee649-2ubuntu3.1 Vi IMproved - enhanced vi editor
ii vim-common 2:7.3.154+hg~74503f6ee649-2ubuntu3.1 Vi IMproved - Common files
ii vim-runtime 2:7.3.154+hg~74503f6ee649-2ubuntu3.1 Vi IMproved - Runtime files
ii vim-tiny 2:7.3.154+hg~74503f6ee649-2ubuntu3.1 Vi IMproved - enhanced vi editor - compact version

4. With Apt package manager:

$ apt-cache policy vim | grep -i installed
Installed: 2:7.3.154+hg~74503f6ee649-2ubuntu3.1

Liked it? Take a second to support Geekster on Patreon!
Tagged with: , , , , , , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Support LinuxG via Patreon
Support LinuxG.net on Patreon!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!