![]() ![]() ![]() To avoid any "failed to execute command" errors when no orphans are found, use the following command for Exec in your hook: /usr/bin/bash -c "/usr/bin/pacman -Qtd || /usr/bin/echo '=> None found.'" The package pacman-log-orphans-hook AUR provides such hook with a more verbose instructions. This can be useful for being notified when a package has been dropped from a repository, since any dropped package will also be orphaned on a local installation (unless it was explicitly installed). ![]() Tip: Add the pacman -Qtd command to a pacman post-transaction hook to be notified if a transaction orphaned a package. The error can be avoided by prefixing the second command with ifne(1) from the moreutils package. This is expected as no arguments were passed to pacman -Rns. If no orphans were found, the output is error: argument '-' specified with empty stdin. They can accumulate on your system over time either due to uninstalling packages using pacman -R package instead of pacman -Rs package, installing packages as makedepends, or packages removing dependencies in newer versions.įor recursively removing orphans and their configuration files: Orphans are packages that were installed as a dependency and are no longer required by any package. Then, when using pacreport -unowned-files as the root user, any unowned files will be listed if the associated package is no longer installed (or if any new files have been created).Īdditionally, aconfmgr ( aconfmgr-git AUR) allows tracking modified and orphaned files using a configuration script. Update-mime-database = usr/share/mime/magic IgnoreUnowned = usr/share/applications/mimeinfo.cacheĬa-certificates = etc/ca-certificates/trust-source/* Pacreport from pacutils can be used to track these files and their associations via /etc/nf (see pacreport(1) § FILES).Īn example may look something like this (abridged): Most systems will slowly collect several ghost files such as state files, logs, indexes, etc. Tracking unowned files created by packages Tip: The lostfiles script performs similar steps, but also includes an extensive blacklist to remove common false positives from the output. # find /etc /usr /opt | LC_ALL=C pacman -Qqo - 2>&1 >&- >/dev/null | cut -d ' ' -f 5. One method is to use pacreport -unowned-files as the root user from pacutils which will list unowned files among other details.Īnother is to list all files of interest and check them against pacman: If your system has stray files not owned by any package (a common case if you do not use the package manager to install software), you may want to find such files in order to clean them up. $ pacman -Qlq package | grep -v '/$' | xargs -r du -h | sort -h This one might come in handy if you have found that a specific package uses a huge amount of space and you want to find out which files make up the most of that. Listing files owned by a package with size The navigational keybindings are the same, although Enter will not work in the same way. $ LC_ALL=C pacman -Qi | awk '/^Name/' -layout=reverse The following command will list all installed packages and their individual sizes: There are two options here: get the size of individual packages, or get the size of packages and their dependencies. List packages by regex with custom output format (needs expac): expac -s "%-30n %v" regex.įiguring out which packages are largest can be useful when trying to free space on your hard drive.List packages by regex: pacman -Qs regex.present in the sync database) that are not direct or optional dependencies: pacman -Qent. List all explicitly installed native packages (i.e.List all native packages (installed from the sync database): pacman -Qn. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |