The most likely reason you are seeing packages with pacman -Qe
that you don't remember installing is that they were part of a "group" (like base-devel
, etc) that you installed.
Side Note: I have personally also been looking for a while to switch a package from "explicit" to "implicit" (and even vice-versa) without reinstalling it, it even taking a package I installed explicitly to get another package working and turn it into a dependency of that package (again without reinstalling).
No, pacman doesn't remove old packages from your cache (/var/cache/pacman/pkg
) so, over time, it can fill up.
You can adopt two approaches to clearing the cache: the brute force one with pacman -Sc
:
-c, --clean
Remove packages that are no longer installed from the cache as well as currently unused sync databases to free up disk space.
When pacman downloads packages, it saves them in a cache directory. In addition, databases are saved for every sync DB you
download from, and are not deleted even if they are removed from the configuration file pacman.conf(5). Use one --clean switch
to only remove packages that are no longer installed; use two to remove all files from the cache. In both cases, you will have
a yes or no option to remove packages and/or unused downloaded databases.
Or, for a more nuanced approach, you can use one of the utilities that ships with pacman-contrib, paccache
:
paccache is a flexible pacman cache cleaning utility, which has numerous
options to help control how much, and what, is deleted from any directory
containing pacman package tarballs.
By default, paccache -r
will remove all but the last three versions of an installed package, but you can change this number with the -k, --keep
switch. There is also a -d, --dryrun
switch to preview your changes. You can also use the -m, --move <dir>
option to move the packages to a separate directory of your choice. See paccache -h
or paccache --help
for all the switches.
There are a number of utilities in the pacman-contrib package to assist with package management, it is worth looking though them all and gaining an understanding of how they work and can make running Arch much easier. You can see the full list with:
pacman -Ql pacman-contrib | awk -F"[/ ]" '/\/usr\/bin/ {print $NF}'
Best Answer
You can install and use
pacman
but you can't use AUR repo in CentOS 7To install
pacapt
run the following commands: