Lucid to Precise: dist-upgrade fails on dkpg

Asked by Jan Ceulen

After a long upgrade (guess 15 minutes) it stopped:

SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1)
Could not install upgrades
Error...
'E:Couldn't configure pre-depend multiarch-support for
libapt-pkg4.12, probably a dependency cycle.'

I was invited to report this as a bug

When (re)booting choosing Linux 3.2.0-30-generic fails (The CPU has been disabled by the guest...)
Booting into Linux 2.6.32-42-server runs ok - system is 12.04.1 LTS
As far as I tested till now main functions do run (Apache 2.2.22, PHP 5.3.10 MySQL 5.5.24)

I attach apt.log and mail.log from /var/log/dist-upgrade
What went wrong?

#edit
apt-get -f install seems to solve the boot problem (works with 3.2.0-30 now).
I'm still wondering if I am missing upgrades since the release-upgrade did not end succesfully...

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#1

Root issue is described here:

https://wiki.ubuntu.com/PrecisePangolin/TechnicalOverview/Beta1#Upgrades

"In some cases, the package manager in Ubuntu 11.10 may not be able to decide on a correct unpack ordering when upgrading 64-bit systems with the ia32-libs package installed; if this is the case, it will fail before starting to unpack any new packages with a message something like "Couldn't configure pre-depend libtinfo5 for libncurses5, probably a dependency cycle". A workaround is to install the apt and libapt-pkg4.12 packages from precise (Ubuntu 12.04) before starting the upgrade. (924079)"

Please look at the workaround procedure here:

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/924079/comments/23

If you are upgrading from lucid instead of oneiric, then replace oneiric with lucid in the commands described here:

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/924079/comments/23

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#2

Ok. Many thanks. I'll try this. I will report if it solves my problem.

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#3

Should I do this? (from https://wiki.ubuntu.com/PrecisePangolin/TechnicalOverview/Beta1#Upgrades)
I did have a message about multiarch
No /etc/dpkg/dpkg.cfg.d/multiarch on my server...

The ia32-libs package that used to provide 32-bit libraries on 64-bit (amd64) installations has been removed in favour of multiarch. Systems using ia32-libs must migrate to multiarch in order to upgrade to 12.04. In most cases, this should be set up automatically by the upgrade process. Some users who upgraded through previous development releases may have removed /etc/dpkg/dpkg.cfg.d/multiarch, and must restore it with the contents foreign-architecture i386 in order to have 32-bit library support in 12.04.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#4

I only recommend performing the workaround procedure here:

https://bugs.launchpad.net/ubuntu/+source/apt/+bug/924079/comments/23

to fix the following error message:

SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1)
Could not install upgrades
Error...
'E:Couldn't configure pre-depend multiarch-support for
libapt-pkg4.12, probably a dependency cycle.'

I have no further suggestions to make.

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#5

I did:
  sed 's/lucid/precise/g' -i /etc/apt/sources.list
  apt-get update
(so far so good), then:
  apt-get install apt python-apt
This does not try (as I expected) to install just these two but suggests to upgrade 110 packets, new 45 and remove 7.
To scare the hell out of me the confirmation has to be a complete sentence: 'Yes, do as I say'.
This seems to be a complete upgrade to Precise instead of preparing for the release-upgrade as suggested.

Does anyone have experience with this?
Jan

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#6

There should be absolutely no reason to be scared, as you have made backups of your configuration files and personal files, right??

If you do not have backups, then you should do so right now before upgrading.

If the upgrade fails, I suggest performing a clean install of Ubuntu 12.04 LTS, which will probably give cleaner results (in this case).

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#7

Thanks for your comfort - I do have a backup of this (virtual) machine.

Now I have tried:
sed 's/lucid/precise/g' -i /etc/apt/sources.list
apt-get update
apt-get install apt python-apt

Result: it's wanting to upgrade 110, install 45 and delete 7 (instead of just install apt and python-apt).
+ WARNNG... lzma will be deleted and this should not be done (reason dpkg)

Despite all this I gave it a try by typing the sentence 'Yes, do as I say!'
Result after downloading:
E: Kon onmiddellijke configuratie van 'python-minimal' niet uitvoeren. Voor details zie 'man 5 apt.conf', onder APT::Immediate-Configure. (2)
E: Could not execute immediate configuration of 'python-minimal'. For details see 'man 5 apt.conf', at APT::Immediate-Configure. (2)

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#8

Aha, that is an interesting one... :-)

Try these commands:

sudo apt-get install -o APT::Immediate-Configure=false -f apt python-minimal

sudo apt-get -f install

sudo apt-get dist-upgrade

Hope it helps.

Source: http://blogs.operationaldynamics.com/andrew/software/ubuntu-linux/upgrading-to-precise
Second source: https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/990740

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#9

Thank you Mark, I think we're getting closer.

apt and python-minimal were installed now thanks to 'apt-get install -o APT::Immediate-Configure=false -f apt python-minimal'
After that I went back to sources-list for lucid and did 'do-release-upgrade' (you recommended apt-get dist-upgrade, I assume with sources set to precise) so I was 'eigenwijs' - I could try again from scratch and then stick to the precise sources list and run dist-upgrade as you said.

So now I ran into 'SystenError: E-Sub-process /usr/bin/dpkg returned an error code (1)'
From main.log:
<...
2012-09-17 00:17:02,456 DEBUG demoted: 'python-central python-smartpm'
2012-09-17 00:17:02,456 DEBUG found components: {'precise': set(['restricted', 'main', 'multiverse', 'universe']), 'precise-security': set(['restricted', 'main', 'multiverse', 'universe']), 'precise-updates': set(['restricted', 'main', 'multiverse', 'universe'])}
2012-09-17 00:17:22,304 DEBUG disabling apt cron job (0755)
2012-09-17 00:18:06,787 DEBUG plugins for condition 'StartUpgrade' are '[]'
2012-09-17 00:18:06,788 DEBUG plugins for condition 'preciseStartUpgrade' are '[]'
2012-09-17 00:18:06,788 DEBUG plugins for condition 'from_lucidStartUpgrade' are '[]'
2012-09-17 00:18:06,788 DEBUG quirks: running StartUpgrade
2012-09-17 00:18:06,788 DEBUG check if patch '_usr_bin_pycompile.b17cebfbf18d152702278b15710d5095.97c07a02e5951cf68cb3f86534f6f917' needs to be applied
2012-09-17 00:18:06,788 DEBUG target for '_usr_bin_pycompile.b17cebfbf18d152702278b15710d5095.97c07a02e5951cf68cb3f86534f6f917' is '_usr_bin_pycompile' -> '/usr/bin/pycompile'
2012-09-17 00:18:06,792 WARNING unexpected target md5sum, skipping: '/usr/bin/pycompile'
2012-09-17 00:18:06,792 DEBUG skipping 'README' (no '.')
2012-09-17 00:18:06,793 DEBUG killing update-notifier
2012-09-17 00:18:06,809 DEBUG killing kblueplugd kbluetooth4
2012-09-17 00:18:06,814 DEBUG killing gnome-screensaver
2012-09-17 00:18:06,819 DEBUG apt btrfs snapshots supported: False
2012-09-17 00:18:06,819 INFO cache.commit()
2012-09-17 00:18:06,819 DEBUG failed to SystemUnLock() (E:Not locked)
2012-09-17 00:26:25,720 ERROR got an error from dpkg for pkg: 'linux-image-3.2.0-30-generic': 'subproces installed post-installation script gaf een foutwaarde 1 terug'
2012-09-17 00:26:25,720 DEBUG running apport_pkgfailure() linux-image-3.2.0-30-generic: subproces installed post-installation script gaf een foutwaarde 1 terug
2012-09-17 00:26:44,097 ERROR got an error from dpkg for pkg: 'memtest86+': 'subproces installed post-installation script gaf een foutwaarde 1 terug'
2012-09-17 00:26:44,097 DEBUG running apport_pkgfailure() memtest86+: subproces installed post-installation script gaf een foutwaarde 1 terug
2012-09-17 00:26:46,331 ERROR got an error from dpkg for pkg: 'ubuntu-standard': 'vereistenproblemen - blijft ongeconfigureerd'
2012-09-17 00:26:46,331 DEBUG running apport_pkgfailure() ubuntu-standard: vereistenproblemen - blijft ongeconfigureerd
2012-09-17 00:26:51,205 ERROR got an error from dpkg for pkg: 'linux-image-server': 'vereistenproblemen - blijft ongeconfigureerd'
2012-09-17 00:26:51,205 DEBUG running apport_pkgfailure() linux-image-server: vereistenproblemen - blijft ongeconfigureerd
2012-09-17 00:26:51,205 ERROR got an error from dpkg for pkg: 'linux-server': 'vereistenproblemen - blijft ongeconfigureerd'
2012-09-17 00:26:51,205 DEBUG running apport_pkgfailure() linux-server: vereistenproblemen - blijft ongeconfigureerd
2012-09-17 00:28:35,844 ERROR not handled exception:
SystemError: E:Sub-process /usr/bin/dpkg returned an error code (1)
2012-09-17 00:28:35,882 DEBUG enabling apt cron job
2012-09-17 00:28:35,999 ERROR SystemError from cache.commit(): installArchives() failed
2012-09-17 00:31:47,056 DEBUG enabling apt cron job
2012-09-17 00:31:47,070 DEBUG Running PostInstallScript: './xorg_fix_proprietary.py'
2012-09-17 00:32:49,756 DEBUG enabling apt cron job
>

Difference now is that I end with: 'Upgrade completed but with errors (...)'
Rebooting was ok I will now test as much as I can

Installing a clean 12.04 Precise is no option since this is a production machine (in ESXI) with tons of websites and some https certificates. Built in the past 4 years with all sorts of special conf, I can't reproduce this other than investing days and days...
I run a copy locally in a VMware Workstation to see if upgrading will work + I have some 5 others running Lucid... !

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#10

Resuming my problem:
If I give the Lucid to Precise upgrade a new try, should I do sed on sources list (replace lucid by precise) first or just run

sudo apt-get install -o APT::Immediate-Configure=false -f apt python-minimal
sudo apt-get -f install
sudo apt-get dist-upgrade

with lucid sources?

Or should i replace 'sudo apt-get dist-upgrade' with 'sudo do-release-upgrade' ?

I read a lot of complaints and different approaches for this bug
I'm getting a bit confused, already had about 5 failures, each time starting all over from the backupped Lucid machine...

Q 2:
Is it correct that after the upgrade (with errors) Linux is 3.2.0-30 GENERIC?
 It used to be 2.6.32-xx SERVER

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#11

3.2.0-30-generic is exactly the same kernel version as the one I am running on my Ubuntu 12.04 laptop.

I suggest the following procedure, which is an ugly hack that works for me. Your mileage may vary....

Only put the following lines in your /etc/apt/sources.list file (replacing lucid with precise):

########################################################################

deb http://nl.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://nl.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise universe
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nl.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://nl.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://nl.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
# deb-src http://nl.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

######################################################################## END OF FILE

REMOVE any other lines and disable any PPA repositories located in /etc/apt/sources.list.d/.

Then run:

sudo apt-get update

sudo apt-get install aptitude

sudo aptitude update

sudo aptitude dist-upgrade

(1st iteration)

sudo aptitude dist-upgrade

(2nd iteration)

sudo aptitude dist-upgrade

(3rd .....)

Keep running

sudo aptitude dist-upgrade

until there are no more packages to install.

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#12

Thanks Mark
I will try that tomorrow

Revision history for this message
Jan Ceulen (8foisk6i-c1s-ugqehg0r) said :
#13

Hi Mark.
Sorry it took so long, was too busy to further experiment on this.

