apt - What happens to dependent Debian packages when you upgrade a Debian package? - Ask Ubuntu


let's have debian package a-1.0.0.deb (which contains library), , package b-1.0.0.deb (which contains service) depends on a library. let's want upgrade a-1.0.1.deb.

according this document, dpkg goes through pretty involved algorithm figure package maintainer scripts called each package part of upgrade process. if of these steps fail, a can left in sort of limbo state (for example, "half-installed").

however, when break a, b broken since depends on a. question dpkg have built-in way deal situation? b's install status change depending on a's status? ideally dpkg have built-in functionality move b installed state state (so b service can stopped & restarted when a healthy), can't find in dpkg documentation suggests done.

if dpkg doesn't handle situation intelligently, apt?

from have experienced not have read.

  • however, when break a, b broken since depends on it. question dpkg have built-in way deal situation?

    yes, try reinstall or reconfigure on next run.

    1. if interrupted, fix , continue working normal.

    2. but it's problem control scripts, fail again , again , stay in loop. it's bug , report filled against package , manual fix required.

  • does b's install status change depending on a's status?

    no, status stay installed no change, keep track of broken dependency too, @ least not in same file /var/lib/dpkg/status.

  • if dpkg doesn't handle situation intelligently, apt?

    no, apt not interfere in case. apt uses dpkg, dpkg lower level tool , tool install, build, remove debian packages.


let's try it, better done in virtualbox.

  1. prepare dummy packages

    ~$ sudo apt install equivs ~$ mkdir deleteme ~$ cd deleteme 

    b 1.0.0 depends on a

    ~/deleteme$ equivs-control b0 ~/deleteme$ nano b0 ... package: b version: 1.0.0 ... depends: ... ~/deleteme$ equivs-build b0 

    a 1.0.0 clean install & remove

    ~/deleteme$ equivs-control a0 ~/deleteme$ nano a0 ... package: version: 1.0.0 ... ~/deleteme$ equivs-build a0 

    a 1.0.1 dirty install, clean remove

    ~/deleteme$ cp a0 a1 ~/deleteme$ nano a1 ... package: version: 1.0.1 ... postinst: a1.postinst ...  ~/deleteme$ nano a1.postinst  #!/bin/sh     exit 1  ~/deleteme$ equivs-build a1 

    now, should have:

    ~/deleteme$ ls -1 a0 a1 a_1.0.0_all.deb a_1.0.1_all.deb a1.postinst b0 b_1.0.0_all.deb 
  2. try scenario

    sudo su  dpkg -i b_1.0.0_all.deb dpkg --audit dpkg -i a_1.0.0_all.deb dpkg --audit dpkg --configure -a dpkg --audit dpkg --remove dpkg --remove b dpkg --remove  dpkg -i a_1.0.0_all.deb dpkg -i b_1.0.0_all.deb dpkg --audit dpkg -i a_1.0.1_all.deb dpkg --audit dpkg --remove apt purge 
  3. to in loop can't complete installation neither remove it.

    create clean 1.0.1, b 1.0.0 1.0.0 prerm: script contains exit 1. when try install 1.0.1, dpkg fail remove 1.0.0 .


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User