FS#17067 - Partial upgrade breaks system
Attached to Project:
Pacman
Opened by Aleksey Kazantsev (ioctl) - Sunday, 08 November 2009, 20:44 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Tuesday, 24 May 2011, 06:38 GMT
Opened by Aleksey Kazantsev (ioctl) - Sunday, 08 November 2009, 20:44 GMT
Last edited by Rémy Oudompheng (remyoudompheng) - Tuesday, 24 May 2011, 06:38 GMT
|
Details
Summary and Info:
Partial upgrade of the system and/or installation of a new package on old installation can make some other packages broken. Problem description: So, you should have working installation with old packages. Then say pacman -Sy, and upgrade one, or install a new one package. For example (I will write about specific packages just below), you have an old package A with version 1.0, which depends on old library libB. At that, in the description of the package A version on the needed library is not specified. You want to install new/upgrade old package C to the version 1.1. This package needs libB version 1.1. Ok, pacman will upgrade/install C version 1.1, and will automatically upgrade existing libB. At that, it is very possible, that the package A became unworking, because it has a binary, for example /usr/bin/A, which is linked with the /usr/lib/libB-1.0.so.0 . There are a lot of examples, but, it seems to me that the best one is mplayer. Here are a few commands output from my system: # LANG=C pacman -Qi mplayer | grep -A 3 Depends Depends On : libxxf86dga libxv libmad giflib cdparanoia gtk2 sdl lame libtheora xvidcore zlib libmng libxss libgl smbclient aalib jack-audio-connection-kit x264>=20090108 faac lirc-utils ttf-dejavu fribidi # ldd /usr/bin/mplayer | grep libjpeg libjpeg.so.62 => not found libjpeg.so.62 => not found So, libjpeg library binary is not found, because I have upgraded ghostscript which needs libjpeg>=7. As the result, pacman thinks that all right, but mplayer does not work. So, I think there are two ways to solve this problem: 1) While upgrading any package, pacman should check, that all packages that depend on the upgraded package can be dynamically linked with a new version of the upgraded package. I.e., when pacman decides to upgrade libjpeg, for example, it should check (with ldd, or, for example, readelf) all binary of all packages that depends on the libjpeg to be sure, that they can be dynamically linked with that version. I case of some of them can not work with new version, pacman should show error and exit, or suggest to upgrade that packages too, in my case it will be mplayer. Advantage: This method should work in any system just after this functionality will be implemented in the pacman utility. All existing "bad" packages will be checked. Disadvantage: This method can be very slow, at that this check will be run at any computer with any upgrade or new package install. 2) Modify package build script to make such check at a build time: Makepkg should build package (in our case -- mplayer), then should collate depends=() from the PKGBUILD and ldd mplayer. In case of PKGBUILD has words like "libjpeg>=6", or "libjpeg", but ldd (readelf) says that the /usr/bin/mplayer depends on libjpeg.so.62, it is clear that when pacman will upgrade libjpeg to the version 7-1, mplayer will not work, while all its dependencies officially satisfied. Unfortunately it is not clear to me what to do after this potential problem will be detected. May be makepkg should show warning, or it should write needed libjpeg version to the dependencies of the binary package like Debian build system can do this (this is better but harder to implement). Advantage: Check is performed only once at the build time. Disadvantage: This fix will work only when all existing packages with not quite correct dependencies will be replaced by the packages whose dependencies specified precisely. This can take a lot of time, especially on systems that upgraded seldom. |
This task depends upon
Closed by Rémy Oudompheng (remyoudompheng)
Tuesday, 24 May 2011, 06:38 GMT
Reason for closing: Not a bug
Additional comments about closing: The fix is to write better packages. Also have a look to the sodeps feature proposal.
Tuesday, 24 May 2011, 06:38 GMT
Reason for closing: Not a bug
Additional comments about closing: The fix is to write better packages. Also have a look to the sodeps feature proposal.
e.g. the libjpeg PKGBUILD could have:
provides=('libjpeg.so.62')
and then packages would depend on libjpeg.so.62 instead of libjpeg.
The problem arises in Arch Linux as only that latest packages are supported and so this is not implemented. Thus the only upgrade path is a complete upgrade.
Is it possible to detect such cases and show warning?
Or, alternatively, could pacman upgrade whole system before installing any new package?
Also, restricting installs to only work with -Su sounds like a terrible idea. There are a ton of valid reasons not to upgrade all at once, it doesn't seem worth it to restrict pacman just to prevent a use-case that is unsupported to begin with.
-1 to all this.
The only I would like to say is that it is not good that such important system program as package manager does not check correctness of the command in context of the existing installation and repository interrelationship.
If no one of already installed package should be updated, this guarantee that the existing installation will not be broken. Otherwise, if there are installed packages that must be updated to satisfy dependencies, pacman may at least show warning and suggestion to update whole system. In this case user will be notified that such installation potentially dangerous and he needs to perform entire system upgrade to make it safely.
pacman-dev@archlinux.org/msg03029.html"> http://www.mail-archive.com/pacman-dev@archlinux.org/msg03029.html
Would you be happy with that ?
(Just FYI, pacman will never make any suggestion to update whole system).
If we are talking about unversioned dependencies leading to broken linking with libraries, then this is an Archlinux problem and IMO has nothing to do here.