A Failed Gentoo Update: Slot Conflicts
- posted:
2021-04-10
I had some time today to update the system for one of my Gentoo machines, whose last update was about seven months ago. After running the command emerge --sync to refresh the local repository, it told me to upgrade the pacakge "sys-apps/portage" first. However, when I tried to do so, I ran into some errors:
# emerge --oneshot sys-apps/portage !!! Multiple package instances within a single package slot have been pulled !!! into the dependency graph, resulting in a slot conflict: ...
This issue occurs because attempts to upgrade single packages will often trigger conflicts. Let's say the package that needs to be upgraded is A, which requires C version 2, but another package that is already installed on the system is B, which depends on C version 1. If attempting to upgrade only A, emerge will detect a slot conflict between the requried versions of C, resulting in an error like the one shown above. Therefore, Gentoo officially recommends to update all packages together (after each emerge --sync operation), using a command such as emerge --deep --newuse --update @world [1].
What if I really want to upgrade just a single package? The solution, mentioned in Gentoo Wiki [2], is to first rebuild B against C version 2, and then upgrade A:
# emerge --ask --oneshot =<PACKAGE C V2> <PACKAGE B> # emerge --ask <PACKAGE A>
However, things can get more complicated if similar conflicts occur while rebuilding B with C version 2. In such case, use the option --nodeps to bypass dependency checks:
# emerge --ask --oneshot --nodeps =<PACKAGE C V2> <PACKAGE B> # emerge --ask <PACKAGE A>
In conclusion, even though slot conflicts can sometimes be worked around, it's still recommended to perform a full @world set upgrade whenever possible.
Thanks for reading :)