Discussion:
Bug#803606: emacs24: pre-removal script fails: “No such file or directory” for ‘site-lisp’ entries
Ben Finney
2015-10-31 18:50:32 UTC
Permalink
Package: emacs24
Version: 24.5+1-2
Severity: important

Attempting to upgrade 24.5+1-2 → 24.5+1-3 fails:

=====
Preparing to unpack .../emacs24_24.5+1-3_amd64.deb ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: error processing archive /var/cache/apt/archives/emacs24_24.5+1-3_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
[
]
=====

I initially suspected it might be a problem with ‘magit’, so I
experimentally removed that package. The removal of ‘magit’ succeeds,
so I think the problem is not in that package.

But ‘emacs24’ still fails to upgrade: pre-removal fails on the next
‘site-lisp’ entry it finds (in this case, the ‘notmuch’ package). So
it seems the problem is with ‘emacs24’ pre-removal.

The package is currently in a “broken” state on this host and the
maintainer scripts are preventing upgrade, so I have filed this report
at “important” severity.


-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_AU.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages emacs24 depends on:
ii emacs24-bin-common 24.5+1-3
ii gconf-service 3.2.6-3
ii libacl1 2.2.52-2
ii libasound2 1.0.29-1
ii libatk1.0-0 2.18.0-1
ii libc6 2.19-22
ii libcairo-gobject2 1.14.2-2
ii libcairo2 1.14.2-2
ii libdbus-1-3 1.10.0-3
ii libfontconfig1 2.11.0-6.3
ii libfreetype6 2.6-2
ii libgconf-2-4 3.2.6-3
ii libgdk-pixbuf2.0-0 2.32.1-1
ii libgif4 4.1.6-11
ii libglib2.0-0 2.46.1-1
ii libgnutls-deb0-28 3.3.18-1
ii libgomp1 5.2.1-22
ii libgpm2 1.20.4-6.1+b2
ii libgtk-3-0 3.18.2-1
ii libice6 2:1.0.9-1+b1
ii libjpeg62-turbo 1:1.4.1-2
ii libm17n-0 1.7.0-1
ii libmagickcore-6.q16-2 8:6.8.9.9-6
ii libmagickwand-6.q16-2 8:6.8.9.9-6
ii libotf0 0.9.13-2
ii libpango-1.0-0 1.38.1-1
ii libpangocairo-1.0-0 1.38.1-1
ii libpng12-0 1.2.50-2+b2
ii librsvg2-2 2.40.11-1
ii libselinux1 2.3-2+b1
ii libsm6 2:1.2.2-1+b1
ii libtiff5 4.0.5-1
ii libtinfo5 6.0+20150810-1
ii libx11-6 2:1.6.3-1
ii libxft2 2.3.2-1
ii libxinerama1 2:1.1.3-1+b1
ii libxml2 2.9.2+zdfsg1-4
ii libxpm4 1:3.5.11-1+b1
ii libxrandr2 2:1.5.0-1
ii libxrender1 1:0.9.8-1+b1
ii zlib1g 1:1.2.8.dfsg-2+b1

emacs24 recommends no packages.

Versions of packages emacs24 suggests:
pn emacs24-common-non-dfsg <none>

-- no debconf information
--
\ “None can love freedom heartily, but good men; the rest love |
`\ not freedom, but license.” —John Milton |
_o__) |
Ben Finney <***@benfinney.id.au>
Rob Browning
2015-11-01 18:55:03 UTC
Permalink
retitle 803606 elpa-magit: pre-removal script fails: “No such file or directory” for ‘site-lisp’ entries
reassign 803606 elpa-magit
thanks
Post by Ben Finney
=====
Preparing to unpack .../emacs24_24.5+1-3_amd64.deb ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
subprocess new pre-removal script returned error exit status 1
[…]
We suspect this is a bug in elpa-magit -- it may just need to be rebuilt
via dh-epla 0.16, but if that turns out to be incorrect, please feel
free to reassign the bug back to emacs24.

Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Ben Finney
2015-11-01 23:01:29 UTC
Permalink
Post by Rob Browning
We suspect this is a bug in elpa-magit -- it may just need to be
rebuilt via dh-epla 0.16, but if that turns out to be incorrect,
please feel free to reassign the bug back to emacs24.
Wouldn't that affect attempts to remove the ‘magit’ package, though? I
see no error when removing or reinstalling that package:

=====
$ sudo dpkg --remove magit
(Reading database ... 736490 files and directories currently installed.)
Removing magit (2.2.2-3) ...

$ sudo dpkg -i /var/cache/apt/archives/magit_2.2.2-3_all.deb
Selecting previously unselected package magit.
(Reading database ... 736488 files and directories currently installed.)
Preparing to unpack .../archives/magit_2.2.2-3_all.deb ...
Unpacking magit (2.2.2-3) ...
Setting up magit (2.2.2-3) ...

$
=====

How could I narrow the error down to the ‘magit’ package as you imply?
--
\ “I took it easy today. I just pretty much layed around in my |
`\ underwear all day. 
 Got kicked out of quite a few places, |
_o__) though.” —Bug-Eyed Earl, _Red Meat_ |
Ben Finney <***@benfinney.id.au>
Rémi Vanicat
2015-11-02 00:02:13 UTC
Permalink
Post by Rob Browning
We suspect this is a bug in elpa-magit -- it may just need to be
rebuilt via dh-epla 0.16, but if that turns out to be incorrect,
please feel free to reassign the bug back to emacs24.
A new version of elpa-magit that has been compiled with dh-elpa 0.16 is
available in sid.
Wouldn't that affect attempts to remove the ‘magit’ package, though?
the magit package is now an empty transitional package, so the
probability it has bug is quite low.
=====
$ sudo dpkg --remove magit
(Reading database ... 736490 files and directories currently installed.)
Removing magit (2.2.2-3) ...
$ sudo dpkg -i /var/cache/apt/archives/magit_2.2.2-3_all.deb
Selecting previously unselected package magit.
(Reading database ... 736488 files and directories currently installed.)
Preparing to unpack .../archives/magit_2.2.2-3_all.deb ...
Unpacking magit (2.2.2-3) ...
Setting up magit (2.2.2-3) ...
$
=====
How could I narrow the error down to the ‘magit’ package as you imply?
Just remove an reinstall elpa-magit, an try again with the newer version
in sid.
--
Rémi Vanicat
Ben Finney
2015-11-02 01:37:13 UTC
Permalink
Control: found -1 elpa-magit/2.2.2-3
Post by Rémi Vanicat
Post by Rob Browning
We suspect this is a bug in elpa-magit -- it may just need to be
rebuilt via dh-epla 0.16 [
]
A new version of elpa-magit that has been compiled with dh-elpa 0.16 is
available in sid.
Thanks. How will the automatic upgrade work, though, if the existing
package ‘elpa-magit’ version 2.2.2-3 always fails its pre-remove step?

=====
$ sudo dpkg --remove elpa-magit magit
(Reading database ... 736200 files and directories currently installed.)
Removing magit (2.2.2-3) ...
Removing elpa-magit (2.2.2-3) ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: error processing package elpa-magit (--remove):
subprocess installed pre-removal script returned error exit status 1
Errors were encountered while processing:
elpa-magit

$
=====

A manual work-around to upgrade this one package doesn't address the
bug IMO, because there are doubtless some other ELPA packages with the
same problem.

Does this point to a bug in the ‘emacs24’ package in being unable to
automatically handle upgrades of these packages in Debian built
against an older ELPA?
--
\ “It's easy to play any musical instrument: all you have to do |
`\ is touch the right key at the right time and the instrument |
_o__) will play itself.” —Johann Sebastian Bach |
Ben Finney <***@benfinney.id.au>
Ben Finney
2015-11-02 01:46:36 UTC
Permalink
Post by Ben Finney
Thanks. How will the automatic upgrade work, though, if the existing
package ‘elpa-magit’ version 2.2.2-3 always fails its pre-remove step?
The answer is:

=====
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
[
]
=====
Post by Ben Finney
Does this point to a bug in the ‘emacs24’ package in being unable to
automatically handle upgrades of these packages in Debian built
against an older ELPA?
So, no. The upgrade process will instruct ‘dpkg’ to try the
pre-removal script from the to-be-installed package, which (with a
corrected ‘elpa-magit’ package) will succeed, allowing the upgrade to
proceed automatically.

Apologies for the noise. Thanks for your maintenance work!
--
\ “I must have a prodigious quantity of mind; it takes me as much |
`\ as a week sometimes to make it up.” —Mark Twain, _The Innocents |
_o__) Abroad_ |
Ben Finney <***@benfinney.id.au>
Ben Finney
2015-11-03 19:53:49 UTC
Permalink
Package: elpa-magit
Control: found -1 elpa-magit/2.3.0-2
Followup-For: Bug #803606

I downloaded the ‘elpa-magit’ version “2.3.0-2” package, and it is
still unable to upgrade on this host:

=====
$ sudo dpkg --install elpa-magit_2.3.0-2_all.deb
(Reading database ... 738081 files and directories currently installed.)
Preparing to unpack elpa-magit_2.3.0-2_all.deb ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: error processing archive elpa-magit_2.3.0-2_all.deb (--install):
subprocess new pre-removal script returned error exit status 1
Errors were encountered while processing:
elpa-magit_2.3.0-2_all.deb
=====


And attempting to remove existing packages is failing:

=====
$ sudo dpkg --remove elpa-magit-popup elpa-magit
(Reading database ... 738080 files and directories currently installed.)
Removing elpa-magit (2.2.2-3) ...
Remove elpa-magit for emacs24
remove/magit-2.2.2: Handling removal of emacsen flavor emacs24
dh-elpa: purging flavor specific files for emacs24
find: `/usr/share/emacs24/site-lisp/elpa/magit-2.2.2': No such file or directory
ERROR: remove script from elpa-magit package failed
dpkg: error processing package elpa-magit (--remove):
subprocess installed pre-removal script returned error exit status 1
dpkg: dependency problems prevent removal of elpa-magit-popup:
elpa-magit depends on elpa-magit-popup.

dpkg: error processing package elpa-magit-popup (--remove):
dependency problems - not removing
Errors were encountered while processing:
elpa-magit
elpa-magit-popup
=====


So something more is needed to fix this bug. Please let me know of
other diagnosis I can do to narrow down the problem.


-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8) (ignored: LC_ALL set to en_AU.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages elpa-magit depends on:
ii dash-el 2.11.0-1
ii elpa-git-commit 2.2.2-3
ii elpa-magit-popup 2.3.0-2
ii elpa-with-editor 2.2.2-3
ii emacsen-common 2.0.8
ii git 1:2.6.1-1

elpa-magit recommends no packages.

elpa-magit suggests no packages.

-- no debconf information
--
\ “If I held you any closer I would be on the other side of you.” |
`\ —Groucho Marx |
_o__) |
Ben Finney <***@benfinney.id.au>
Rémi Vanicat
2015-11-03 20:16:03 UTC
Permalink
Post by Ben Finney
Package: elpa-magit
Control: found -1 elpa-magit/2.3.0-2
Followup-For: Bug #803606
I downloaded the ‘elpa-magit’ version “2.3.0-2” package, and it is
Current elpa-magit prerm script just call a perl script from the
emacsen-common package. What version of emacsen-common do you have? If
it isn't 2.0.8 or latter, could you upgrade it and try again?

Thanks

[...]
--
Rémi Vanicat
Ben Finney
2015-11-03 21:20:10 UTC
Permalink
Post by Rémi Vanicat
Current elpa-magit prerm script just call a perl script from the
emacsen-common package. What version of emacsen-common do you have?
If it isn't 2.0.8 or latter, could you upgrade it and try again?
It is:

=====
$ dpkg-query --show elpa-magit emacs24 emacsen-common
elpa-magit 2.2.2-3
emacs24 24.5+1-2
emacsen-common 2.0.8
=====

That's part of the problem, as I understand it. Emacs is only partly
upgraded; when ‘emacs24’ tries to upgrade, it attempts to upgrade
‘elpa-magit’.

When that fails, the system is left in an inconsistent state:
‘elpa-magit’ cannot move beyond 2.2.2-3, but ‘emacs24’ requires that
before its upgrade is complete.

Meanwhile ‘emacsen-common’ is already at version 2.0.8, which causes
‘elpa-magit’ to fail its pre-remove (whether version 2.2.2-3 or
version 2.3.0-2). And around we go again :-)
--
\ 執䞍孀、必有鄰。 (The virtuous are not abandoned, |
`\ they shall surely have neighbours.) |
_o__) —孔倫子 Confucius (551 BCE – 479 BCE) |
Ben Finney <***@benfinney.id.au>
Branislav Zahradník
2015-11-07 02:34:24 UTC
Permalink
Post by Ben Finney
Post by Rémi Vanicat
Current elpa-magit prerm script just call a perl script from the
emacsen-common package. What version of emacsen-common do you have?
If it isn't 2.0.8 or latter, could you upgrade it and try again?
=====
$ dpkg-query --show elpa-magit emacs24 emacsen-common
elpa-magit 2.2.2-3
emacs24 24.5+1-2
emacsen-common 2.0.8
=====
That's part of the problem, as I understand it. Emacs is only partly
upgraded; when ‘emacs24’ tries to upgrade, it attempts to upgrade
‘elpa-magit’.
‘elpa-magit’ cannot move beyond 2.2.2-3, but ‘emacs24’ requires that
before its upgrade is complete.
Meanwhile ‘emacsen-common’ is already at version 2.0.8, which causes
‘elpa-magit’ to fail its pre-remove (whether version 2.2.2-3 or
version 2.3.0-2). And around we go again :-)
--
\ 德不孤、必有鄰。 (The virtuous are not abandoned, |
`\ they shall surely have neighbours.) |
_o__) —孔夫子 Confucius (551 BCE – 479 BCE) |
I'm affected by this bug as well.
I guess problem is in file:

/usr/lib/emacsen-common/packages/remove/elpa-magit

line:
find ${elc_dir} -type l -delete

if ${elc_dir} doesn't exist, find fails. Solution:

[ -e ${elc_dir} ] && find ${elc_dir} -type l -delete

Problem is also with other elpa packages: elpa-git-commit, elpa-magit-popup, elpa-with-editor
Rémi Vanicat
2015-11-07 13:26:25 UTC
Permalink
Branislav Zahradník <***@gmail.com> writes:

[...]
Post by Branislav Zahradník
I'm affected by this bug as well.
/usr/lib/emacsen-common/packages/remove/elpa-magit
find ${elc_dir} -type l -delete
[ -e ${elc_dir} ] && find ${elc_dir} -type l -delete
Problem is also with other elpa packages: elpa-git-commit, elpa-magit-popup, elpa-with-editor
In curent version of elpa-magit (2.3.0-2, as in sid and unstable today), this
file contain just that. Does upgrading fix your problem?
--
Rémi Vanicat
Branislav Zahradník
2015-11-07 14:01:24 UTC
Permalink
Post by Branislav Zahradník
[...]
Post by Branislav Zahradník
I'm affected by this bug as well.
/usr/lib/emacsen-common/packages/remove/elpa-magit
find ${elc_dir} -type l -delete
[ -e ${elc_dir} ] && find ${elc_dir} -type l -delete
Problem is also with other elpa packages: elpa-git-commit,
elpa-magit-popup, elpa-with-editor
In curent version of elpa-magit (2.3.0-2, as in sid and unstable today), this
file contain just that. Does upgrading fix your problem?
--
Rémi Vanicat
yes, thank you, although manual removal of existing
/usr/lib/emacsen-common/packages/remove/elpa-magit
(for other 3packages as well) was required.

Btw, looking closely to that script and my installed packages I guess it
happend because I have xemacs21 (missing "exit 0" - skipping unsupported ?).
Rémi Vanicat
2015-11-07 16:19:29 UTC
Permalink
Package: elpa-magit
Control: notfound -1 elpa-magit/2.3.0-2
Followup-For: Bug #803606
[...]
Post by Branislav Zahradník
yes, thank you, although manual removal of existing
/usr/lib/emacsen-common/packages/remove/elpa-magit
(for other 3packages as well) was required.
Btw, looking closely to that script and my installed packages I guess it
happend because I have xemacs21 (missing "exit 0" - skipping unsupported ?).
The problem is that when upgrading from a bugged version, it call the
new prerm script, but with the old emacsen-common file where the bug is.


I will look at a solution tomorrow, that said I may have to wrote stuff
that will become cruft, and won't be needed but to upgrade from a
version of the package that never has been into stable.
--
Rémi Vanicat
Loading...