LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Missing PreRemoval Script breaks dpkg. (https://www.linuxquestions.org/questions/linux-software-2/missing-preremoval-script-breaks-dpkg-4175440151/)

cov 12-05-2012 11:05 AM

Missing PreRemoval Script breaks dpkg.
 
I tried to purge the installation of a broken package, which I understood removed the entire package, configuration files, everything.

When I still couldn't install the package again, I looked at the files in /usr/lib/ and notioced that the packages files were still there.

This is where I did something really silly; I manually deleted directories containing the package.

I then downloaded the latest DEB files and tried to install the package from scratch.

This is the error I get:

Quote:

sudo dpkg -i Downloads/fpc_2.6.0-120824_amd64.deb
(Reading database ... 381019 files and directories currently installed.)
Preparing to replace fpc 2.7.1 (using .../fpc_2.6.0-120824_amd64.deb) ...
sed: can't read /usr/lib/fpc/2.7.1/fpc-cross.cfg: No such file or directory
dpkg: warning: subprocess old pre-removal script returned error exit status 2
dpkg - trying script from the new package instead ...
sed: can't read /usr/lib/fpc/2.6.0/fpc-cross.cfg: No such file or directory
dpkg: error processing Downloads/fpc_2.6.0-120824_amd64.deb (--install):
subprocess new pre-removal script returned error exit status 2
sh: Can't open /usr/lib/fpc/2.7.1/samplecfg
touch: cannot touch `/usr/lib/fpc/2.7.1/fpc-cross.cfg': No such file or directory
sed: can't read /usr/lib/fpc/2.7.1/fpc-cross.cfg: No such file or directory
/var/lib/dpkg/info/fpc.postinst: 8: cannot create /usr/lib/fpc/2.7.1/fpc-cross.cfg: Directory nonexistent
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
Downloads/fpc_2.6.0-120824_amd64.deb
Is there a way of getting apt-get or dpkg to disregard the prior installation? Failing which how easy is it to resurrect deleted files? I used "rm -rf".

The machine has Linux Mint Lisa.

knudfl 12-05-2012 03:52 PM

I'd suggest that you try installing the package with :

sudo dpkg -i --force-all fpc_2.6.0-120824_amd64.deb
... if that's the package you originally had installed.

In Ubuntu and probably also Mint version ? ,
the package fpc_2.6.0 is just a 6.5 kB metapackage that pulls all "fp" :
http://packages.ubuntu.com/quantal/fpc-2.6.0
( fpc_2.6.0-120824_amd64.deb from sourcforge.jp is 34 MB.)

.

cov 12-06-2012 05:45 AM

Hi Knudfi, thanks for the help.

It's not really working, I'm afraid, apt-get seems to be totally borked.

Quote:

sudo dpkg -i --force-all fpc_2.6.0-120824_amd64.deb
dpkg: error processing fpc_2.6.0-120824_amd64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
fpc_2.6.0-120824_amd64.deb
In view of the other issue you helped me with (namely gcc not compiling properly), it's probably not worth trying to fix it and reinstallation is most likely a better bet.

This time I'll upgrade to Vanilla Ubuntu as the derivatives seem to throw up slight problems.

knudfl 12-06-2012 09:23 AM

Quote:

cannot access archive: No such file or directory
Are you in the wrong directory ? ( Please use the pwd command.)

I.e. : sudo dpkg -i --force-all Downloads/fpc_2.6.0-120824_amd64.deb ,
if that's where the package is.

Or :
cd Downloads/ && sudo dpkg -i --force-all fpc_2.6.0-120824_amd64.deb


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