Default command line way to install,remove,list packages

No, pacman can do that, as well as add and remove software.


Welcome aboard!

@alaindevos I am going to move this on over to the new users section. There is more traffic there :hugs:


Hi and welcome!

option -Ss ( in the repos )
option -Qs ( in local/cache repos , installed )

Welcome, take your time to learn pacman - it’s best thing happened to cli package managers :star_struck:

Some pacman options worth remembering

Options What it does
-Syu perform a full update (you should use this when updating).
-Syyu force download of package database and then update. This is typically only necessary after changing your mirror list.
-Syuu will perform a full update, allowing downgrade of packages (use only when the update announcement tells you to, or when you’re trying to fix some problem and know what you’re doing). There is also -Syyuu
-Syuw download the packages to make them ready to update, but do not perform the update. Useful when you’re having a bad internet connection, or want to do download the packages before updating in the TTY. After, use -Su to apply the updates.
-Sy or -Syy This only refreshes the local package database, without downloading and installing the updates, and it’s generally a bad idea to use -Sy or -Syy alone, without u. That can cause you quite a bit of trouble with partial upgrades. Another way the database can get refreshed without updating is when you answer n after running pacman -Syu. This is equally bad. For checking whether there are any updates available, use checkupdates command.
-S package_name install the package from the repos. It’s a good idea to do an update before installing new packages.
-U path/to/package install the package from a file.
-R package_name uninstall the package, but leave dependencies.
-Rns package_name uninstall the package, and its dependencies. This is what I typically use for uninstalling programs.
-Rcns package_name uninstall the package and remove dependencies and remove all packages that depend on that package, and most of the config files (might remove more than you want to, use with caution).
-Sc clear the pacman cache for packages that are no longer installed.
-Scc clear the pacman cache (use only if you’re desperate for disk space, because you won’t be able to downgrade packages).
-Ss package_name search the repos for the package (won’t make any changes to your computer)
-Q list all installed packages.
-Qe list only the packages you explicitly installed.
-Q package_name check whether this package is installed. If you don’t know the exact name of the package, a good tip is `pacman -Q
-Qi package_name print some info about the installed package.
-Qm list foreign packages (those installed from files, including those from the AUR).
-Qn list packages installed from the repos.
-Si package_name print some info about the package in the repos.
-Ql package_name list all the files owned by the package
-Fx path/to/file discover which package owns the file
-Qdtq list orphaned packages (you can remove them using -R, but keep in mind, just because a package is orphaned, doesn’t mean it is not useful: remove only those you do not need).

I think those are pretty much all of the everyday useful options. There are many more options, but an average user will probably not need them often enough that they are worth remembering. When needed, you can just read the manual: man pacman.


welcome skipper, hoist your sails and stick your nose to the wind!

1 Like

-Sc clears the cache from the packages that are no longer installed


clears the whole cache


Most used also another distro to understand is also this usefull


Thanks, fixed. :+1:


Welcome to the community :beers:

Better than ‘man pacman’ :hugs: :smiling_face_with_three_hearts:


So this is correct? -Scc clear the pacman cache (use only if you’re desperate for disk space, because you won’t be able to downgrade packages).

Thank you!

1 Like

Yes. See the post above. Typically using -Sc is safe, as you don’t need those packages in the cache, but you typically want to preserve the cache for packages you have on your system, just so you can easily downgrade them if an update breaks them. But if you need disk space, you can clear the entire cache, it’s not a big deal.


Yes. It will clear out the whole cache. Pass the -c only once and it will clear out only the packages in cache that no longer are installed in the system.

Edit: have a look at paccache. It will give a little more fine-grained control:


Apart from being able to get them from :wink:


Thanks Everyone! :+1:t3:

1 Like

There is also paccache.timer that can be enabled which triggers paccache.service on a weekly basis. It will then run/usr/bin/paccache -r that is it “deletes all cached versions of installed and uninstalled packages, except for the most recent 3”. One can modify the command line used to suit one’s needs.


Yes, and it’s already installed on EndeavourOS by default (part of the pacman-contrib package), but has to be manually started and enabled:

systemctl start paccache.timer
systemctl enable paccache.timer

I think it’s a good idea to do so, then you can forget about clearing the pacman cache.