5

I have a problem with an uncompleted upgrade on my local Debian install:

  Operating System: Debian GNU/Linux buster/sid
            Kernel: Linux 4.12.0-1-686-pae
      Architecture: x86

I tried to fix it with apt upgrade -f and dpkg --configure lilypond-data but whatever I do, I get the following message:

Setting up lilypond-data (2.18.2-8) ...
 Running mktexlsr /usr/share/texlive/texmf-dist...
mktexlsr: Updating /var/lib/texmf/ls-R-TEXLIVEDIST... 
mktexlsr: Done.
ln: failed to create symbolic link 'lilypond/user': File exists
dpkg: error processing package lilypond-data (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 lilypond-data
E: Sub-process /usr/bin/dpkg returned an error code (1)

if I run dpkg --remove --force-remove-reinstreq --dry-run lilypond-data I get:

dpkg: dependency problems prevent removal of lilypond-data:
 lilypond depends on lilypond-data (= 2.18.2-8).

dpkg: error processing package lilypond-data (--remove):
 dependency problems - not removing
Errors were encountered while processing:
 lilypond-data
  • 1
    Try : sudo dpkg --remove --force-remove-reinstreq --dry-run lilypond-data – GAD3R Aug 23 '17 at 15:43
  • @GAD3R THX, but unfortunately it did not work; I updated the question with the terminal-output for your suggested command. – nath Aug 23 '17 at 16:14
8

The general approach would be to look at (shell script) /var/lib/dpkg/info/lilypond-data.postinst and find the ln line that's failing. Then determine why, and work around it (e.g., by rming the existing link, or worst case by editing the postinst). And of course then file a bug.

Except someone else has already done so—see bug 871631. And the bug has been fixed; you just need to grab (and install) 2.18.2-9 from unstable.

(Which yields an important lesson: check the bug tracking system before thinking about how to fix it...)

Also: you may want to install apt-listbugs.

  • THX, I grabbed 2.18.2-9 by adding unstable to /etc/apt/sources.list run apt update and upgraded with apt-get --only-upgrade install lilypond, removed unstable from /etc/apt/sources.list updated again; done. – nath Aug 23 '17 at 16:36
  • @nath It's probably easier to just download the packages from the Debian package pages. – Faheem Mitha Aug 23 '17 at 19:57
3

This part shows what is important:

ln: failed to create symbolic link 'lilypond/user': File exists
dpkg: error processing package lilypond-data (--configure):
 subprocess installed post-installation script returned error exit status 1

Your post-installation script failed. It is likely because it wasn't configured to handle its previous version in the stable correctly.

The debian packages have two components:

  1. a file archive, it is quite ordinary .tar.gz (or any similar), extracted into the root directory
  2. installation scripts, which run before and after the archive extraction.

Thus, a package install seems so:

  1. the pre-installation scripts of the package run
  2. the package archive is extracted into the root directory
  3. the post-installation scripts run

Removal happens similarly, but with a pre-removal and a post-removal script.

In your case, a package upgrade happened, then the script call order is a little bit more complex, but not heavily.

From them, the post-install script of the new package couldn't run on some reason. Thus, it is already extracted on your system.

Because it is a devel distribution, it is not very hard thing to manually hotfix the problem.

Edit the old post-installation script.

vi /var/lib/dpkg/info/lilypond-data.postinst

Find, where it can't create that link, and let him allow it.

After that, run:

dpkg --configure -a

will do what you want. (If it doesn't succeed, don't worry, edit again and retry.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.