How do you remove a "bad" installation of xboxdrv-ubuntu

7,589

You can get bluntly past this by just getting rid of the pre-removal script. This is a last resort, but useful for dealing with broken packaging scripts, which seems to be the case here.

Instead of actually deleting the script, I'll post a command that merely renames the script, just for safety.
sudo mv /var/lib/dpkg/info/ubuntu-xboxdrv.prerm /var/lib/dpkg/info/ubuntu-xboxdrv.prerm.broken

After that, re-run the purge command: sudo apt-get purge ubuntu-xboxdrv

You may still get an error, but it should be a different one. If that is the case, make sure to post the text of the new error message.

Additionally, it looks like there is a ppa for xboxdrv that may have a better package: https://launchpad.net/~rael-gc/+archive/ubuntu/ubuntu-xboxdrv

You may want to check that out after you get the current package removed.

Share:
7,589
user1524705
Author by

user1524705

Updated on September 18, 2022

Comments

  • user1524705
    user1524705 almost 2 years

    I tried to use XboxDRV-Ubuntu today.

    I think the install is corrupted, because there is no joystick thing in the settings (worked quite a few days ago), joysticks aren't detected, etc. The application still runs, but doesn't seem to be complete compared to how it used to be. Installing it again says it's already installed and aborts.

    Uninstallation: XboxDRV uninstalls successfully with

    sudo apt-get purge xboxdrv
    

    The following is output:

    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.
    

    Afterwards, I attempted to remove ubuntu-xboxdrv as follows:

    sudo apt-get purge ubuntu-xboxdrv
    

    The results I got were these:

    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)
    

    After this, I typed

    sudo apt-get autoremove
    

    The results are excessively long to put in a block, so here's the output:

    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.
    

    Followed up with:

    sudo apt-get autoremove -f
    

    Results (Also too long to block with each line)

    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) ...
    

    The end result: Now I have a still-broken xboxdrv installation, and no nvidea driver support.

    • αғsнιη
      αғsнιη almost 10 years
      Didn't try with this one sudo apt-get purge xboxdrv-ubuntu*?