apt-get/aptitude fails to install KVM via recommended update

Bug #375825 reported by freakalad
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
kvm (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: kvm

Did suggested `sudo apt-get update && sudo apt-get upgrade` from CLI

Ubuntu Hardy 8.04 LTS 64-bit multi-core Intel

Got the following error:

# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  banshee
The following packages will be upgraded:
  kvm
1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B/770kB of archives.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ... 274535 files and directories currently installed.)
Preparing to replace kvm 1:62+dfsg-0ubuntu8 (using .../kvm_1%3a62+dfsg-0ubuntu8.1_amd64.deb) ...
kvm: Using the existing group "kvm" (gid 131) for /dev/kvm
Unpacking replacement kvm ...
Setting up kvm (1:62+dfsg-0ubuntu8.1) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing kvm (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 kvm
E: Sub-process /usr/bin/dpkg returned an error code (1)

Tried downloading built file from: https://launchpad.net/ubuntu/hardy/amd64/kvm
http://launchpadlibrarian.net/15916669/kvm_62%2Bdfsg-0ubuntu8_amd64.deb

`sudo dpkg -i ./kvm_62+dfsg-0ubuntu8_amd64.deb`

same error. stuck...

Tags: apt kvm upgrade
Revision history for this message
Michael Gorven (mgorven) wrote :

The post install script tries to run "update-rc.d kvm multiuser" which doesn't seem to work anymore. Changing that line in /var/lib/dpkg/info/kvm.postinst to read "update-rc.d kvm defaults" fixes this.

Revision history for this message
freakalad (freakalad) wrote :

followed advise from cocooncrash on #ubuntu-za:

edit:
  /var/lib/dpkg/info/kvm.postinst

change the line:
  update-rc.d kvm multiuser >/dev/null
to
  update-rc.d kvm defaults >/dev/null

run:
sudo aptitude -f install

Install seems OK, though I now have other issues that seem parameter-related.
May be addressed here: http://libvirt.org/drvqemu.html#xmlconfig (under <boot> element)

Revision history for this message
freakalad (freakalad) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Did the fixed kvm that was released today correct this issue for you?

Revision history for this message
freakalad (freakalad) wrote :

Hey Marc,

Haven't worked up the nerve to run the upgrade again since I got a working system back after downgrading KVM.

Until the new patch comes out (8.2, it think) along with a corresponding libvirt update, I'm a bit hesitant to run the update, since I'm reliant on my VM's

Will try again in a week or so

Revision history for this message
freakalad (freakalad) wrote :

Back to square-1

Eventually I was compelled to run with a security update, and the issue's returned with a vengeance.

#####
apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
  banshee cairo-dock
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
3 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up kvm (1:62+dfsg-0ubuntu8.2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing kvm (--configure):
 subprocess post-installation script returned error exit status 1
Setting up ntp (1:4.2.4p4+dfsg-3ubuntu2.2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing ntp (--configure):
 subprocess post-installation script returned error exit status 1
Setting up pulseaudio (0.9.10-1ubuntu1) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing pulseaudio (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 kvm
 ntp
 pulseaudio
E: Sub-process /usr/bin/dpkg returned an error code (1)
#####

Haven't gone through the motions of hacking the post-install script, again, since this'll complete the installation & break stuff again

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

freakalad, I don't think the problem is in the kvm package, because the help message you get from update-rc.d does not list multiuser as a valid argument.

This is output I get from update-rc.d in version 2.86.ds1-14.1ubuntu45.1 of the sysv-rc package.

--------
$ /usr/sbin/update-rc.d
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults|multiuser [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
--------

Could you check which version of the sysv-rc package you have installed by running 'dpkg -s sysv-rc' ?

John

Revision history for this message
freakalad (freakalad) wrote :

Hi John; thanks for the response

I'm not sure whether or not this issue is purely a KVM issue, but I've gone from pillar to post in the various IRC channels (kvm, vibvirt, ubuntu-virt, qemu, etc), and every group indicated that it's not an issue in their domain.

As indicated above & in the forum, I've been able to work through the issue before by manually hacking the post-install script, and then reverting the KVM package to a earlier version, but now the problem is exacerbated, since the package manager tried to (re)install this critical update (regardless of whether or not the libvirt has been updated accordingly), and now I'm unable to do any further upgrades (I understand that this issue is not necessarily related to this "bug", but this is where my troubles have started)

As requested, herewith is my output from `dpkg -s sysv-rc`:

Package: sysv-rc
Status: install ok installed
Priority: required
Section: admin
Installed-Size: 264
Maintainer: Debian sysvinit maintainers <email address hidden>
Architecture: all
Source: sysvinit
Version: 2.86.ds1-38+etchnhalf.1
Replaces: file-rc, sysvinit (<< 2.85-1)
Recommends: lsb-base (>= 3.0-6)
Suggests: sysv-rc-conf, bum
Conflicts: file-rc
Description: System-V-like runlevel change mechanism
 This package provides support for the System-V like system
 for booting, shutting down and changing runlevels,
 configured through symbolic links in /etc/rc?.d/.

At present, this problem seems to look like a apt issue, so I'll try & address it from that angle first, before trying to hack KVM again.

Thanks

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

If you are running version 2.86.ds1-38+etchnhalf.1 of sysv-rc then that is from a Debian 4.0 (aka "etch") repository and is not the Ubuntu 8.04 (aka "hardy") sysv-rc package.

Have you try to move from Debian to Ubuntu via apt-get?

If not then try running:
    grep -i debian /etc/apt/sources.list
to check if you are set to download packages from any debian repositories.

To fix this you need to replace any packages from Debian with the correct ones from Ubuntu. One quick way to do this could be to run an upgrade to Ubuntu 9.04 (aka "jaunty").

Either way this is not a kvm problem, and I would recommend that this bug be closed.

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

Problem caused by update-rc.d from Debian Etch being installed.

Changed in kvm (Ubuntu):
status: New → Invalid
Revision history for this message
freakalad (freakalad) wrote :

I did have debian repo's defined in my sources.list, for specific apps & purposes, but they have long-since been commented out/removed.

As for the KVM installation, I've been using the standard ubuntu apt/aptitude repositories & installation/upgrade methods since day-1 (`sudo apt-get update && sudo apt-get upgrade`) , and this issue has only started cropping up with the installation of the latest KVM patch (Version 1:62+dfsg-0ubuntu8.2).
Of that much I am certain.

I can appreciate the fact that this may not strictly be a KVM issue, but until this problem goes away & does not come back to cause system instabilities, I do not think this could be laid to rest.

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

Your problem is caused by mixing Debian and Ubuntu packages and expecting them to work without any problems.

kvm is not the only package that you are having this problem with. If you look at your own output from 'apt-get upgrade' you will see that both the ntp and pulseaudio packages are not installing correctly.

You need to replace the sysv-rc Debian package with the Ubuntu one, and then check if there are other Debian packages installed on your Ubuntu machine and replace those. Then you will have an Ubuntu machine that might have a chance of working.

Revision history for this message
freakalad (freakalad) wrote :

Thanks, John.
I'll look into that

Revision history for this message
freakalad (freakalad) wrote :
Download full text (3.5 KiB)

Tried to follow instructions as bes I could above, but issue is still unresolved.

My sources.list now look like this:

#####
deb http://archive.canonical.com/ubuntu hardy partner
deb-src http://archive.canonical.com/ubuntu hardy partner

deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse

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

#deb http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu hardy-backports main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ hardy-proposed main restricted universe multiverse
#####

rebooted, COMPLETELY purged KVM, updated sources & tried again, as instructed/suggested:

`aptitude install kvm`

Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be installed:
  kvm
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/770kB of archives. After unpacking 2560kB will be used.
Writing extended state information... Done
Selecting previously deselected package kvm.
(Reading database ... 275227 files and directories currently installed.)
Unpacking kvm (from .../kvm_1%3a62+dfsg-0ubuntu8.2_amd64.deb) ...
kvm: Using the existing group "kvm" (gid 131) for /dev/kvm
Setting up kvm (1:62+dfsg-0ubuntu8.2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing kvm (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 kvm
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up kvm (1:62+dfsg-0ubuntu8.2) ...
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | sNN kNN]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
  -n: not really
  -f: force
dpkg: error processing kvm (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 kvm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Building tag database... Done

From previous experience, this points to a faulty port-install scri...

Read more...

Revision history for this message
John Edwards (john-cornerstonelinux) wrote :

Please re-read my previous post.

sysv-rc is the package you need to replace, not kvm.

Try running:
    apt-get install --reinstall sysv-rc

You then need to check if there are other Debian packages installed on your Ubuntu machine and replace those. If you run 'aptitude' then these will probably be listed in the "Obsolete and Locally Created Packages".

This is also not a bug in apt or aptitude, it is caused by you installing Debian Etch packages on Ubuntu Hardy.

Revision history for this message
freakalad (freakalad) wrote :

Thanks, John
I think I finally understand a bit better

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.