DEV Community


How to use Pacman

Software Engineer | Linux fan | lawyer | Sharing what I'm learning 😊
・1 min read

Good morning! One of the first differences you will notice after switching to Arch Linux is pacman, the package manager. To install a package you simply write pacman -S packagename in the console. And don't forget to also always keep your system up to date with the command pacman -Syu. Never do partial updates, because this may break your system.

To remove a package, leaving its dependencies installed, use pacman -R pkgname and if you want to delete the dependencies which are not required by other packages as well, type pacman -Rs pkgname. Sometimes you probably want to install packages from the AUR (Arch user repository). To do this, you need to:

  1. Git clone the URL
  2. cd into the directory of the package (normally simply cd and then the name of the package)
  3. Build the package with makepkg -si. The flag -s installs the needed dependencies, the -i installs the package.
  4. You can run the package by typing its name.

Which pacman commands do you find useful? Have a nice day. :)

Discussion (0)