LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   messed up dpkg - google-chrome-stable Package is in a very bad inconsistent state (https://www.linuxquestions.org/questions/linux-software-2/messed-up-dpkg-google-chrome-stable-package-is-in-a-very-bad-inconsistent-state-4175498370/)

ilesterg 03-16-2014 06:09 AM

messed up dpkg - google-chrome-stable Package is in a very bad inconsistent state
 
Hi all,

I previously tried to install google chrome in a custom location and ended up with the following error message:

Code:

poo@rocket:/home/applications/chrome$ sudo dpkg --instdir=/home/applications/chrome/ -i google-chrome-stable_current_i386\(1\).deb
Selecting previously unselected package google-chrome-stable.
(Reading database ... 157321 files and directories currently installed.)
Preparing to replace google-chrome-stable 33.0.1750.152-1 (using google-chrome-stable_current_i386(1).deb) ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg: trying script from the new package instead ...
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error processing google-chrome-stable_current_i386(1).deb (--install):
 subprocess new pre-removal script returned error exit status 2
dpkg (subprocess): admindir must be inside instdir for dpkg to work properly
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 google-chrome-stable_current_i386(1).deb
poo@rocket:/home/applications/chrome$

I can no longer install any other software in my system. I even tried

Code:

sudo dpkg --remove --force-remove-reinstreq google-chrome-stable
but nothing good happened :(

Code:

poo@rocket:~$ sudo apt-get install k9copy
[sudo] password for poo:
Reading package lists... Done
Building dependency tree     
Reading state information... Done
E: The package google-chrome-stable needs to be reinstalled, but I can't find an archive for it.
poo@rocket:~$ sudo dpkg --remove --force-remove-reinstreq google-chrome-stable
dpkg: warning: overriding problem because --force enabled:
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
(Reading database ... 159625 files and directories currently installed.)
Removing google-chrome-stable ...
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error processing google-chrome-stable (--remove):
 subprocess installed pre-removal script returned error exit status 1
xdg-icon-resource: size argument must be numeric
Try 'xdg-icon-resource --help' for more information.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 google-chrome-stable
poo@rocket:~$

How do I just clean google-chrome-stable out of my system, or, as the error suggests, complete the install first? Many thanks!

ilesterg 03-16-2014 09:38 AM

just to add,

Code:

sudo apt-get install -f
doesn't help either :(

ilesterg 03-16-2014 09:41 AM

I tried opening Synaptic Package Manager and got this:
Code:

E: The package google-chrome-stable needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.


ilesterg 03-16-2014 10:36 AM

Finally!!!!!!

This did the trick:

Code:

sudo find /var/lib/dpkg -exec grep -l "google-chrome-stable" {} \;

sudo gedit /var/lib/dpkg/info/google-chrome-stable.prerm

added exit 0 as the first line, then

Code:

sudo dpkg -P google-chrome-stable
cheers!!

credits to this

pHantom7 07-03-2014 11:10 AM

Thanks
 
@ilesterg thanks man! Tried creating a symbolic link of java for chrome and don't know how, but in the process messed up with chrome. This really helped :)
Cheers

ilesterg 07-03-2014 02:45 PM

No problem.

zvolsky 12-30-2015 01:30 AM

Thanks
 
Nice trick.

Rasthro 02-09-2022 12:46 AM

I also have this problem,The solution wont work for me :(
 
user@LAPTOP-AUT1G625:~$ sudo dpkg --purge google-chrome-stable
dpkg: error processing package google-chrome-stable (--purge):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
google-chrome-stable

shruggy 02-09-2022 03:46 AM

1. Don't hijack a solved thread, open your own.

2. What is your Linux distribution including release and architecture? What is the Google Chrome version you're trying to remove?

3. Did you try to reinstall the package as suggested in the message? What was the result?

4. Why are you trying to remove it with dpkg in the first place? Did a previous attempt with apt failed? If so, what was the error message?

5. Provide the output of
Code:

dpkg -C google-chrome-stable
dpkg -V google-chrome-stable

6. What you quoted couldn't be the only error message output by dpkg. Were all the other messages exactly the same as in the top post of this thread?

7. You said the trick suggested in the thread didn't work for you. That is a very advanced trick involving editing the pre-removal script of a package. Did you understand it? Did you correctly apply it?


All times are GMT -5. The time now is 10:33 AM.