Is there any type of cleanup to do after a broken install

When you install something from the AUR with yay this is what happens:

yay downloads the PKGBUILD file (a script containing the instructions how to make a package), and the source (either code, or compiled binaries) to ~/.cache/yay. Everything is download there, nothing is installed on your system. Then it checks whether there are any build dependencies, packages necessary to build the package you’re installing. If there are, it installs them, normally.

It then runs the script locally to build a package, the result of which is an archive with an extension .zst. Then this package is installed normally on the system. If there are dependencies for this new package, they are also installed, if not already present on the system.

So, if a package wasn’t built successfully, depending on the point where the build failed, there could be remnants of its build in ~/.cache/yay. You can go in there manually and remove what you don’t want. There could also be unnecessary build dependencies installed, they will be listed as orphans in the printout of pacman -Qdt, and you can remove them with yay -Yc.

1 Like