Dependencies not getting removed automatically with Yay

$yay -Rdnss dotnet-host
error: failed to prepare transaction (could not satisfy dependencies)
checking dependencies…
:: removing dotnet-host breaks dependency ‘dotnet-host’ required by dotnet-runtime-6.0
→ exit status 1
somewhere from here i picked up this switch when removing a package. It does not remove the runtime above. I have not paid attention before but i dont want to do anything with dotnet now. how can i achieve it.

EDIT: I know i can chain both the packages in one line or remove runtime first and then the host. however, that is not the point.

I am not sure what you are trying to do with this command.

If you want to remove something and everything that depends on it too, you use yay -Rc dotnet-host

Just be careful to thoroughly review the package list to be removed first.

2 Likes

i think i picked it up because i want to try to bring the system to the original state before the package was installed. assumed that all the configuration files installed will be deleted :frowning:

If you are trying to remove a package and everything that it depends on, you can use something like yay -Runs dotnet-host.

Either way, the ‘n’ only stops the saving of pacsave files that are in the backup array which is usually nothing for most packages.

2 Likes

superb dalto, Runs is easy to remember, but i need to first get out from the bad habit of Rdnss

@dalto
Main problem here is that if you use yay while saying yes to “Remove build dependencies?”
if build fails, very annoyingly it doesn’t remove those dependencies…only on successful build it does.

may be i did not understand correctly. here something is already installed which is dotnet-runtime-6.0 and there is no question of build failure. However PHP is in the pacman ignore list because latest build failed for it. hope i am making some sense here.

Here is the reverse dependency tree of dotnet-runtime-6.0.

├─aspnet-runtime-6.0
│ └─emby-server
├─dotnet-sdk-6.0
│ └─openra
└─emby-server

Do you have any of these installed?

Lately, I’ve been removing packages simply by running

sudo pacman -R package_name

And then I cleanup unnecessary dependencies (orphans) by running

yay -Yc

Yes, it’s two steps, but I find it easier. I don’t use many AUR packages so removing build dependencies is okay for me. Anything I really don’t want removed, I mark as explicitly installed.

1 Like

nope

$yay -Runs emby-server openra
[sudo] password for pannet1: 
error: target not found: emby-server
error: target not found: openra
 -> exit status 1

will

yay -R package_name && yay -Yc 

work

EDIT: doesn’t work

🐍$yay -R gimp && yay -Yc
checking dependencies...
:: removing gimp breaks dependency 'gimp' required by gimp-plugin-contrastfix
:: removing gimp breaks dependency 'gimp' required by gimp-plugin-layer-via-copy-cut
:: removing gimp breaks dependency 'gimp' required by gimp-plugin-place-layer-into-selection
:: removing gimp breaks dependency 'gimp>=2.3' required by gimp-plugin-saveforweb
error: failed to prepare transaction (could not satisfy dependencies)
 -> exit status 1

improvising

 🐍$yay -Runsc gimp
checking dependencies...
:: imagemagick optionally requires libraw: DNG support
:: libjxl optionally requires gimp: for gimp plugin
:: Do you want to remove these packages? [Y/n] 
Package (13)                            Old Version   Net Change 

babl                                    0.1.106-1       -2.04 MiB
gegl                                    0.4.44-3       -14.90 MiB
gimp-plugin-contrastfix                 1.0-2           -0.01 MiB
gimp-plugin-layer-via-copy-cut          1.6-2           -0.01 MiB
gimp-plugin-place-layer-into-selection  1.0-2           -0.01 MiB
gimp-plugin-saveforweb                  0.29.3-3        -0.12 MiB
lensfun                                 1:0.3.3-2       -3.72 MiB
libmypaint                              1.6.1-1         -1.09 MiB
libraw                                  0.21.1-2        -2.67 MiB
libspiro                                1:20221101-1    -0.04 MiB
mypaint-brushes1                        1.3.1-1         -2.32 MiB
suitesparse                             7.0.1-2       -168.34 MiB
gimp                                    2.10.34-2     -112.64 MiB

Total Removed Size:  307.91 MiB

This is an unbelievably dangerous combination. Don’t just combine all the letters without thinking through the implications.

You need to think about the direction of dependencies you want to remove.

  • If you want to remove something and everything that depends on it too, you use yay -Rc packagename
  • If you are trying to remove a package and everything that it depends on, you can use something like yay -Rus dotnet-host.

You can add -n to either command if you prefer that but it doesn’t do much in practice.

thanks dalto, for the wisdom, as always :bowing_man: