0

This question already has an answer here:

Simple Question, I want to check if a specific package = sp, say gparted is installed on Ubuntu 16.04 server.

marked as duplicate by pomsky, Kevin Bowen, DK Bose, karel, N0rbert Aug 10 '18 at 9:04

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Type whereis gparted. – zx485 Aug 9 '18 at 23:25
  • 1
    Or try which gparted! – George Udosen Aug 9 '18 at 23:33
4

Open the terminal and type

apt policy gparted

If there is something next to Installed, it's installed.

gparted:
  Installed: 0.30.0-3ubuntu1
  Candidate: 0.30.0-3ubuntu1
  Version table:
 *** 0.30.0-3ubuntu1 500
        500 ssh://[myserver]/apt-mirror/mirror/us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

If the package exists in the repos your system uses, but is not installed, the output will look like this

ruby:
  Installed: (none)
  Candidate: 1:2.5.1
  Version table:
     1:2.5.1 500
        500 ssh://[myserver]/apt-mirror/mirror/us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

If the package doesn't exist in the repos your system uses, the output will look like this

N: Unable to locate package nosuchapp
3

You can check this using debian package tool, dpkg. This works for all debian packages installed in Ubuntu, whether it is installed via apt repo or installed directly via debian package file.

To check if gparted is installed on your machine, first check if you have the binary, then check which package it came from, then lastly you can check the installation of the package.

$ which gparted
/usr/sbin/gparted

$ dpkg -S /usr/sbin/gparted
gparted: /usr/sbin/gparted

$ dpkg -l gparted
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-===================================================================
ii  gparted                         0.30.0-3ubuntu1      amd64                GNOME partition editor

The ii indicate that the package is installed.

Not the answer you're looking for? Browse other questions tagged or ask your own question.