The Beginner Guide to Pacman

One of the most important things to now as a Linux user is the package manager of your distro. For Arch this is Pacman. It's an easy way to install and remove software, without having to download installers. In this guide I am going to show you, how to use Pacman as a complete beginner.


How does Pacman work?

You can install packages from the official repository with pacman. It automatically downloads and builds these packages. There's also a repository that's managed by the community, called the AUR. On there you can find a LOT of software that's not on the official repo. To install packages from the AUR though, you'll have to use an AUR helper like yay or paru.

How to use pacman

Installing packages

Installing software with pacman is pretty easy. Just type:

$ sudo pacman -S firefox
Install firefox with pacman

It is also possible to install multiple packages at once.

$ sudo pacman -S nvim code firefox
Install neovim VSCode and firefox with pacman

Removing packages

Removing a package is as simple as installing it.

$ sudo pacman -R vim
# You can remove multiple packages at once too
$ sudo pacman -R vim nvim
How to remove packages with pacman

If you want to also remove its dependencies that are no longer requiered by any other package:

$ sudo pacman -Rs vim
Remove package and its dependencies with pacman

Pacman saves important configuration of an application by default as .pacsafe, to skip this for a package use the -n flag.

$ sudo pacman -Rn vim
# Or to also remove the unused dependencies
# (Recommended)
$ sudo pacman -Rns code
Skip configuration backup by pacman

Upgrading packages

Arch only supports full system upgrades, to do these run:

$ sudo pacman -Syu
Do a system update with pacman

Conclusion

In this guide I showed you how to install and remove packages and how to do a full system upgrade.

If I have helped you, consider signing up for free to get access to all my guides and my newsletter.

💪
Consider signing up for free to get access to all my guides and my newsletter
Show Comments