如何删除 xboxdrv-ubuntu 的“错误”安装

如何删除 xboxdrv-ubuntu 的“错误”安装

我今天尝试使用 XboxDRV-Ubuntu。

我认为安装已损坏,因为设置中没有操纵杆(几天前还有效),未检测到操纵杆等。该应用程序仍在运行,但与以前相比似乎不完整。再次安装时显示已安装并中止。

卸载:XboxDRV 成功卸载

sudo apt-get purge xboxdrv

输出如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done

The following packages were automatically installed and are no longer required:
  jstest-gtk linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
  linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
  primus-libs socat
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  ubuntu-xboxdrv* xboxdrv*
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 1,820 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 256045 files and directories currently installed.)
Removing ubuntu-xboxdrv (20140707-1) ...
stop: Unknown instance: 
dpkg: error processing package ubuntu-xboxdrv (--purge):
 subprocess installed pre-removal script returned error exit status 1
dpkg: xboxdrv: dependency problems, but removing anyway as you requested:
 ubuntu-xboxdrv depends on xboxdrv.

之后,我尝试删除 ubuntu-xboxdrv,如下所示:

sudo apt-get purge ubuntu-xboxdrv

我得到的结果如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  jstest-gtk linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
  linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
  primus-libs socat
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  ubuntu-xboxdrv*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 71.7 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 255996 files and directories currently installed.)
Removing ubuntu-xboxdrv (20140707-1) ...
stop: Unknown instance: 
dpkg: error processing package ubuntu-xboxdrv (--purge):
 subprocess installed pre-removal script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)

之后,我输入

sudo apt-get autoremove

结果太长,无法放入块中,因此输出如下:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 ubuntu-xboxdrv : Depends: xboxdrv but it is not installed
E: Unmet dependencies. Try using -f.

接下来是:

sudo apt-get autoremove -f

结果(每行也太长,无法阻止)

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  xboxdrv
The following packages will be REMOVED:
  linux-headers-3.13.0-32 linux-headers-3.13.0-32-generic
  linux-image-3.13.0-32-generic linux-image-extra-3.13.0-32-generic
  primus-libs socat
The following NEW packages will be installed:
  xboxdrv
0 upgraded, 1 newly installed, 6 to remove and 0 not upgraded.
Need to get 0 B/663 kB of archives.
After this operation, 270 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 255996 files and directories currently installed.)
Removing linux-headers-3.13.0-32-generic (3.13.0-32.57) ...
Removing linux-headers-3.13.0-32 (3.13.0-32.57) ...
Removing linux-image-extra-3.13.0-32-generic (3.13.0-32.57) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-35-generic
Found initrd image: /boot/initrd.img-3.13.0-35-generic
Found linux image: /boot/vmlinuz-3.13.0-34-generic
Found initrd image: /boot/initrd.img-3.13.0-34-generic
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found linux image: /boot/vmlinuz-3.13.0-35-generic
Found initrd image: /boot/initrd.img-3.13.0-35-generic
Found linux image: /boot/vmlinuz-3.13.0-34-generic
Found initrd image: /boot/initrd.img-3.13.0-34-generic
Found linux image: /boot/vmlinuz-3.13.0-32-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Removing linux-image-3.13.0-32-generic (3.13.0-32.57) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
dkms: removing: nvidia-331 331.38 (3.13.0-32-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  nvidia-331
Version: 331.38
Kernel:  3.13.0-32-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

nvidia_331.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.13.0-32-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod.....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-32-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-32-generic /boot/vmlinuz-3.13.0-32-generic
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.13.0-35-generic
Found initrd image: /boot/initrd.img-3.13.0-35-generic
Found linux image: /boot/vmlinuz-3.13.0-34-generic
Found initrd image: /boot/initrd.img-3.13.0-34-generic
Found linux image: /boot/vmlinuz-3.13.0-35-generic
Found initrd image: /boot/initrd.img-3.13.0-35-generic
Found linux image: /boot/vmlinuz-3.13.0-34-generic
Found initrd image: /boot/initrd.img-3.13.0-34-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
Removing primus-libs:amd64 (20131127-1~trustyppa1) ...
Removing socat (1.7.2.3-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Processing triggers for doc-base (0.10.5) ...
Processing 1 removed doc-base file...
Selecting previously unselected package xboxdrv.
(Reading database ... 226344 files and directories currently installed.)
Preparing to unpack .../xboxdrv_0.8.5-1_amd64.deb ...
Unpacking xboxdrv (0.8.5-1) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up xboxdrv (0.8.5-1) ...

最终结果:现在我的 xboxdrv 安装仍然损坏,并且没有 nvidea 驱动程序支持。

答案1

只需删除预移除脚本即可轻松解决这个问题。这是最后的手段,但对于处理损坏的打包脚本很有用,这里似乎就是这种情况。

我不会真正删除该脚本,而是发布一个仅重命名该脚本的命令,只是为了安全起见。
sudo mv /var/lib/dpkg/info/ubuntu-xboxdrv.prerm /var/lib/dpkg/info/ubuntu-xboxdrv.prerm.broken

此后,重新运行清除命令:sudo apt-get purge ubuntu-xboxdrv

您可能仍会收到错误,但错误应该有所不同。如果是这种情况,请确保发布新错误消息的文本。

此外,看起来 xboxdrv 有一个 ppa,可能有更好的软件包:https://launchpad.net/~rael-gc/+archive/ubuntu/ubuntu-xboxdrv

您可能需要在删除当前包之后检查一下。

相关内容