Check whether a package is installed on your system or not

@Kresimir

Quote:
To check whether a package is installed on your system you can run:

pacman -Q ffmpeg


or, if you’re unsure of the package name:

pacman -Q | grep ffmpeg
 

dalto
* EndeavourOS ships with `base-devel` and `git` installed so you don’t need to install them.

If for example, i want to check if some package is installed or not on my system, for example in this case “base-devel”.
I have tried both your method,

$ pacman -Q "base-devel"
error: package 'base-devel' was not found
$ pacman -Q base-devel
error: package 'base-devel' was not found
$ pacman -Q | grep  base-devel
$ pacman -Q | grep  "base-devel"

I tried the method from internet:

$ pacman -Qs "base-devel"
local/autoconf 2.69-7 (base-devel)
    A GNU tool for automatically configuring source code
local/automake 1.16.2-3 (base-devel)
    A GNU tool for automatically creating Makefiles
local/binutils 2.35-2 (base-devel)
    A set of programs to assemble and manipulate binary and object files
local/bison 3.6.4-1 (base-devel)
    The GNU general-purpose parser generator
local/fakeroot 1.24-2 (base-devel)
    Tool for simulating superuser privileges
local/file 5.39-1 (base-devel)
    File type identification utility
local/findutils 4.7.0-2 (base-devel)
    GNU utilities to locate files
local/flex 2.6.4-3 (base-devel)
    A tool for generating text-scanning programs
local/gawk 5.1.0-1 (base-devel)
    GNU version of awk
local/gcc 10.2.0-3 (base-devel)
    The GNU Compiler Collection - C and C++ frontends
local/gettext 0.21-1 (base-devel)
    GNU internationalization library
local/grep 3.4-1 (base-devel)
    A string search utility
local/groff 1.22.4-3 (base-devel)
    GNU troff text-formatting system
local/gzip 1.10-3 (base-devel)
    GNU compression utility
local/libtool 2.4.6+42+gb88cebd5-14 (base-devel)
    A generic library support script
local/m4 1.4.18-3 (base-devel)
    The GNU macro processor
local/make 4.3-3 (base-devel)
    GNU make utility to maintain groups of programs
local/pacman 5.2.2-1 (base-devel)
    A library-based package manager with dependency support
local/patch 2.7.6-8 (base-devel)
    A utility to apply patch files to original sources
local/pkgconf 1.7.3-1 (base-devel)
    Package compiler and linker metadata toolkit
local/sed 4.8-1 (base-devel)
    GNU stream editor
local/sudo 1.9.3.p1-1 (base-devel)
    Give certain users the ability to run some commands as root
local/texinfo 6.7-3 (base-devel)
    GNU documentation system for on-line information and printed output
local/which 2.21-5 (base-devel)
    A utility to show the full path of commands

Am i wrong that $pacman -Qs is actually query from repo instead of from my os ? What does “local” here means ?

base-devel isn’t a package, it is a group. That is why you can’t find it.

pacman-Qs searches the packages installed on your system.

If you want to see which packages from the base-devel group are installed on your system you can use this command:

pacman -Qg base-devel
5 Likes

base-devel isn’t a single package but rather a group of base packages arch is built on. That is why you see so many packages associated with the term base-devel

3 Likes

Yes, you are wrong. -Q queries installed (local) packages.

If you want to search the repos, use -Ss.

And, as others have already pointed out, base-devel is not a package, it’s a group of packages, that’s why it doesn’t show up when you search for it with -Q (but all 24 packages belonging to it show up on the list).

2 Likes

Why then -Q (which is query for installed packages) found nothing
** i know now you said “base-devel” is a group can’t search this way ** hear me out, please.

$ pacman -Q "base-devel"
error: package 'base-devel' was not found

BUT, -Qs (also query for installed packages) lists out all these installed packages on local machine ?

$ pacman -Qs "base-devel"
local/autoconf 2.69-7 (base-devel)
    A GNU tool for automatically configuring source code
local/automake 1.16.2-3 (base-devel)
    A GNU tool for automatically creating Makefiles
local/binutils 2.35-2 (base-devel)
    A set of programs to assemble and manipulate binary and object files
local/bison 3.6.4-1 (base-devel)
    The GNU general-purpose parser generator
local/fakeroot 1.24-2 (base-devel)
    Tool for simulating superuser privileges
local/file 5.39-1 (base-devel)
    File type identification utility
local/findutils 4.7.0-2 (base-devel)
    GNU utilities to locate files
local/flex 2.6.4-3 (base-devel)
    A tool for generating text-scanning programs
local/gawk 5.1.0-1 (base-devel)
    GNU version of awk
local/gcc 10.2.0-3 (base-devel)
    The GNU Compiler Collection - C and C++ frontends
local/gettext 0.21-1 (base-devel)
    GNU internationalization library
local/grep 3.4-1 (base-devel)
    A string search utility
local/groff 1.22.4-3 (base-devel)
    GNU troff text-formatting system
local/gzip 1.10-3 (base-devel)
    GNU compression utility
local/libtool 2.4.6+42+gb88cebd5-14 (base-devel)
    A generic library support script
local/m4 1.4.18-3 (base-devel)
    The GNU macro processor
local/make 4.3-3 (base-devel)
    GNU make utility to maintain groups of programs
local/pacman 5.2.2-1 (base-devel)
    A library-based package manager with dependency support
local/patch 2.7.6-8 (base-devel)
    A utility to apply patch files to original sources
local/pkgconf 1.7.3-1 (base-devel)
    Package compiler and linker metadata toolkit
local/sed 4.8-1 (base-devel)
    GNU stream editor
local/sudo 1.9.3.p1-1 (base-devel)
    Give certain users the ability to run some commands as root
local/texinfo 6.7-3 (base-devel)
    GNU documentation system for on-line information and printed output
local/which 2.21-5 (base-devel)
    A utility to show the full path of commands
[enos-andrew@enos-andrew-pc ~]$ pacman -Ss "base-devel"
core/autoconf 2.69-7 (base-devel) [installed]
    A GNU tool for automatically configuring source code
core/automake 1.16.2-3 (base-devel) [installed]
    A GNU tool for automatically creating Makefiles
core/binutils 2.35-2 (base-devel) [installed]
    A set of programs to assemble and manipulate binary and object files
core/bison 3.6.4-1 (base-devel) [installed]
    The GNU general-purpose parser generator
core/fakeroot 1.24-2 (base-devel) [installed]
    Tool for simulating superuser privileges
core/file 5.39-1 (base-devel) [installed]
    File type identification utility
core/findutils 4.7.0-2 (base-devel) [installed]
    GNU utilities to locate files
core/flex 2.6.4-3 (base-devel) [installed]
    A tool for generating text-scanning programs
core/gawk 5.1.0-1 (base-devel) [installed]
    GNU version of awk
core/gcc 10.2.0-3 (base-devel) [installed]
    The GNU Compiler Collection - C and C++ frontends
core/gettext 0.21-1 (base-devel) [installed]
    GNU internationalization library
core/grep 3.4-1 (base-devel) [installed]
    A string search utility
core/groff 1.22.4-3 (base-devel) [installed]
    GNU troff text-formatting system
core/gzip 1.10-3 (base-devel) [installed]
    GNU compression utility
core/libtool 2.4.6+42+gb88cebd5-14 (base-devel) [installed]
    A generic library support script
core/m4 1.4.18-3 (base-devel) [installed]
    The GNU macro processor
core/make 4.3-3 (base-devel) [installed]
    GNU make utility to maintain groups of programs
core/pacman 5.2.2-1 (base-devel) [installed]
    A library-based package manager with dependency support
core/patch 2.7.6-8 (base-devel) [installed]
    A utility to apply patch files to original sources
core/pkgconf 1.7.3-1 (base-devel) [installed]
    Package compiler and linker metadata toolkit
core/sed 4.8-1 (base-devel) [installed]
    GNU stream editor
core/sudo 1.9.3.p1-1 (base-devel) [installed]
    Give certain users the ability to run some commands as root
core/texinfo 6.7-3 (base-devel) [installed]
    GNU documentation system for on-line information and printed output
core/which 2.21-5 (base-devel) [installed]
    A utility to show the full path of commands
[enos-andrew@enos-andrew-pc ~]$ pacman -Qs "base-devel"
local/autoconf 2.69-7 (base-devel)
    A GNU tool for automatically configuring source code
local/automake 1.16.2-3 (base-devel)
    A GNU tool for automatically creating Makefiles
local/binutils 2.35-2 (base-devel)
    A set of programs to assemble and manipulate binary and object files
local/bison 3.6.4-1 (base-devel)
    The GNU general-purpose parser generator
local/fakeroot 1.24-2 (base-devel)
    Tool for simulating superuser privileges
local/file 5.39-1 (base-devel)
    File type identification utility
local/findutils 4.7.0-2 (base-devel)
    GNU utilities to locate files
local/flex 2.6.4-3 (base-devel)
    A tool for generating text-scanning programs
local/gawk 5.1.0-1 (base-devel)
    GNU version of awk
local/gcc 10.2.0-3 (base-devel)
    The GNU Compiler Collection - C and C++ frontends
local/gettext 0.21-1 (base-devel)
    GNU internationalization library
local/grep 3.4-1 (base-devel)
    A string search utility
local/groff 1.22.4-3 (base-devel)
    GNU troff text-formatting system
local/gzip 1.10-3 (base-devel)
    GNU compression utility
local/libtool 2.4.6+42+gb88cebd5-14 (base-devel)
    A generic library support script
local/m4 1.4.18-3 (base-devel)
    The GNU macro processor
local/make 4.3-3 (base-devel)
    GNU make utility to maintain groups of programs
local/pacman 5.2.2-1 (base-devel)
    A library-based package manager with dependency support
local/patch 2.7.6-8 (base-devel)
    A utility to apply patch files to original sources
local/pkgconf 1.7.3-1 (base-devel)
    Package compiler and linker metadata toolkit
local/sed 4.8-1 (base-devel)
    GNU stream editor
local/sudo 1.9.3.p1-1 (base-devel)
    Give certain users the ability to run some commands as root
local/texinfo 6.7-3 (base-devel)
    GNU documentation system for on-line information and printed output
local/which 2.21-5 (base-devel)
    A utility to show the full path of commands

man pacman will list all pacman commands and options, with definitions.

4 Likes

Because that only lists packages and base-devel is not a package. Groups are nothing more than a list of packages. Groups don’t get installed, only packages.

Once again, you can use pacman -Qg to see what packages from the groups are installed.

5 Likes
4 Likes

Also:

4 Likes

I see, i might got what you meant.
Are you saying, a group does not have to be installed all altogether, but a few among the “group” could be not yet installed, while other has already installed ?

Yes, that is correct.

2 Likes

When you install a group, all packages within that group get installed (EDIT: you get prompted whether you want to install everything or just some packages), and when you uninstall a group, all packages within that group get uninstalled (again, you get prompted which packages you want to remove). That’s it.

A group is just a shorthand for many packages.

2 Likes

When you install a group, it asks which packages from the group you want to install.

2 Likes

Well, yes, pacman always asks for confirmation.

2 Likes