Mar 8 2025

pacman upgrade packages in ArchLinux

pacman upgrade packages in ArchLinux
sudo pacman -Syu
-S – Synchronizes packages
-y – Refreshes the package database
-u – Upgrades all installed packages

Remove a package (keep dependencies)
sudo pacman -R package_name

Remove a package and unneeded dependencies
sudo pacman -Rns package_name

Remove orphaned packages (unneeded dependencies)
sudo pacman -Rns $(pacman -Qdtq)

Remove a package and ignore dependencies
sudo pacman -Rdd package_name

Remove a package and its cache (free up disk space)
sudo pacman -R package_name && sudo pacman -Sc

For a more aggressive cleanup, remove all cached package files:
sudo pacman -R package_name && sudo pacman -Scc

To install packages from a previously saved list of packages, while not reinstalling previously installed packages that are already up-to-date, run:
pacman -S --needed - < pkglist.txt

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.