Remove Unused Packages (Arch)

To list all packages no longer required as dependencies (orphans):

$ pacman -Qdt

Pacman saves important configuration files when removing certain applications and names them with the extension: .pacsave. To prevent the creation of these backup files use the -n option:

# pacman -Rn <package_name>

Remove all package and all dependencies:

# pacman -Rs <package_name>

If you want to remove package, dependencies and prevent the creation of backup files:

# pacman -Rns <package_name>

Remove all no longer required dependencies (careful!):

# pacman -Rns $(pacman -Qqtd)