我安装了 QEMU,但是因为我不怎么用它,而且最近发现它有很多安全漏洞,所以我想完全删除它。据sudo apt-get install qemu
我所知,我安装了它。当我运行时,sudo apt-get purge qemu
它只说它被删除了,qemu
但是当它有最近的更新时,我发现它有许多依赖项和其他包,qemu
它没有随包一起删除qemu
。
那么我该如何彻底删除它,以便删除它安装的所有配置文件和软件包?显然,如果它使用的其他程序使用了依赖项,那么我不想也删除它们,而只想删除它安装的、其他程序不需要的东西。我尝试运行,sudo apt-get autoremove
这相当于答案在这里这样说没有帮助(它没有删除任何东西)。
我正在运行带有 GNOME 3.18 的 Ubuntu GNOME 15.10。
信息更新:
我将我的机器升级到带有 GNOME 3.20 的 Ubuntu GNOME 16.04,我不记得是qemu
在升级之前还是之后重新安装的,但我连同软件包一起安装了qemu-kvm
。virt-manager
但现在,即使清除了所有这三个,并且似乎删除了它们安装的所有依赖项,我仍然遇到问题。它似乎并没有真正删除他们对我的系统所做的所有更改。
例如这是来自的输出systemctl status qemu-kvm.service
:
● qemu-kvm.service - LSB: QEMU KVM module loading script
Loaded: loaded (/etc/init.d/qemu-kvm; bad; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2016-08-14 13:19:28 BST; 33min ago
Docs: man:systemd-sysv-generator(8)
Process: 2099 ExecStart=/etc/init.d/qemu-kvm start (code=exited, status=5)
Aug 14 13:19:28 <Computer-Name> systemd[1]: Starting LSB: QEMU KVM module loading script...
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Control process exited, code=exited status=5
Aug 14 13:19:28 <Computer-Name> systemd[1]: Failed to start LSB: QEMU KVM module loading script.
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Unit entered failed state.
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Failed with result 'exit-code'.
这是输出journalctl | grep qemu
:
Aug 14 13:19:23 <Computer-Name> ureadahead[866]: ureadahead:/lib/udev/rules.d/60-qemu-system-common.rules: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-alpha: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/lib/x86_64-linux-gnu/qemu/block-curl.so: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-arm: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/lib/x86_64-linux-gnu/qemu/block-iscsi.so: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/lib/x86_64-linux-gnu/qemu/block-dmg.so: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/lib/x86_64-linux-gnu/qemu/block-rbd.so: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-aarch64: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-cris: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-i386: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-lm32: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-m68k: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-microblaze: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-microblazeel: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-x86_64: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-ppc64: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-ppcemb: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-sh4: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-sh4eb: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-sparc: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-sparc64: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-unicore32: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-xtensaeb: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-mips: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-mips64el: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-mipsel: No such file or directory
Aug 14 13:19:24 >Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-or32: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-ppc: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-xtensa: No such file or directory
Aug 14 13:19:24 <Computer-Name> ureadahead[866]: ureadahead:/usr/bin/qemu-system-mips64: No such file or directory
Aug 14 13:19:25 <Computer-Name> systemd[1]: qemu-kvm.service: Control process exited, code=exited status=5
Aug 14 13:19:25 <Computer-Name> systemd[1]: qemu-kvm.service: Unit entered failed state.
Aug 14 13:19:25 <Computer-Name> systemd[1]: qemu-kvm.service: Failed with result 'exit-code'.
Aug 14 13:19:25 <Computer-Name> ureadahead[866]: ureadahead:/usr/share/qemu/init/qemu-kvm-init: No such file or directory
Aug 14 13:19:27 <Computer-Name> systemd[1]: qemu-kvm.service: Control process exited, code=exited status=5
Aug 14 13:19:27 <Computer-Name> systemd[1]: qemu-kvm.service: Unit entered failed state.
Aug 14 13:19:27 <Computer-Name> systemd[1]: qemu-kvm.service: Failed with result 'exit-code'.
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Control process exited, code=exited status=5
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Unit entered failed state.
Aug 14 13:19:28 <Computer-Name> systemd[1]: qemu-kvm.service: Failed with result 'exit-code'.
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-arm: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-armeb: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-cris: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-m68k: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-mips: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-mips64: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-mipsel: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-mips64el: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-ppc: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-ppc64: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-ppc64abi32: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-ppc64le: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-s390x: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-sh4: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-sh4eb: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-sparc: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-microblaze: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-sparc32plus: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-aarch64: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-alpha: No such file or directory
Aug 14 13:19:31 <Computer-Name> ureadahead[866]: ureadahead:/var/lib/binfmts/qemu-sparc64: No such file or directory
Aug 14 13:19:32 <Computer-Name> ureadahead[866]: ureadahead:/etc/libvirt/qemu/Ubuntu_GNOME_16-04_GNOME_3-18.xml: No such file or directory
Aug 14 13:19:32 <Computer-Name> ureadahead[866]: ureadahead:/etc/libvirt/qemu/Ubuntu_GNOME_16-10_GNOME_3-21.xml: No such file or directory
Aug 14 13:19:32 <Computer-Name> ureadahead[866]: ureadahead:/etc/libvirt/qemu/Ubuntu_Unity_16-04.xml: No such file or directory
Aug 14 13:19:32 <Computer-Name> ureadahead[866]: ureadahead:/etc/libvirt/qemu/Ubuntu_GNOME_16-04_GNOME_3-20.xml: No such file or directory
Aug 14 13:20:42 <Computer-Name> /usr/lib/gdm3/gdm-x-session[3320]: dbus-update-activation-environment: setting LIBVIRT_DEFAULT_URI=qemu:///system
显然 QEMU 并没有完全消失。但我希望它消失,那么如何才能彻底删除它以及它所做的所有更改呢?
当我运行时service --status-all | grep qemu
这是输出:
[ - ] qemu-kvm
因此,即使它可能不活跃,但它似乎存在,因为它目前似乎没有运行,我认为该-
标志可能表明其当前状态,因为许多其他服务都有+
标志。那么删除这项服务是否安全?如果是,该怎么做?
答案1
首先需要澄清的是:qemu
是一个元包,依赖于所有其他与 qemu 相关的包。
由于我使用synaptic
包管理工具,它可以保存所有时间的完整安装历史记录,因此我可以告诉您哪些包与 一起安装qemu
。
Commit Log for Thu Apr 21 18:34:38 2016
Installed the following packages:
cpu-checker (0.7-0ubuntu7)
ipxe-qemu (1.0.0+git-20150424.a25a16d-1ubuntu1)
libaio1 (0.3.110-2)
libboost-random1.58.0 (1.58.0+dfsg-5ubuntu3)
libboost-thread1.58.0 (1.58.0+dfsg-5ubuntu3)
libcacard0 (1:2.5.0-2)
libfdt1 (1.4.0+dfsg-2)
libiscsi2 (1.12.0-2)
librados2 (10.1.2-0ubuntu1)
librbd1 (10.1.2-0ubuntu1)
libspice-server1 (0.12.6-4)
libusbredirparser1 (0.7.1-1)
libxen-4.6 (4.6.0-1ubuntu4)
libxenstore3.0 (4.6.0-1ubuntu4)
msr-tools (1.3-2)
qemu (1:2.5+dfsg-5ubuntu10)
qemu-block-extra (1:2.5+dfsg-5ubuntu10)
qemu-slof (20151103+dfsg-1ubuntu1)
qemu-system (1:2.5+dfsg-5ubuntu10)
qemu-system-arm (1:2.5+dfsg-5ubuntu10)
qemu-system-common (1:2.5+dfsg-5ubuntu10)
qemu-system-mips (1:2.5+dfsg-5ubuntu10)
qemu-system-misc (1:2.5+dfsg-5ubuntu10)
qemu-system-ppc (1:2.5+dfsg-5ubuntu10)
qemu-system-sparc (1:2.5+dfsg-5ubuntu10)
qemu-system-x86 (1:2.5+dfsg-5ubuntu10)
qemu-user (1:2.5+dfsg-5ubuntu10)
qemu-user-binfmt (1:2.5+dfsg-5ubuntu10)
qemu-utils (1:2.5+dfsg-5ubuntu10)
seabios (1.8.2-1ubuntu1)
sharutils (1:4.15.2-1)
要删除所有qemu
相关软件包 - 打开终端并执行以下命令:
sudo apt-get purge cpu-checker ipxe-qemu libaio1 libboost-random1.58.0 libboost-thread1.58.0 libcacard0 libfdt1 libiscsi2 librados2 librbd1 libspice-server1 libusbredirparser1 libxen-4.6 libxenstore3.0 msr-tools qemu qemu-block-extra qemu-slof qemu-system qemu-system-arm qemu-system-common qemu-system-mips qemu-system-misc qemu-system-ppc qemu-system-sparc qemu-system-x86 qemu-user qemu-user-binfmt qemu-utils seabios sharutils
注意:这是来自 Ubuntu 16.04 的 - 如果单个包(例如:libboost-random1.58.0)在 Ubuntu 15.10 中有不同的名称,您可以使用 进行检查dpkg --get-selections
。但大多数包应该具有相同的名称...现在您已经完全删除了 的所有痕迹qemu
。
wily
我已经检查了包裹packages.ubuntu.com我发现了一个名称不同的包:libxen-4.6
即-wily
因此libxen-4.5
您必须在purge
命令中替换它。您也可以考虑保留这些lib
包,以防万一。
更新解决您的评论,您仍然有一个未运行的 qemu-kvm 服务列出:
这是您额外安装该包时运行的启动服务qemu-kvm
。
您有两个选择,您可以使用 禁用服务systemctl disable qemu-kvm
,也可以使用 删除服务sudo rm /etc/init.d/qemu-kvm
。要删除配置文件,请执行sudo rm /etc/init/qemu-kvm.conf
。现在重新启动系统 - 服务将消失。
答案2
您可以使用
sudo apt-get purge --auto-remove qemu-kvm
这将删除所有相关的 qemu 文件和文件夹