Score:1

Whoopsie is stopping me from upgrading from 18.10

in flag

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?

guiverc avatar
cn flag
You didn't say if this was a desktop or server install. Especially if it was a desktop install; I'd just *upgrade via re-install* as if you don't format, it won't erase your files & *manually installed* packages will get automatically re-installed (if they exist on the new release); as it's an upgrade method that allows you skip upgrades easily. Backup of course first; and if it's a server install - some restores maybe required (desktop apps store *conf* files in $HOME which won't be touched unless you format; server apps are not).
pLumo avatar
in flag
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. Upgrading will cost you the whole day, and you will see many issues on the way. Reinstall is done in an hour.
Michael Hill avatar
in flag
Sorry, it's a desktop install. I tried all the options the other person mentioned below, but with no luck. Looks like I am doing a fresh install. Thanks for the help.
guiverc avatar
cn flag
If you install (desktop) without format (*something else* or *manual partitioning* and select your existing partition(s) but do not format), it'll cause the installer to (1) note your installed package(s); ie. those you added or *manually installed*, (2) erase system directories, (3) install new system, (4) add back the manually installed packages noted earlier IF available in Ubuntu repositories for your new release, and (5) ask to reboot. No user file in $HOME (ie. your user directory) is touched IF you didn't format. Of course you should backup first (just like before *release-upgrades*)
guiverc avatar
cn flag
the prior comment refers to what I like calling *upgrade via re-install* (the Lubuntu testcase calls it *install using existing partition* being a testcase for them) and allows for skipping of releases; going forwards/backwards. When 21.04 reaches EOL early next year; I'll use it to *bump* the machine to 22.04 without losing package(s), my music etc.. I'll then not upgrade the install, but re-install once per week until release as a QA-test (possibly using that partition to return install to 20.04.4 which is released feb-2022 too; alternating between the two). It's great if no 3rd party...
guiverc avatar
cn flag
If you want an easy upgrade path; please take note of when a release goes EOL (https://fridge.ubuntu.com/2019/07/19/ubuntu-18-10-cosmic-cuttlefish-end-of-life-reached-on-july-18-2019/) as before that date it's easy; but gets much harder sometime after that; esp. when the next release (ie. 19.04) reaches EOL as well (ie. intended upgrade path is now gone!) Ubuntu 18.10 tells you it's the 2018-October release (ie. *year.month* in format) which had 9 months; 2018-October + 9 = 2019-July EOL; easily calculated from 18.10 (2018-October); or 3 months after the next release (ie. 19.04 or 2019-April)
Score:1
my flag

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/

Michael Hill avatar
in flag
Seriously, thank you for taking the time to type all of that. I'm afraid none of it worked though, most gave me the same error's with whoopsie. I guess I'm doing a fresh install.
Someone avatar
my flag
@MichaelHill No worries, None of that worked? That can not be possible! What is the output of those?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.