Installing packages

In arch, installing packages involves "synchronising" with the remote package database. To do this, we use the -S option for pacman.

Finding a package

sudo pacman -Ss searches the package names and descriptions for your given search string.

~ > sudo pacman -Ss thunar   
extra/thunar 1.8.15-1 (xfce4) [installed]
    Modern file manager for Xfce
extra/thunar-archive-plugin 0.4.0-3 (xfce4-goodies)
    Create and extract archives in Thunar
extra/thunar-media-tags-plugin 0.3.0-2 (xfce4-goodies)
    Adds special features for media files to the Thunar File Manager
extra/thunar-volman 0.9.5-3 (xfce4)
    Automatic management of removeable devices in Thunar

Installing a package

Once you've found a package, just use sudo pacman -S to install it.

~ > sudo pacman -S thunar-volman
resolving dependencies...
looking for conflicting packages...

Packages (1) thunar-volman-0.9.5-3

Total Download Size:   0.13 MiB
Total Installed Size:  0.66 MiB

:: Proceed with installation? [Y/n]

Installing packages from the AUR

I use yay (installed from Github) to interface with the AUR which lets me install community packages like 1Password. yay has the same interface as pacman, but you don't run it with sudo which can be extremely convenient if you just want to search for files. For example, to install 1Password:

yay -S 1password

Complicated installations using yay

Sometimes you need to do something complicated with yay. For example, I had to install pianoteq-stage but needed to download the file first from the publisher (as I had to buy a licence). The PKGBUILD file sourced a local file but this wasn't working, so I needed to update the location before the package was installed. To do this, I ran yay as:

yay --editmenu -S pianoteq-stage

This allowed me the option of modifying the PKGBUILD just before installation, so I updated the source from local://pianoteq-stage-v720.7z to file:///home/gideon/Downloads/pianoteq-stage-v720.7z.

Upgrading

You can refresh the repositories using pacman -Sy, but the Arch Wiki recommends that you do not update the repositories without also upgrading all packages because otherwise you will have packages installed from one revision of the repo and packages installed from another which might cause compatibility issues. Therefore one should regularly run sudo pacman -Syu to upgrade all packages across the system. Running this often means you're less likely to encounter problems. The nice thing about yay is that it provides an interface to pacman as well, so I use the following to upgrade everything at once:

yay -Syu

Removing packages