Skip to content

Instantly share code, notes, and snippets.

@uzluisf
Created June 29, 2017 15:45
Show Gist options
  • Save uzluisf/8fa273dac928b9cd4ee4c4b67d6d47ef to your computer and use it in GitHub Desktop.
Save uzluisf/8fa273dac928b9cd4ee4c4b67d6d47ef to your computer and use it in GitHub Desktop.
A short list of pacman commands

Syncing

pacman -Sy          #sync the database

pacman -Syy         #sync the database even if it's up to date

Updating

pacman -Su          #update installed package
pacman -Syu         #sync the database and then update 
pacman -Syyu        #force sync the database and then update //<i>recommended before any package installation</i>

Installing packages

pacman -S <package>   #install package
pacman -Sw <package>  #download package without installation
pacman -U /package_path/package.pkg.tar.xz #install downloaded or local package //Usually package_path = /var/cache/pacman
pacman -Sg <group>    #search package installed in a group

Removing packages

pacman -R <package>   #remove package
pacman -Rs <package>  #remove package with dependecies that are not being used by another package
pacman -Rsc <package> #remove package with dependecies even if needed by another package //Common sense is advised
pacman -Rn <package>  #remove package and its configuration files
pacman -Rsn <package> #remove package with (self-needed) dependencies and its configuration files

Cleaning packages

pacman -Sc            #leaves packages in cache only for packages currently installed //No possible to downgrade after this
pacman -Scc           #clean cache completely and remove all packages //No possible to downgrade after this
paccache -r           #remove old package cache files but the latest three versions of package either installed or not
paccache -rk n        #keep n latest versions of a package and remove the rest
paccache -ruk0        #remove all cached versions of uninstalled packages

Searching for packages

pacman -Ss <package>  #provide description of searched package and associated package
pacman -Si <package>  #provide detailed summary of package
pacman -Qs <package>  #provide description of previously installed package
pacman -Q             #get a full list of installed packages

For more detailed info, pacman-ArchWiki and Manjaro's pacman tips.

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