Siduction Forum

Siduction Forum => Upgrade Warnings => Topic started by: David on 2019/02/17, 20:04:07

Title: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 20:04:07
I get the following error code from trying to dist-upgrade:


Code: [Select]




rm: cannot remove '/usr/lib/x86_64-linux-gnu/fortran/gfortran-8#': No such file or directory
rm: cannot remove 'End': No such file or directory
rm: cannot remove 'automatically': No such file or directory
rm: cannot remove 'added': No such file or directory
rm: cannot remove 'section': No such file or directory
dpkg: warning: old libopenmpi3:amd64 package post-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-cnO0BE/35-libopenmpi3_3.1.3-10_amd64.deb (--unpack):
 there is no script in the new version of the package - giving up
Preparing to unpack .../36-openmpi-common_3.1.3-10_all.deb ...
Unpacking openmpi-common (3.1.3-10) over (3.1.3-5) ...
rm: cannot remove '/usr/lib/x86_64-linux-gnu/fortran/gfortran-8#': No such file or directory
rm: cannot remove 'End': No such file or directory
rm: cannot remove 'automatically': No such file or directory
rm: cannot remove 'added': No such file or directory
rm: cannot remove 'section': No such file or directory
dpkg: warning: old openmpi-common package post-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /tmp/apt-dpkg-install-cnO0BE/36-openmpi-common_3.1.3-10_all.deb (--unpack):
 there is no script in the new version of the package - giving up
Errors were encountered while processing:
 /tmp/apt-dpkg-install-cnO0BE/35-libopenmpi3_3.1.3-10_amd64.deb
 /tmp/apt-dpkg-install-cnO0BE/36-openmpi-common_3.1.3-10_all.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)






1) is there a known fix (maybe you could edit the removal script?)
2) is this just another time I need patience for it to be fixed or will I have to re-install?


Thanks
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 20:10:36
UPDATE:


Synaptic gives this extra information:


Code: [Select]

E: /var/cache/apt/archives/libopenmpi3_3.1.3-10_amd64.deb: there is no script in the new version of the package - giving up
E: /var/cache/apt/archives/openmpi-common_3.1.3-10_all.deb: there is no script in the new version of the package - giving up
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: towo on 2019/02/17, 21:06:15
Use the force young padawan, the forum has a search function.
The problem incusive thge solution is well known.
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 21:08:49
My apologies. I will use the search.


Is it OK if I ask you over PM if I can't find it?


I will tell you if I fix it
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: towo on 2019/02/17, 21:09:43
I don't need a PM, i know the tread.
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 21:28:36
Oh, OK.
Well, I tried a solution written by piper in reply to geeklnintendo (I think I spelled that right) and it didn't work.


I full-upgraded today and my system still works but when I try to install packages it sometimes wont do it because it thinks OpenMPI needs to go first


thanks for the help so far but I still have my problem :(


in the error codes I noticed this right here:
Code: [Select]

rm: cannot remove '/usr/lib/x86_64-linux-gnu/fortran/gfortran-8#': No such file or directory
rm: cannot remove 'End': No such file or directory
rm: cannot remove 'automatically': No such file or directory
rm: cannot remove 'added': No such file or directory
rm: cannot remove 'section': No such file or directory
dpkg: error processing package libopenmpi3:amd64 (--remove):
 installed libopenmpi3:amd64 package post-removal script subprocess returned error exit status 1
Removing openmpi-common (3.1.3-5) ...
rm: cannot remove '/usr/lib/x86_64-linux-gnu/fortran/gfortran-8#': No such file or directory
rm: cannot remove 'End': No such file or directory
rm: cannot remove 'automatically': No such file or directory
rm: cannot remove 'added': No such file or directory
rm: cannot remove 'section': No such file or directory
This looks like an error in a script somewhere.


Can you tell me where the script(s) are so I can edit them?



Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: towo on 2019/02/17, 21:34:20
In that thread there is a link to the debian bugreport, there you find the exact solution.
Really, learn reading carefully. All that scripts are in /var/lib/dpkg/info/

Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 21:42:06
Yes! you're right. I googled it after I asked. Sorry about that.


Here are my modified .postrm scripts:


cat openmpi-common.postrm
Code: [Select]

#!/bin/sh
set -e
# Automatically added by dh_fortran_mod/UNDECLARED
multiarch="x86_64-linux-gnu"
base="gfortran-mod-15"
cmplr="gfortran-8"


rmdir --ignore-fail-on-non-empty --parents /usr/lib/$multiarch/fortran/$base
[ -d /usr/lib/$multiarch/fortran/$base ] && rm /usr/lib/$multiarch/fortran/$cmplr


and

cat libopenmpi3:amd64.postrm
Code: [Select]

#!/bin/sh
set -e
# Automatically added by dh_fortran_mod/UNDECLARED
multiarch="x86_64-linux-gnu"
base="gfortran-mod-15"
cmplr="gfortran-8"


rmdir --ignore-fail-on-non-empty --parents /usr/lib/$multiarch/fortran/$base
[ -d /usr/lib/$multiarch/fortran/$base ] && rm /usr/lib/$multiarch/fortran/$cmplr


All i've done is removed the bad comment that said "end of automatically generated section" without a newline character


I will now attempt to remove these packages
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 21:45:38
PROGRESS!!!


Here is the new error code generated:


Code: [Select]

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libopenmpi3 openmpi-common
0 upgraded, 0 newly installed, 2 to remove and 1229 not upgraded.
2 not fully installed or removed.
After this operation, 9,231 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 295515 files and directories currently installed.)
Removing libopenmpi3:amd64 (3.1.3-5) ...
Removing openmpi-common (3.1.3-5) ...
rm: cannot remove '/usr/lib/x86_64-linux-gnu/fortran/gfortran-8': No such file or directory
dpkg: error processing package openmpi-common (--remove):
 installed openmpi-common package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 openmpi-common
E: Sub-process /usr/bin/dpkg returned an error code (1)


As you can see, it's having trouble removing that directory. I see 2 potential solutions:


1) Create that directory so it can delete it


2) remove that line from the script so it doesn't try to delete it






I am VERY close to the solution!!!


Any advice?
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 22:01:44
I have fixed the problem. No errant packages on my system anymore.


I removed everything in here: /usr/lib/x86_64-linux-gnu/fortran


and commented out the rmdir and rm lines in the openmpi-common.postrm file



Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: melmarker on 2019/02/17, 22:02:13
you need to fix both scripts
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 22:05:36
you need to fix both scripts


Yes, I did


I removed the bad comment from both, apt autoremoved, and then I went in and manually deleted everything in the fortran folder here /usr/lib/x86_64-linux-gnu/fortran which is what the postrm script was trying to do.


I am now only worried that gfortran might be broken. Should I attempt to reinstall GCC?
Title: Re: OpenMPI has problems removing in the dist-upgrade
Post by: David on 2019/02/17, 22:07:45
I reinstalled gfortran through synaptic with no errors and it didn't put anything in that folder


so I can only assume my system is once again at peace.


Thanks, all!
I couldn't have done it without you