qemu-kvm
我正在尝试在 VMware 上安装Ubuntu 16.04 x64 位。
尝试使用此命令执行此操作时apt-get install qemu-kvm
,失败并出现以下错误:
root@ubuntu:~/Desktop/# apt-get install qemu-kvm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
qemu-kvm : Depends: qemu-common (>= 1.0+noroms-0ubuntu14.31) but it is not going to be installed
Depends: qemu-utils (>= 1.0+noroms-0ubuntu14.31) but it is not going to be installed
Depends: upstart-job
E: Unable to correct problems, you have held broken packages.
我尝试了解决方案这论坛但他们没有帮助:
sudo sed -i s/pk.archive.ubuntu.com/archive.ubuntu.com/ /etc/apt/sources.list
sudo apt-get update
这些是我的系统上安装的源:
root@ubuntu:~/Desktop/# grep -n "^[^#]" /etc/apt/sources.list{,.d/*}
/etc/apt/sources.list:6:deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
/etc/apt/sources.list:7:deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
/etc/apt/sources.list:10:deb http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
/etc/apt/sources.list:11:deb http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
/etc/apt/sources.list:12:deb http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
/etc/apt/sources.list:13:deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
/etc/apt/sources.list:14:deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
/etc/apt/sources.list:15:deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
/etc/apt/sources.list:18:deb http://archive.canonical.com/ubuntu precise partner
/etc/apt/sources.list:19:deb-src http://archive.canonical.com/ubuntu precise partner
/etc/apt/sources.list:22:deb http://extras.ubuntu.com/ubuntu precise main
/etc/apt/sources.list:23:deb-src http://extras.ubuntu.com/ubuntu precise main
/etc/apt/sources.list.d/docker.list:1:deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial edge
/etc/apt/sources.list.d/kubernetes.list:1:deb https://apt.kubernetes.io/ kubernetes-xenial main
/etc/apt/sources.list.d/notepadqq-team-ubuntu-notepadqq-xenial.list:1:deb http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial main
/etc/apt/sources.list.d/sublime-text.list:1:deb https://download.sublimetext.com/ apt/stable/
这是我的操作系统(VMware Ubuntu 16.04 x64 位)信息:
Linux ubuntu 4.15.0-45-generic #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
编辑:
与@Christian Ehrhardt 的回答相比。
root@ubuntu:~/Desktop# apt-cache policy qemu-kvm qemu-common qemu-utils
qemu-kvm:
Installed: (none)
Candidate: 1.0+noroms-0ubuntu14.31
Version table:
1.0+noroms-0ubuntu14.31 500
500 http://us.archive.ubuntu.com/ubuntu precise-security/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu precise-updates/main amd64 Packages
1.0+noroms-0ubuntu13 500
500 http://us.archive.ubuntu.com/ubuntu precise/main amd64 Packages
qemu-common:
Installed: (none)
Candidate: 1.0+noroms-0ubuntu14.31
Version table:
1.0+noroms-0ubuntu14.31 500
500 http://us.archive.ubuntu.com/ubuntu precise-security/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu precise-security/main i386 Packages
500 http://us.archive.ubuntu.com/ubuntu precise-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu precise-updates/main i386 Packages
1.0+noroms-0ubuntu13 500
500 http://us.archive.ubuntu.com/ubuntu precise/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu precise/main i386 Packages
qemu-utils:
Installed: 1:2.5+dfsg-5ubuntu10.34
Candidate: 1:2.5+dfsg-5ubuntu10.34
Version table:
*** 1:2.5+dfsg-5ubuntu10.34 100
100 /var/lib/dpkg/status
1.0+noroms-0ubuntu14.31 500
500 http://us.archive.ubuntu.com/ubuntu precise-security/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu precise-updates/main amd64 Packages
1.0+noroms-0ubuntu13 500
500 http://us.archive.ubuntu.com/ubuntu precise/main amd64 Packages
检查upstart-job
:
root@ubuntu:~/Desktop# apt-cache show upstart | grep '^Prov'
Provides: startup-tasks, system-services, upstart-compat-sysv, upstart-job
Provides: startup-tasks, system-services, upstart-compat-sysv, upstart-job
Provides: startup-tasks, system-services, upstart-compat-sysv, upstart-job
答案1
正如@user535733 所说,您的 apt 存储库中似乎有多个版本。尽管我看到的都是 Xenial 的额外 PPA,但这些 PPA 可能会拖累依赖项,这会立即导致您无法使用,因为它们是针对 Xenial 构建的。
精确的 qemu-kvm 将是 1.0+noroms-0ubuntu14.31,并且仅依赖于您看到的版本的 qemu-common/qemu-utils。但应该没有什么阻止它们。
你可以通过检查来检查你的 apt 可用的版本apt-cache policy
。当前精确的版本应该如下所示:
apt-cache policy qemu-kvm qemu-common qemu-utils
qemu-kvm:
Installed: (none)
Candidate: 1.0+noroms-0ubuntu14.31
Version table:
1.0+noroms-0ubuntu14.31 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
1.0+noroms-0ubuntu13 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
qemu-common:
Installed: (none)
Candidate: 1.0+noroms-0ubuntu14.31
Version table:
1.0+noroms-0ubuntu14.31 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
1.0+noroms-0ubuntu13 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
qemu-utils:
Installed: (none)
Candidate: 1.0+noroms-0ubuntu14.31
Version table:
1.0+noroms-0ubuntu14.31 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
1.0+noroms-0ubuntu13 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
最后upstart-job
由 upstart 包提供:
apt-cache show upstart | grep '^Prov'
Provides: startup-tasks, system-services, upstart-compat-sysv, upstart-job
顺便说一下,目前版本是 1.5-0ubuntu7.3。
您可以将您的系统与上面的系统进行比较,以检查解决问题的不同之处/原因。