Cleaning the package cache
Pacman stores its downloaded packages in
/var/cache/pacman/pkg/
and does not remove the old or uninstalled versions automatically. This has some advantages:
1 It allows to
downgradedowngrade a package without the need to retrieve the previous version through other means, such as the
Arch Linux ArchiveArch Linux Archive.
2 A package that has been uninstalled can easily be reinstalled directly from the cache folder, not requiring a new download from the repository.
However, it is necessary to deliberately clean up the cache periodically to prevent the folder to grow indefinitely in size.
https://wiki.archlinux.org/title/Pacman#Cleaning_the_package_cache