Skip to content

Instantly share code, notes, and snippets.

@tmcolby
Created April 26, 2019 14:35
Show Gist options
  • Save tmcolby/a97d03838efe388669f68610bdbc4da3 to your computer and use it in GitHub Desktop.
Save tmcolby/a97d03838efe388669f68610bdbc4da3 to your computer and use it in GitHub Desktop.
arch linux pacman commands
To update the system
sudo pacman -Syu
Update the database:
sudo pacman -Syy
Installing
To install a package (always run pacman -Syu, before installing):
sudo pacman -S package_name
To install a local package, or from a website:
sudo pacman -U /path/to/the/package
To re-install all packages (those from the repo’s), in case of emergency:
sudo pacman -Sy $(pacman -Q | cut -d " " -f1 | grep -v "$(pacman -Qm | cut -d " " -f1)")
Removing Packages
If you want to only remove the package, the following command is sufficient:
sudo pacman -R
To remove the package and those of its dependencies that aren’t needed by any other application, do
sudo pacman -Rs
Finally, to remove the package, avoid orphaned dependencies and erase its global configuration, type
sudo pacman -Rns package_name
Searches/Queries
Info about an installed package:
pacman -Qi package_name
Queries the repo about a package:
pacman -Ss package_name
Queries the repo about a packages, and all that depend on it:
pacman -Sii package_nam
which in most cases is the proper command to remove software.
@tmcolby
Copy link
Author

tmcolby commented Jan 17, 2022

often its best to run pacman -S archlinux-keyring before doing a system upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment