Crash during upgrade left package unable to upgrade or remove

I was doing an upgrade when my laptop crashed. I ran 'sudo dpkg --configure -a' but I still can't upgrade, reinstall or uninstall the package. I get this message in the terminal:

dpkg: error processing package firefox-mozilla-build (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Errors were encountered while processing:
firefox-mozilla-build
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any ideas on how to remove, reinstall, or upgrade 'firefox-mozilla-build'?
I use the official ubuntuzilla reppository which I have installed as I use their Thunderbird and Seamonkey too.

I tried this to no avail, but I am terrible with the terminal and usually get some syntax wrong when I replace the package name. In other words I need to copy and paste for 'firefox-mozilla-build as I get something wrong every time when replacing [package name]. Any help would be appreciated

Some time ago my system suffered from broken packages hell. The rescue was brought by aptitude. It managed cancel pending actions as well as detect and fix packaging system's misbehaviour.

What command would I use?

You may have to install aptitude first and invoke it from command line as aptitude. It has TUI interface.

1 Like

Okay I will give it a try.

I installed it and canceled pending actions but still get the same message in the terminal. the resolver did give me any options.

sudo apt remove package
sudo apt reinstall package
sudo apt upgrade package

where package is a package name if you have added its repository or file name like ./<package>.deb (i.e. file in the current directory).

By the way, is

a real .deb package?

Did you try this ?:

sudo dpkg --force-remove-reinstreq firefox-mozilla-build

jim@j-laptop:~$ sudo dpkg --force-remove-reinstreq firefox-mozilla-build
[sudo] password for jim:
dpkg: error: need an action option

Type dpkg --help for help about installing and deinstalling packages [*];
Use 'apt' 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' !
jim@j-laptop:~$

Oops, forgot the most important argument ( -r )

sudo dpkg -r --force-remove-reinstreq firefox-mozilla-build

Tried that after right after doing sudo dpkg --configure -a. I don't believe it was an interruption as much as it corrupted the file. Here is the installation instructions and removal instructions. I is .deb because it is in Synpatic, which I also tried to remove or upgrade it.
sudo dpkg --configure -a

Installation

  • It is strongly recommended to make a backup of your Firefox/Thunderbird/Seamonkey user profile, just in case. This is stored in your home directory. Firefox and Seamonkey profiles are stored in the .mozilla directory, Thunderbird profile is stored in .thunderbird or .mozilla-thunderbird directory.
  • Add the ubuntuzilla repository to your /etc/apt/sources.list, either using your favorite editor, or by running the provided one-line command (copy and paste the entire line into a terminal, then press enter).

The repository to add, if you're adding it manually to your sources.list, is

deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main

and you can use the following command to add it to your sources.list in one step:

echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | sudo tee -a /etc/apt/sources.list > /dev/null

If you wish, verify that the repository has been added, by looking at /etc/apt/sources.list in your favorite text editor, or running "tail /etc/apt/sources.list" in the terminal.

  • Then add the package signing key to your keyring, by running the following command (note: new key as of 2016-11-15): sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2667CA5C
  • Update your package database: sudo apt-get update
  • Install your desired package, with one of the following commands: sudo apt-get install firefox-mozilla-build
    sudo apt-get install firefox-esr-mozilla-build
    sudo apt-get install thunderbird-mozilla-build
    sudo apt-get install seamonkey-mozilla-build

All of this can also be done through the GUI with the Synaptic Package Manager, if you so desire. See this step-by-step visual tutorial if you would like to try the GUI approach.

From here on, any updates will be offered to you through the usual channels in the Update Manager.

Localizations

The packages in the repos are 'en-US' (US English) versions. To install any other translations:

  • Download the appropriate language pack add-on .xpi file,
  • Install it from within Firefox/Thunderbird/Seamonkey (as you would with any other add-on).
  • Enable it by setting the config general.useragent.locale to the name of the locale that you want to use. The name of the locale is the same as the name of the language pack that you installed.
    • To edit the config, go to Edit -> Preferences -> Advanced -> General -> Config Editor.
  • Restart the application for the setting to take effect.

Firefox language packs are at

http://releases.mozilla.org/pub/mozilla.org/firefox/releases/<version>/linux-i686/xpi/

Thunderbird language packs are at

http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/<version>/linux-i686/xpi/

Seamonkey language packs are at

http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/<version>/langpack/

For more info about installing language packs, see this Mozilla knowledgebase article.

Removal

To uninstall the packages, uninstall the *-mozilla-build packages, using your favorite package manager. E.g., using apt-get:

sudo apt-get remove firefox-mozilla-build
sudo apt-get remove firefox-esr-mozilla-build
sudo apt-get remove thunderbird-mozilla-build
sudo apt-get remove seamonkey-mozilla-build

If I have to I will remove it manually (which I have done for programs before) and then install it as a tarball for now.

Out of curiosity, why are you trying to install firefox Debian package from SourceForge instead of directly from Mozilla ?

Given the current state of your Firefox install, I think I would personally plod thru manually to purge all related/broken elements and start from scratch. When things are broken, even the cleanup rules break on conditions that are encountered. :frowning:

I've used it for years and I didn't want snaps. I started using it for Seamonkey about 8 years ago. I can't figure out GitHub to save my life . Also at one time Google would not let me use Thunderbird as unsecured, but the ubuntuzilla version would work. It never has been a problem, the crash when it was upgrading caused the problem. It also offered Firefox esr which I wanted on some installations that didn't have it in the repository.

The packages contain unmodified official Mozilla release binaries, which fact you are encouraged to verify by comparing the checksums of package contents with checksums of the contents of the official Mozilla tar.bz2 release archives. As a matter of general principle, it is a good practice to perform some verification prior to running anything from any unfamiliar website. - ubuntuzilla

1 Like

Given the current state of your Firefox install, I think I would personally plod thru manually to purge all related/broken elements and start from scratch. When things are broken, even the cleanup rules break on conditions that are encountered.

I have done that before so will again. I don't see any other way to fix it. If it breaks the OS, I do good backups and it will only take a few minutes to do a reinstall, then a big longer to customize it. I will let you know how it goes in a while, no more time to work on it today. Thanks for verifying that for me Eric.

I used catfish to go through and remove every firefox entry I could in each folder in file system from bin to usr. I don't know how to get dpkg to quit reading it.
I then installed Firefox ESR as a tarball. It all works but I still get this error message when upgrading.

dpkg: error processing package firefox-mozilla-build (--configure):

  • package is in a very bad inconsistent state; you should*
  • reinstall it before attempting configuration*
    Errors were encountered while processing:
  • firefox-mozilla-build*
    E: Sub-process /usr/bin/dpkg returned an error code (1)

That is not a big deal and I will leave it at that for now.

Not sure, but it looks to me like there are Firefox-related leftovers in dpkg-specific work files.

I just don't know which ones. :frowning:

1 Like