Whoopsie is stopping me from upgrading from 18.10

I'm attempting to upgrade from 18.10 Cosmic. Whoopsie is causing issues. I can't uninstall it, and it won't let me stop it. Is there a way around this so I can finish the upgrade?

Sorry if I'm missing something obvious. I haven't really messed with Linux in years and I'm trying to get this old laptop back up and running.

Preparing to unpack .../whoopsie_0.2.69ubuntu0.3_amd64.deb ...
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to stop whoopsie.service: Access denied
See system logs and 'systemctl status whoopsie.service' for details.
invoke-rc.d: initscript whoopsie, action "stop" failed.
dpkg: warning: old whoopsie package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to stop whoopsie.service: Access denied
See system logs and 'systemctl status whoopsie.service' for details.
invoke-rc.d: initscript whoopsie, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/whoopsie_0.2.69ubuntu0.3_amd64.deb (--unpack):
 new whoopsie package pre-removal script subprocess returned error exit status 1
Failed to reload daemon: Access denied
Failed to reload daemon: Access denied
Failed to retrieve unit state: Access denied
Failed to start whoopsie.service: Access denied
See system logs and 'systemctl status whoopsie.service' for details.
invoke-rc.d: initscript whoopsie, action "start" failed.
Failed to get properties: Access denied
dpkg: error while cleaning up:
 installed whoopsie package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/whoopsie_0.2.69ubuntu0.3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
room@room-pc:~$ 

If I try to stop it:

room@room-pc:~$ sudo systemctl stop whoopsie
Failed to stop whoopsie.service: Access denied
See system logs and 'systemctl status whoopsie.service' for details.
room@room-pc:~$ 

If I try to remove it:

The following packages will be REMOVED:
  whoopsie*
0 upgraded, 0 newly installed, 1 to remove and 668 not upgraded.
973 not fully installed or removed.
After this operation, 109 kB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: error processing package whoopsie (--remove):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting a removal
dpkg: too many errors, stopping
Errors were encountered while processing:
 whoopsie
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
room@room-pc:~$ 

So, how can I fix this and upgrade the system successfully?


As mentioned by pLumo, If you want to upgrade then

Backup your stuff and reinstall a supported version. There is no upgrade path for you. To go to a supported version you would need to use this path 18.10 -> 19.04 -> 19.10 -> 20.04, but 19.04 and 19.10 are also not supported.

Note - I am just telling you how to fix errors while installing.

Short answer

A simple and working fix would be to force overwrite the problem packages and reinstall them

Simply run:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/whoopsie_0.2.69ubuntu0.3_amd64.deb

Long answer

Introduction

The error message Sub-process /usr/bin/dpkg returned an error code (1) indicates a problem with the package installer. This can happen in Ubuntu after a failed software installation, or if the installer becomes corrupted.

The key phrase in this error is /usr/bin/dpkg. This refers to the dpkg package installer for Linux. A package installer is an application that tracks software, updates, and dependencies. If it is damaged, any new software installation will cause this error message.

We cover several possible solutions, from easily-solved and straightforward solutions to more complex processes. This guide will help you resolve the dpkg returned an error code 1 on an Ubuntu operating system.

Methods covered in this answer

  • Method 1: Reconfigure dpkg Database.

  • Method 2: Force-Install the Software.

  • Method 3: Remove Bad Software Package.

  • Method 4: Clean Out Unused Software Packages.

  • Method 5: Overwrite Package File.

  • Method 6: Remove Post Files.

Sample error

Errors were encountered while processing:
google-chrome-stable
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here you can see the problem_package is google-chrome-stable, but in your case, it is whoopsie

Method 1: Reconfigure the dpkg database

One of the triggers of this error is a corrupted dpkg database. This can be caused by the sudden interruption of the installation of a software package. Reconfiguring the database is one way to resolve this issue.

To do this, simply execute the command:

$ sudo dpkg --configure -a

This reconfigures the unpacked packages that were not installed during the installation process.

Method 2: Force-Install the Software

run the following command to perform force install:

$ sudo apt-get install -f

Or,

$ sudo apt-get install --fix-broken

Here, -f (or --fix-broken) option will attempt to correct the Ubuntu system with broken dependencies.

Remove error packages

If you know which software caused the errors on your system, you can remove it.

Enter the command and package_name with the name of the software that is causing the problem:

sudo apt-get remove --purge package_name

The --purge option directs the system to remove config files in addition to uninstalling. This helps get rid of all traces of the offending software.

Clear out unused software packages.

To perform this action simple run:

sudo apt autoremove

The autoremove option just clears out unwanted software.

Overwrite/remove Package files

A few times a few packages are stuck in apt, which sometimes start causing errors.

To overwrite those files (This will reinstall the problem packages too)

sudo dpkg -i --force-overwrite /var/cache/apt/archives/package_name.deb

sudo apt -f install

force install is optional

If you want to remove those files (this will not reinstall the package)

sudo rm -rf /var/cache/apt/archives/*.deb

sudo apt -f install

Remove post files associated with the package

This should be your last resort.

Lastly, you can manually remove all the associated with the troublesome package. First, you need to find these files which are located in the /var/lib/dpkg/info directory as shown.

$ sudo ls -l /var/lib/dpkg/info | grep -I package_name

After listing the files, you can move them to the /tmp directory as shown

$ sudo mv /var/lib/dpkg/info/package-name.* /tmp

Alternatively, you can use the rm command to manually remove the files.

$ sudo rm -r /var/lib/dpkg/info/package-name.*

Finally, update the package lists as shown:

$ sudo apt update

You can thereafter give it another shot in reinstalling the software package.

Another working solution

As suggested by N0rbert you should try to reinstall the problem packages

export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

cd ~/Downloads
apt-get download python3-minimal
sudo -E dpkg -i --force-all ./python3-minimal*.deb

sudo -E dpkg --configure -a
sudo -E apt-get install -f
sudo -E apt-get install --reinstall python3-minimal
sudo -E apt-get install --reinstall $(dpkg -l | grep ^ii | grep python | awk '{print $2}')
sudo -E dpkg --configure -a
sudo -E apt-get install -f

sudo -E apt-get install aptitude
sudo -E aptitude safe-upgrade
sudo -E aptitude dist-upgrade
mkdir ~/Downloads/debs
cd ~/Downloads/debs
apt-get download package_name 

sudo dpkg -i --force-all ./package_name*.deb

Generally, this should work :)

Conclusion

The dpkg error message indicates that there is a problem with the package installer, which is commonly caused by an interrupted installation process or a corrupted database.

By following these steps, you should now have several methods to fix the dpkg error message and attain a working package installer.

Credits to:

https://phoenixnap.com/kb/fix-sub-process-usr-bin-dpkg-returned-error-code-1

https://www.tecmint.com/sub-process-usr-bin-dpkg-returned-an-error-in-ubuntu/amp/

https://ostechnix.com/fix-sub-process-usr-bin-dpkg-returned-an-error-code-1-in-ubuntu/