FS#5974 - remove unneeded dependencies on upgrade and replace
Attached to Project:
Pacman
Opened by Roman Kyrylych (Romashka) - Sunday, 10 December 2006, 10:25 GMT
Last edited by Roman Kyrylych (Romashka) - Thursday, 15 November 2007, 11:56 GMT
Opened by Roman Kyrylych (Romashka) - Sunday, 10 December 2006, 10:25 GMT
Last edited by Roman Kyrylych (Romashka) - Thursday, 15 November 2007, 11:56 GMT
|
Details
[rk@home local]$ sudo pacman -S gimmix
Targets: confuse-2.5-2 gimmix-0.2-2 Total Package Size: 0.1 MB Proceed with upgrade? [Y/n] :: Retrieving packages from community... confuse-2.5-2 [################] 100% 25K 11.6K/s 00:00:02 gimmix-0.2-2 [################] 100% 44K 3.9K/s 00:00:11 checking package integrity... done. loading package data... done. checking for file conflicts... done. installing confuse... done. installing gimmix... done. Then I updated gimmix to version 0.3 which now doesn't depend on confuse. But on upgrade pacman leaves confuse while it doesn't needed by any other package and was installed only as a dependency. [rk@home local]$ sudo pacman -Su Targets: gimmix-0.3-1 Total Package Size: 0.1 MB Proceed with upgrade? [Y/n] :: Retrieving packages from romashka... gimmix-0.3-1 [/home/rk/packages/] 100% LOCAL checking package integrity... done. loading package data... done. checking for file conflicts... done. upgrading gimmix... done. IMO pacman should remove confuse in this case. It already knows that confuse was installed as a dependency and is not required by any other package. Such new behaviour will help to manage system clean, without useless orphans. |
This task depends upon
And that's because of a bug also reported in a comment here : http://bugs.archlinux.org/task/7495#comment17704
It's fixed in git.
That has nothing to do with this feature request though :)
FS#6057, but then did a search and decided to add another case here.Summary and Info:
When replacing package pacman doesn't remove its dependencies that are not needed by other packages, so orphans are left.
Classic taglib-rcc example. :-P (
FS#6057,FS#6058)taglib-rcc provides and replaces taglib and depends on librcc which depends on enca and librcd.
Install taglib-rcc, then replace it back with taglib.
Pacman doesn't suggest to remove unneeded packages.
So there will be orphaned package (librcc) and its dependencies (librcd and enca, that are not needed by anything except librcc).
Steps to Reproduce:
# pacman -Si taglib-rcc | grep Depends
Depends On : gcc>=4.0.1 zlib bash libxml2 db librcc
# pacman -S taglib-rcc
resolving dependencies... done.
looking for inter-conflicts... :: taglib-rcc conflicts with taglib. Remove taglib? [Y/n]
done.
Remove: taglib
Total Removed Size: 0,65 MB
Targets: enca-1.9-2 librcd-0.1.8-3 librcc-0.2.3-6 taglib-rcc-1.4-4
Total Download Size: 0,00 MB
Total Installed Size: 2,06 MB
Proceed with installation? [Y/n]
checking package integrity... done.
(4/4) checking for file conflicts [#####################] 100%
(1/4) installing enca [#####################] 100%
(2/4) installing librcd [#####################] 100%
(3/4) installing librcc [#####################] 100%
-- Don't forget to install gtk or/and gtk2 packages to enable librcc
gui features
-- Also you may change /usr/bin/rcc-config symlink to switch between
gtk and gtk2 (rcc-gtk-config and rcc-gtk2-config)
(4/4) installing taglib-rcc [#####################] 100%
# pacman -Qi taglib-rcc | grep Depends
Depends On : gcc>=4.0.1 zlib bash libxml2 db librcc
# pacman -S taglib
resolving dependencies... done.
looking for inter-conflicts... :: taglib conflicts with taglib-rcc. Remove taglib-rcc? [Y/n]
done.
Remove: taglib-rcc
Total Removed Size: 0,68 MB
Targets: taglib-1.4-2
Total Download Size: 0,00 MB
Total Installed Size: 0,18 MB
Proceed with installation? [Y/n]
checking package integrity... done.
(1/1) checking for file conflicts [#####################] 100%
(1/1) installing taglib [#####################] 100%
# pacman -Qtd
librcc 0.2.3-6
IMO this bug should be fixed, as it creates inconsistent behaviour with meta packages. Currently meta packages will automatically attempt to keep member packages in sync, by installing new members. However, if specific dependencies are removed, pacman will not prompt for removal of these packages. This happened recently with `ibfonts-meta-extended` removing seven package dependencies (see above link).
All installed as dependencies to VS Code, (of course, only the latest, electron12 is needed now) and I don't think I was ever warned during upgrades. The last `code` upgrade switched from depending on `electron11` to `electron12`, I have the pacman logs in front of me and there was no mention of `electron11` becoming orphan.
So I think something should be done about it:
- either print a warning message when a package becomes orphaned due to upgrades, even if there is a meta package involved
- or (IMO better) remove dependencies becoming orphaned during upgrades