After editing sources.lst as indicated above I did this:
sudo apt-get update
sudo apt-get install aptitude
 --- ERROR: python-minimal error, so I did:
apt-get install -o APT::Immediate-Configure=false -f apt python-minimal
sudo aptitude update
sudo aptitude dist-upgrade
 --- (1st iteration) ok
sudo aptitude dist-upgrade
 --- (2nd iteration) zie errors in Report below
sudo aptitude dist-upgrade
  (3rd .....) 0,0,0...!

Things seem to work now, but still with linux-image-3.2.0-31-generic.
It WAS a server - see Report below

So I'm still not very happy.
Meanwhile some apt-updates appeared in the live-production machine of which I copied a VM to do this upgrade-trial.
Maybe I should start all over with a copy of the current live machine?

ADD: Report (partly in Dutch - if that's annoying for someone I'll translate it for her/him.
These (severe?) errors occurred:

...
Instellen van rsync (3.0.9-1ubuntu1) ...
Installeren van nieuwe versie van configuratiebestand /etc/init.d/rsync ...
 Removing any system startup links for /etc/init.d/rsync ...
   /etc/rc1.d/K20rsync
   /etc/rc2.d/S50rsync
   /etc/rc3.d/S50rsync
   /etc/rc4.d/S50rsync
   /etc/rc5.d/S50rsync
Instellen van sgml-base (1.26+nmu1ubuntu1) ...
Instellen van strace (4.5.20-2.3ubuntu1) ...
Instellen van tcpdump (4.2.1-1ubuntu2) ...
Installeren van nieuwe versie van configuratiebestand /etc/apparmor.d/usr.sbin.tcpdump ...
Instellen van time (1.7-23.1) ...
Ignoring install-info called from maintainer script
The package time should be rebuilt with new debhelper to get trigger support
Instellen van usbutils (1:005-1) ...
Instellen van wget (1.13.4-2ubuntu1) ...
dpkg: vereistenproblemen verhinderen de configuratie van ubuntu-standard:
 ubuntu-standard is afhankelijk van memtest86+; maar:
  Pakket memtest86+ is nog niet geconfigureerd.
dpkg: fout bij afhandelen van ubuntu-standard (--configure):
 vereistenproblemen - blijft ongeconfigureerd
Er is geen apport-verslag weggeschreven omdat het maximum aantal verslagen (MaxReports) al is bereikt
...
Instellen van linux-firmware (1.79.1) ...
dpkg: vereistenproblemen verhinderen de configuratie van linux-image-server:
 linux-image-server is afhankelijk van linux-image-3.2.0-31-generic; maar:
  Pakket linux-image-3.2.0-31-generic is nog niet geconfigureerd.
dpkg: fout bij afhandelen van linux-image-server (--configure):
 vereistenproblemen - blijft ongeconfigureerd
Er is geen apport-verslag weggeschreven omdat het maximum aantal verslagen (MaxReports) al is bereikt
                                                                                                     dpkg: vereistenproblemen verhinderen de configuratie van linux-server:
 linux-server is afhankelijk van linux-image-server (= 3.2.0.31.34); maar:
  Pakket linux-image-server is nog niet geconfigureerd.
dpkg: fout bij afhandelen van linux-server (--configure):
 vereistenproblemen - blijft ongeconfigureerd
Er is geen apport-verslag weggeschreven omdat het maximum aantal verslagen (MaxReports) al is bereikt
...Processing triggers for resolvconf ...
Fouten gevonden tijdens behandelen van:
 linux-image-3.2.0-31-generic
 memtest86+
 ubuntu-standard
 linux-image-server
 linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Bevestigd! Er is iets ergs gebeurd bij het installeren van pakketten. Er wordt geprobeerd van te herstellen:
Instellen van memtest86+ (4.20-1.1ubuntu1) ...
Generating grub.cfg ...

Thanks, Jan

Revision history for this message
Launchpad Janitor (janitor) said :
#14

This question was expired because it remained in the 'Open' state without activity for the last 15 days.