pacman -Ss: searching for a package
To search the repositories, run pacman -Ss <pattern>. It matches the pattern against package names and descriptions, and it needs no root because it only reads the databases already on the machine.
pacman -Ss <pattern>
-S- --sync — install packages from the repositories and upgrade the system
-s- --search — search the repositories for packages matching the patterns
Runs without root.
What it does. Search the repositories for packages whose name or description matches the pattern.
Watch out. Read-only: searching needs no root, and none of the three search commands changes anything.
Searching for a file rather than a package is a fourth question with its own answers, laid out on the file ownership page.
Three searches that are easy to confuse
They answer different questions, which is why one of them keeps coming back empty for people expecting another:
| Command | Searches | Answers |
|---|---|---|
pacman -Ss <pattern> | The repository databases | What could I install that matches this? |
pacman -Qs <pattern> | The local database | What have I already installed that matches this? |
pacman -F <filename> | The file databases | Which package would give me this file? |
Reading the output
Each hit is two lines: a header line and an indented description.
<repository>/<name> <version> [installed]
<description>The repository name in front tells you where it would come from. The [installed] marker only appears for packages already on the machine.
To get names only — for piping into something else — add q:
pacman -Ssq <pattern>The pattern is a regular expression
The pattern is matched as a regular expression, not as a literal string, so anchors work and a stray dot matches any character:
| Pattern | Matches |
|---|---|
pacman -Ss ^vim | Names and descriptions beginning with vim |
pacman -Ss '^vim$' | Exactly that word, quoted so the shell leaves it alone |
pacman -Ss image viewer | Entries matching both patterns, because several patterns narrow the result rather than widening it |
-F: searching for a file, not a package
The file databases are separate from the package databases and are not
downloaded by default, so the first -F search on a machine usually returns nothing
until they are fetched:
sudo pacman -FyDownloads the file databases. Needs root because it writes them, but nothing is installed.
pacman -F <filename>Once they are in place, -F answers the question that comes up whenever a script
fails on a missing command: which package would provide it. For a file already on
the machine, the question is the other way round and the answer is
pacman -Qo.
Looking at one package in detail
| Command | Reads | Works for |
|---|---|---|
pacman -Si <package> | The repository database | Any package in the repositories, installed or not |
pacman -Qi <package> | The local database | Only packages already installed |
Common questions
How do I search for a package in Arch?
Run pacman -Ss followed by a pattern. It searches the names and descriptions in the repository databases and prints each match as a header line and an indented description.
Why does pacman -F find nothing?
The file databases are separate and are not downloaded by default. Run sudo pacman -Fy once to fetch them, then -F searches work.
What is the difference between -Ss and -Qs?
-Ss searches the repositories, so it finds packages you could install. -Qs searches the local database, so it finds packages that are already installed.