Results 1 to 6 of 6

Thread: How do I remove a broken package?

  1. #1
    Join Date
    Aug 2011
    Beans
    10

    Question How do I remove a broken package?

    emacs-snapshot from Cassou's repository is broken on my system. When I try to sudo apt-get autoremove/clean/update/upgrade/install/remove, all halt with an error pertaining to the broken package. sudo dpkg -install -f and sudo apt-get --configure -a don't work either, and neither do any of these operations in synaptic ('fix broken packages' included). The error, common to any of these that will output it, is 'Byte compilation for emacs-snapshot failed.'

    I can't upgrade or install anything because this package is locking up my system.

  2. #2
    Join Date
    Feb 2010
    Location
    WI USA
    Beans
    10,443
    Distro
    Ubuntu Development Release

    Re: How do I remove a broken package?

    You need to insert correct package name at the end each of these commands. Check your software and update sources if you use the second command successfully.

    Code:
    sudo dpkg --remove --force-remove-reinstreq package name here
    Code:
    sudo dpkg --remove -force --force-remove-reinstreqgrep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* package name here
    Last edited by Frogs Hair; September 18th, 2013 at 09:09 PM.
    Infinite diversity in infinite combination.

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Manual

  3. #3
    Join Date
    Aug 2011
    Beans
    10

    Re: How do I remove a broken package?

    The first command failed (I didn't try the second line in case these needed to be executed in order)--here is the raw terminal output:

    helasraizam@Hela:~$ sudo dpkg --remove --force-remove-reinstreq emacs-snapshot
    [sudo] password for helasraizam:
    Sorry, try again.
    [sudo] password for helasraizam:
    Sorry, try again.
    [sudo] password for helasraizam:
    (Reading database ... 1326398 files and directories currently installed.)
    Removing emacs-snapshot ...
    Cleaning up add-on packages... failed.

    !! emacs-remove emacs-snapshot failed!
    !! Please file a bug report against emacs-snapshot
    !! and attach the file /tmp/emacs-snapshot.H5urio
    dpkg: error processing emacs-snapshot (--remove):
    subprocess installed pre-removal script returned error exit status 1
    Byte-compiling add-on packages, please wait... failed.

    !! Byte-compilation for emacs-snapshot failed!
    !! This indicates a bug in one of the add-on packages
    !! installed on your system, or a bug in Emacs itself.
    !! Please file a bug report against emacs-snapshot
    !! and attach the file /tmp/emacs-snapshot.IJ09vM
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    emacs-snapshot

  4. #4
    Join Date
    Feb 2010
    Location
    WI USA
    Beans
    10,443
    Distro
    Ubuntu Development Release

    Re: How do I remove a broken package?

    They are both force remove commands and the second is not dependent on the first . I have used both.
    Infinite diversity in infinite combination.

    Ubuntu Documentation Search: Popular Pages
    Ubuntu: Security Basics
    Ubuntu: Manual

  5. #5
    Join Date
    Aug 2011
    Beans
    10

    Re: How do I remove a broken package?

    The output of
    Code:
    sudo dpkg --remove -force --force-remove-reinstreqgrep ^ /etc/apt/sources.list /etc/apt/sources.list.d/* emacs-snapshot
    is

    Code:
    dpkg: error: conflicting actions -f (--field) and -r (--remove)
    
    Type dpkg --help for help about installing and deinstalling packages [*];
    Use `dselect' or `aptitude' for user-friendly package management;
    Type dpkg -Dhelp for a list of dpkg debug flag values;
    Type dpkg --force-help for a list of forcing options;
    Type dpkg-deb --help for help about manipulating *.deb files;
    
    Options marked [*] produce a lot of output - pipe it through `less' or `more' !

  6. #6
    Join Date
    Aug 2011
    Beans
    10

    Re: How do I remove a broken package?

    This problem has not been solved, and unfortunately my system is unable to update or install anything at all until the emacs package issue is resolved. I tried various renditions of the provided code, by the way, without avail (but thanks for the advice!)

    So the question still stands, how do I remove this stubborn broken package? This is an important question, as package management is a core concept of an operating system, and removing a broken package should always, always be possible (especially if it locks apt-get).

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •