Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 771  / 2 Years ago, fri, march 4, 2022, 8:25:27

On a recent upgrade from Ubuntu 13.10 (saucy) to 14.04.1 LTS (trusty), the process kept hanging at multiple prerm and postrm scripts for removing Mono packages. The symptom of the problem are messages like the following in the dpkg output (/var/log/dist-upgrade/apt-term.log if using ubuntu-release-upgrader):



$ egrep -B1 'Removing.+ from Mono' /var/log/dist-upgrade/apt-term.log

Preparing to unpack .../libdbus1.0-cil_0.7.0-5ubuntu1_all.deb ...
Removing libdbus1.0-cil from Mono
--
Preparing to unpack .../libdbus-glib1.0-cil_0.5.0-4ubuntu1_all.deb ...
Removing libdbus-glib1.0-cil from Mono
--
Preparing to unpack .../libgdata2.1-cil_2.2.0.0-2_all.deb ...
Removing libgdata2.1-cil from Mono
--
Preparing to unpack .../libmono-addins0.2-cil_1.0+git20130406.adcd75b-3_all.deb ...
Removing libmono-addins0.2-cil from Mono
--
Preparing to unpack .../libnotify0.4-cil_0.4.0~r3032-7_all.deb ...
Removing libnotify0.4-cil from Mono
--
Preparing to unpack .../libtaglib2.1-cil_2.1.0.0-3_all.deb ...
Removing libtaglib2.1-cil from Mono
--
Preparing to unpack .../libmono-addins-gui0.2-cil_1.0+git20130406.adcd75b-3_all.deb ...
Removing libmono-addins-gui0.2-cil from Mono

More From » 14.04

 Answers
3

The previous answer has a typo where it said to run

sudo sed -i -e 's/trusty/saucy/g; s/14.04.1/13.10/g; s/LTS//;'

but didn't say what file to apply that edit to.



My guess is that they meant /etc/lsb-release and editing that file (as well as /etc/apt/sources.list as shown) worked for me.



P.S. The website said I didn't have enough karma or whatever to post a "comment", so posting this "Answer" (really a comment) was the only choice...



Also, here's a script which automates the repetive ps/run-by-hand/kill procedure described in the previous answer (run the script as many times as necessary to get past the hangs)



#!/bin/sh
set -e -u
unset GREP_OPTIONS GREP_COLOR GREP_COLORS
line=$(ps xa -o pid,cmd | grep 'postrm|prerm' | grep -v grep)
[ -n "$line" ] || { echo "No postrm/prerm cmd is running now." >&2; exit 1; }
pid=$( echo "$line" | sed -ne 's/^ *([0-9][0-9]*) .*/1/p' )
cmd=$( echo "$line" | sed -ne 's/^ *[0-9][0-9]* *//p' )
eval "sudo $cmd"
echo -n "Kill pid $pid ? "
read reply
case "$reply" in
[yY]*) (set -x; sudo kill $pid)
&& sleep 1
&& sudo kill $pid >/dev/null
&& (set -x; sudo kill -9 $pid)
;;
esac

[#23011] Sunday, March 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sipwing

Total Points: 245
Total Questions: 100
Total Answers: 118

Location: Aland Islands
Member since Thu, Oct 22, 2020
4 Years ago
sipwing questions
Sun, May 29, 22, 22:00, 2 Years ago
Fri, Jun 24, 22, 08:46, 2 Years ago
Fri, Dec 23, 22, 00:04, 1 Year ago
;