PDA

View Full Version : [gnome] 8.04: Cannot uninstall broken package and Synaptic is hosed



nipri
April 29th, 2008, 01:59 PM
Hello All!

I used alien and dpkg to convert / install an .rpm package. For whatever reason (broken dependencies?) the package did not install properly. Now, the update manager is giving me an error telling me that the package is in an "inconsistent state" and needs to be uninstalled / reinstalled. When I use the update manager, dpkg or apt-get to uninstall the package, they tell me that "no archive can be found for it" and the uninstall fails. Furthermore, when I attempt to start the Synaptic Package Manager, it returns an error... "Internal error opening cache(1). Please report" and then shuts down.

How can I simply uninstall this package, fix Synaptic and be done with it? I do not want to reinstall it.

Thank You in advance.

Pumalite
April 29th, 2008, 02:13 PM
Have you tried the usual?:
sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade

nipri
April 29th, 2008, 02:27 PM
Hi!

All of these options simply return the message "The package <package name> needs to be reinstalled but I can't find an archive for it" and then quits.

Do I need to move the package file to a specific directory? (I'm still somewhat new to Debian / Ubuntu) The package file I tried to install is currently located in a directory I use for downloading stuff.

Pumalite
April 29th, 2008, 02:31 PM
Try this:
sudo dpkg --remove --force-remove-reinstreq <packagename>

graphius
April 29th, 2008, 02:46 PM
After an upgrade to Heron (8.04) my Synaptic followed the same symptoms, ie it would crash immediately after opening. In another thread I found out it was an issue with sudo. using gksudo, edit the /etc/hosts

gksudo gedit /etc/hosts
on the line that looks like


127.0.1.1 <my computer>.<my domain>

remove the .<my domain> so that it looks like


127.0.1.1 <my computer>

save the file.

Synaptic should now work.

nipri
April 29th, 2008, 02:52 PM
Hi!

Here's what I get....



nick@nci3:~/downloads/cdk4msp$ sudo dpkg --remove --force-remove-reinstreq cdk-msp-examples-libc
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 ... 111857 files and directories currently installed.)
Removing cdk-msp-examples-libc ...
/var/lib/dpkg/info/cdk-msp-examples-libc.prerm: 2: pushd: not found
************************************************** ********
***** erase binaries and prog-files project in:
/home/nick/downloads/cdk4msp

removed `easyweb.lst'

***** E N D
************************************************** ********
/var/lib/dpkg/info/cdk-msp-examples-libc.prerm: 11: popd: not found
dpkg: error processing cdk-msp-examples-libc (--remove):
subprocess pre-removal script returned error exit status 127
/var/lib/dpkg/info/cdk-msp-examples-libc.postinst: 2: pushd: not found
************************************************** ********
***** rebuild project in:
/home/nick/downloads/cdk4msp


--> easyweb
/var/lib/dpkg/info/cdk-msp-examples-libc.postinst: 11: msp430-gcc: not found
--> easyweb.lst
msp430-objdump: easyweb: No such file or directory
--> easyweb.bin
msp430-objcopy: easyweb: No such file or directory
--> easyweb.ihex
msp430-objcopy: easyweb: No such file or directory
--> easyweb.srec
msp430-objcopy: easyweb: No such file or directory

***** E N D
************************************************** ********
/var/lib/dpkg/info/cdk-msp-examples-libc.postinst: 23: popd: not found
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 127
Errors were encountered while processing:
cdk-msp-examples-libc

nipri
April 29th, 2008, 03:08 PM
Hi!

I checked my hosts file and .mydomain isn't specified already (i.e. it looks like what you suggest)

bigken
April 29th, 2008, 03:15 PM
I had similar problem with a package so I went into /var/lib/dpkg/info and deleted everything to do with the broken package and it worked

nipri
April 29th, 2008, 03:26 PM
Just looked into /var/lib/dpkg/info and there are no entries that correspond to the broken package. Actually, I installed some 8 other packages using alien / dpkg (all part of a cross-development kit for an MPU) and none of them appear in /var/lib/dpkg/info

nipri
April 29th, 2008, 03:44 PM
In looking at the output I posted above from <sudo dpkg --remove --force-remove-reinstreq cdk-msp-examples-libc> it looks like dpkg is complaining about the fact that it can't find what it's looking for in /var/lib/dpkg/info. It looks like dpkg didn't create the files in /var/lib/dpkg/info that it was supposed to for these packages I installed!

nipri
April 29th, 2008, 07:28 PM
Thanks Anyway....

bigken
April 29th, 2008, 07:33 PM
try this in a terminal

sudo dpkg --reconfigure -a

nipri
April 29th, 2008, 08:08 PM
sudo dpkg-reconfigure -a

Didn't work

nipri
April 29th, 2008, 08:12 PM
Since this is a new installation, I might just wipe it and downgrade to 7.1

There are a few other things about this version that I don't like anyway.

bigken
April 29th, 2008, 08:19 PM
sudo dpkg-reconfigure -a

Didn't work


its sudo dpkg --configure -a sorry my fault

nipri
April 29th, 2008, 08:29 PM
Nope, just returns and does nothing

Convert
April 29th, 2008, 08:34 PM
I'm a noob and so take any advice from me with a kilo of salt, however, this seems to be a very common failed install problem where a package isn't set up right, or a dependency cannot be installed for some reason, and Synaptic Package Manager (SPM) can't deal with a partial install or a failed install. One would think that SPM would be fixed so that it could handle this situation, considering how many posts you can find with the same issue.

In any case, try editing the file /var/lib/dpkg/status and remove the lines about the package that is failing. (I saw an earlier post about editing the info file, I am suggesting editing the status file)

At least, I had the same problem a while ago and this worked for me.

zvacet
April 29th, 2008, 08:35 PM
locate package_name

and then go to the every directory in which your package is and remove it manualy.It it good to run ls before you actualy delete file,just to see it and which is real name.Command to remove it is


sudo rm -r package_name

nipri
April 29th, 2008, 09:16 PM
Yup, that did it!

I'm sorta a nubie also to Debian / Ubuntu and so I'm not all that familiar yet with dpkg. So Im really glad to know about the status file! I also did an updatedb and a locate <package name> and verified that it no longer exists anywhere

Thanks Again!

Convert
April 30th, 2008, 03:45 AM
No problem, glad I could help.

I just switched my personal computer to Ubuntu thanks mostly to that disaster they call "Vista" (thank you, Microsoft) and my experiences so far is bringing back memories. I forgot how much you pick up thinks until you have problems.

Of course, I also think this problem/simple fix characterizes a real issue with Linux in that not enough testing is done (or maybe it's just that things are changing too fast). Whatever. I hope that I can start reporting some of the hundred's of bugs that I have found in Ubuntu v7.10., now that we are moving to a long term support version.