Install specific packages
Install package groups
Remove orphan packages
Equivalent to the following in Debian or Ubuntu.
Listing real orphans - packages that were installed as dependencies but are no longer required by any installed package.
Listing explicitly installed packages which are not required by any other package.
NOTE: pacman output -> /var/log/pacman.log
Querying the Package Databases
Local package database -> -Q
Sync package databases -> -S
Pacman can search for packages in the database, searching both in packages' names and descriptions:
Backing up and retrieving a list of installed packages
1. backup the current list of non-local packages
2. Store the pkglist.txt on a USB key or other convenient medium or gist.github.com or Evernote, Dropbox, etc
3. Copy the pkglist.txt file to the new installation, and navigate to the directory containing it
4. Issue the following command to install from the backup list
In the case you have a list which was not generated like mentioned above, there may be foreign packages in it (i.e. packages not belonging to any repos you have configured, or packages from the AUR).
In such a case, you may still want to install all available packages from that list
- pacman -Slq lists all available softwares, but the list is sorted by repository first, hence the sort command
- Sorted files are required in order to make the comm command work
- The -12 parameter display lines common to both entries
- The --needed switch is used to skip already installed packages.
You may also try to install all unavailable packages (those not in the repos) from the AUR using yaourt (not recommended unless you know exactly what you are doing)
Finally, you may want to remove all the packages on your system that are not mentioned in the list.
Warning: Use this command wisely, and always check the result prompted by pacman.
Cleaning the package cache
NOTE: The paccache command, provided by the pacman package itself, by default deletes all the cached versions of each package except for the most recent 3: paccache -r
Download a package without installing it
Install a local package
Tip: To keep a copy of the local package in pacman's cache, use the 2nd.
Listing installed packages with version
Get the list of installed packages with their version, which is useful when reporting bugs or discussing installed packages.
Removing orphaned packages
For recursively removing orphans and their configuration files
If no orphans were found, pacman errors with error: no targets specified. This is expected as no arguments were passed to pacman -Rns.
Listing changed configuration files
If you want to backup your system configuration files you could copy all files in /etc/, but usually you are only interested in the files that you have changed.
In this case you want to list those changed configuration files, we can do this with the following command
As of version 4.1, Pacman has a color option. Uncomment the "Color" line in pacman.conf.
Save and run pacman -Syu