I have been a very lazy computer user and have used far too many AUR packages and the AUR attack really woke me up. CachyOS has been a great distro for me and I should take more care of my systems. I got lucky and I was not hit with any contaminated packages but my behavior had to change.
What I decided to do was to make sure anything that is now in the official repo is installed and the AUR version removed. Then anything that is not available in the official repo is replaced with flatpak version, or appimage if necessary. Not everything I want to use is available in official packages, flatpak, or appimage, but that is not an excuse to be the lazy idiot I was. So read on if you want to break the bad habit too.
Step 1: Run the command âyay -Qmâ. This generates a list of all AUR installed packages. Copy the results to a text file for reference later.
Step 2: run âsudo pacman -Syuâ to make sure you are up to date
Step 3: Run âsudo pacman -Syu APPNAME TO REPLACEâ âAPPNAME TO REPLACEâ is any package name you have in your AUR list that you want to have the official package instead. If it fails because it isnât available then make a note. If it is available then pacman will replace the AUR package with the official package. Do this for each package that you know you need/want until finished.
Step 4: READ ALL BEFORE FOLLOWING THIS STEP! Now that you are sure that you have all packages that you need/want updated to official if possible it is time to wipe out the AUR installations. Run "yay -Rns $(yay -Qmq)" THIS WILL REMOVE ALL AUR PACKAGES AND THEIR SAVED CONFIGURATIONS AND DATA!!! If certain packages will not uninstall due to some dependency then you need to remove the dependent packages first. Note what you have removed so that you can replace them later. Remember this step removes everything related to the AUR packages. Be sure you want to do this.
Step 5: Now it is time to back to the list and search for alternatives to what you still want that canât be found, and/or look for flatpak and appimage versions. There is no guarantee that there will be a replacement for the AUR package you were using.
These instructions donât make you 100% safe, do not make everyone happy, and are only what I did to stop being lazy and exposing myself to this AUR mess.
Not everything you might still want will be available through this process and you might still have to resort to the AUR or compile yourself from source. Think twice if you really need to have that package from the AUR and if you do, make sure you donât blindly install and update without checking the build for problems. This is the way.
Some people do not like FLATPAK. Some people will think that this is too draconian. Some people will still be lazy.