[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#670954: [apt] MultiArch: apt-get -f install doesn't see correct dependency of package



On 05/03/2012 04:20 PM, Goswin von Brederlow wrote:
> Török Edwin <edwin+ml-debian@etorok.net> writes:
> 
>> Traceback (most recent call last):
>>   File "/usr/bin/apt-listchanges", line 237, in <module>
>>     main()
>>   File "/usr/bin/apt-listchanges", line 48, in main
>>     debs = apt_listchanges.read_apt_pipeline(config)
>>   File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in read_apt_pipeline
>>     return map(lambda pkg: filenames[pkg], order)
>>   File "/usr/share/apt-listchanges/apt_listchanges.py", line 83, in <lambda>
>>     return map(lambda pkg: filenames[pkg], order)
>> KeyError: 'libgcc1-dbg'
> 
> I think that is your actual problem. Something is broken with (your)
> apt-listchanges. Apt-listchanges is a hook run before installing
> packages and if any hook fails the installation is aborted. Try removing
> that temporary from your apt.conf.

In the end I fixed this by removing libgcc1-dbg and libstdc++6-4.7-dbg, and reinstalling them.
I can however still reproduce the problem by downgrading to the .deb in my /var/cache/apt, so I've
tried disabling apt-listchanges as you suggested:

# apt-get -f  install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  anjuta-common gtkpod-data id3v2 libanjuta-3-0 libgdl-3-2 libgdl-3-common
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libgcc1-dbg
The following packages will be upgraded:
  libgcc1-dbg
1 upgraded, 0 newly installed, 0 to remove and 97 not upgraded.
1 not fully installed or removed.
Need to get 0 B/101 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
dpkg: dependency problems prevent configuration of libgcc1-dbg:amd64:
 libgcc1-dbg:amd64 depends on gcc-4.7-base (= 4.7.0-5); however:
  Version of gcc-4.7-base:amd64 on system is 4.7.0-7.
 libgcc1-dbg:amd64 depends on libgcc1 (= 1:4.7.0-5); however:
  Version of libgcc1:amd64 on system is 1:4.7.0-7.
dpkg: error processing libgcc1-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libgcc1-dbg:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

Didn't work.

I _think_ the problem occurs only if I have a removed, but not purged old version of libgcc1-dbg/gcc-4.7-base:i386.

So there are 2 bugs here:
1. 'apt-get -f install' can't recover on its own from .gz mismatches, if the :i386 package is removed, and at an older version.
One has to manually --purge the :i386 package, before the :amd64 one can be upgraded. IMHO removed packages shouldn't affect upgradability.
2. 'apt-get -f install' can't recover on its own from an unpacked-but-not-configured libgcc1-dbg that got stuck at an older version.
One has to remove the package, and reinstall it to fix this.

I think apt-get -f install should at least give hints to the user on what to try manually, and of course best would be if
it could figure out on its own how to fix these situations.

FWIW downgrading and upgrading just the amd64 packages works:
1. Downgrade to 4.7.0-6, just amd64 packages, :i386 packages are purged:
# dpkg -i /var/cache/apt/archives/libgcc1_1%3a4.7.0-6_amd64.deb /var/cache/apt/archives/gcc-4.7-base_4.7.0-6_amd64.deb /var/cache/apt/archives/libstdc++6_4.7.0-6_amd64.deb
/var/cache/apt/archives/libgcc1-dbg_1%3a4.7.0-6_amd64.deb
2. apt-get -f install restores it back again

This doesn't work (steps to reproduce this bug):
--------------------------------------------
1. Install libgcc1-dbg:i386
#  apt-get install libgcc1-dbg:i386 libgcc1-dbg:amd64
2.  Remove it (but don't purge)
# apt-get remove libgcc1-dbg:i386

status is now:
dpkg -l libgcc1 libgcc1-dbg gcc-4.7-base
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version                           Description
+++-=================================-=================================-==================================================================================
ii  gcc-4.7-base:amd64                4.7.0-7                           GCC, the GNU Compiler Collection (base package)
ii  gcc-4.7-base:i386                 4.7.0-7                           GCC, the GNU Compiler Collection (base package)
ii  libgcc1:amd64                     1:4.7.0-7                         GCC support library
ii  libgcc1:i386                      1:4.7.0-7                         GCC support library
ii  libgcc1-dbg:amd64                 1:4.7.0-7                         GCC support library (debug symbols)


3. Downgrade to 4.7.0-6, just amd64 packages. (will fail due to mismatching versions):
# dpkg -i /var/cache/apt/archives/libgcc1_1%3a4.7.0-6_amd64.deb /var/cache/apt/archives/gcc-4.7-base_4.7.0-6_amd64.deb /var/cache/apt/archives/libstdc++6_4.7.0-6_amd64.deb
/var/cache/apt/archives/libgcc1-dbg_1%3a4.7.0-6_amd64.deb

4. Try to fix it
# apt-get -f instal
[....]

Unpacking replacement gcc-4.7-base:amd64 ...
dpkg: error processing /var/cache/apt/archives/gcc-4.7-base_4.7.0-7_amd64.deb (--unpack):
 trying to overwrite shared '/usr/share/doc/gcc-4.7-base/changelog.Debian.gz', which is different from other instances of package gcc-4.7-base:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/gcc-4.7-base_4.7.0-7_amd64.deb

Status is now
# dpkg -l libgcc1 libgcc1-dbg gcc-4.7-baseDesired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version                           Description
+++-=================================-=================================-==================================================================================
iU  gcc-4.7-base:amd64                4.7.0-6                           GCC, the GNU Compiler Collection (base package)
iF  gcc-4.7-base:i386                 4.7.0-7                           GCC, the GNU Compiler Collection (base package)
iU  libgcc1:amd64                     1:4.7.0-6                         GCC support library
iF  libgcc1:i386                      1:4.7.0-7                         GCC support library
iU  libgcc1-dbg:amd64                 1:4.7.0-6                         GCC support library (debug symbols)\


5. Try to fix manually: purge gcc-4.7-base:i386:
# dpkg --purge gcc-4.7-base:i386

6. Try to fix it
# apt-get -f install

dpkg: dependency problems prevent configuration of libgcc1-dbg:amd64:
 libgcc1-dbg:amd64 depends on gcc-4.7-base (= 4.7.0-6); however:
  Version of gcc-4.7-base:amd64 on system is 4.7.0-7.
 libgcc1-dbg:amd64 depends on libgcc1 (= 1:4.7.0-6); however:
  Version of libgcc1:amd64 on system is 1:4.7.0-7.
dpkg: error processing libgcc1-dbg:amd64 (--configure):
 dependency problems - leaving unconfigured
Setting up libgcc1:i386 (1:4.7.0-7) ...

This fixed the .gz mismatch, but versions are still wrong

7. Try to fix manually again, remove and reinstall libgcc1-dbg:
# apt-get remove libgcc1-dbg
# apt-get install libgcc1-dbg

Best regards,
--Edwin



Reply to: