Claudiu
Claudiu

Reputation: 165

Can't Install kvm - Dependency on qemu-kvm

I'm trying to setup KVM virtualisation on a Debian 7.7, running on Core(TM)i5-4402E CPU @ 1.6 GHz by following the steps here.

After trying apt-get install kvm qemu-kvm libvirt-bin virtinst, I got

The following packages have unmet dependencies:
 qemu-kvm : Conflicts: kvm
E: Unable to correct problems, you have held broken packages.

I then tried installing them one by one and managed to successfully install all of them apart from kvm.

Doing apt-get install kvm, I get the following output:

The following packages have unmet dependencies:
 kvm : Depends: qemu-kvm but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I've already followed this thread, but these suggestions haven't worked for me. I've also tried

apt-get clean apt-get update apt-get upgrade apt-get install -f

with no success.

Upvotes: 3

Views: 6772

Answers (3)

Álvaro de Lucas
Álvaro de Lucas

Reputation: 21

I had same problem.

Try to install just the package not going to be installed. It will probably get an error referencing another package. Try to install manually (apt install packageName) that one too until you get to the final problem. In my case it had a dependency to a package pending to install (it was 3.2.27-1ubuntu0.16.04.1) To solve this, I modified repository list

vi /etc/apt/sources.list

and added required one

deb http://security.ubuntu.com/ubuntu xenial-security main

execute an update

apt update; apt dist-upgrade

and now you can install packages without errors (in your case apt install qemu-kvm)

Upvotes: 0

user2630659
user2630659

Reputation: 23

I built many Debian 7 kvm qemu setups, I used Debian 7 just to let debian 8 settly although will start playing with debian 8 soon.

I think the standard packages are far to dated and the kernel s available are too old and I found I got alot of errors and freeze ups and to make it stable here is a fresh install. make sure your IOMMU is enabled in bios if you have it . note I did this on a AMD 8 core machine.

apt-get build-dep qemu
apt-get build-dep qemu
apt-get install git bc fakeroot kernel-package
apt-get install bc fakeroot kernel-package ca-certificates

get latest kernel and git of qemu

cd /usr/src
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.8.tar.gz
tar -xzf linux-3.19.8.tar.gz
git clone git://git.qemu-project.org/qemu.git
cd linux-3.19.8
make oldconfig
make menuconfig

now enable the parts of the kernel that will make kvm work best

Virtualization
(CONFIG_VIRTUALIZATION=y)
Virtualization > Kernel-based Virtual Machine (KVM) Support
(CONFIG_KVM=y)
Virtualization > KVM for <whichever processor you have>
(CONFIG_KVM_INTEL=y and/or CONFIG_KVM_AMD=y)

you may compile as modules [M]:

Virtualization > Host kernel accelerator for virtio net
(CONFIG_VHOST_NET=m)
Device Drivers > Virtio drivers > PCI driver for virtio devices
(CONFIG_VIRTIO_PCI=m)
Device Drivers > Virtio drivers > Virtio balloon driver
(CONFIG_VIRTIO_BALLOON=m)

Processor Type and Features > Preemption Model > Preemptible Kernel (Low Latency Desktop)
(CONFIG_PREEMPT=y)
Processor Type and Features > Timer Frequency > 1000 Hz
(CONFIG_HZ_1000=y)

when your done make a debian package

make-kpkg --initrd --append-to-version=kvm.1 kernel_image kernel_headers
cd ..
dpkg -i linux-headers-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb linux-image-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb

then install of course

dpkg -i linux-headers-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb linux-image-3.19.8kvm.1_3.19.8kvm.1-10.00.Custom_amd64.deb

reboot and check if you are in the new kernel

uname -r
3.19.8kvm.1

Now lets load the git parts and get this show on the road..

git submodule update --init dtc
cd /usr/src/qemu
./configure --enable-kvm && make && make install

and Libvirt then check thous dep just in case

apt-get install libvirt-bin build-dep qemu
/etc/init.d/libvirt-bin restart

make sure to setup your bridge of network device(s)

nano /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

##main onboard port0
auto eth0
iface eth0 inet manual

auto br0
#iface br0 inet dhcp
#        bridge_ports eth0
#        bridge_stp off
#        bridge_fd 0
#        bridge_maxwait 0

iface br0 inet static
    address 10.0.0.241
    network 10.0.0.0
    netmask 255.255.255.0
    broadcast 10.0.0.255
    gateway 10.0.0.254
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0


 bridge_stp off # disable Spanning Tree Protocol
 bridge_fd 0 # no forwarding delay

here are some command that might help

brctl show
brctl showmacs br0

things that helped (note doing this off my head probably missing a few things Like a backports repo

nano /etc/apt/sources.list
deb http://http.debian.net/debian wheezy-backports main
apt-get update;apt-get install qemu-guest-agent

I hope this helps someone. With Debian 8 there is better support for the newer kernel features that support kvm qemu latest for better optimizations.

Upvotes: 1

Valeriy Solovyov
Valeriy Solovyov

Reputation: 5648

1).Check the repositories:

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse 

2).Remove kvm:

apt-get remove --purge libvirt-bin kvm qemu-kvm libvirt-bin virtinst

3).Install

apt-get install kvm qemu-kvm libvirt-bin virtinst

Upvotes: 1

Related Questions