Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1179338

Bug#1058960: dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty

From Sven Joachim <svenjoac@gmx.de>
Newsgroups linux.debian.bugs.dist
Subject Bug#1058960: dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty
Date 2023-12-19 17:30 +0100
Message-ID <HML8J-eFH1-1@gated-at.bofh.it> (permalink)
References <HMtYd-evgq-1@gated-at.bofh.it> <HMtYd-evgq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2023-12-18 22:57 +0100, Christoph Anton Mitterer wrote:

> Package: debian-reference
> Version: 2.109
> Severity: normal
>
>
> Hey.
>
> Something looks odd with the package’s files registration in Debian.
> On upgrade from 2.108 to 2.109 I got:
> Unpacking debian-reference-common (2.109) over (2.108) ...
> dpkg: warning: unable to delete old directory '/usr/share/debian-reference/images': Directory not empty
> Preparing to unpack .../01-debian-reference-en_2.109_all.deb ...
> Unpacking debian-reference-en (2.109) over (2.108) ...
> dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty
>
>
> And indeed, none of these files seem to belong to a Debian package:
> $ dpkg -S /usr/share/debian-reference/images/*
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/caution.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/home.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/important.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/next.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/note.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/prev.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/tip.png
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/up.gif
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images/warning.png
> $ dpkg -S /usr/share/debian-reference/*
> dpkg-query: no path found matching pattern /usr/share/debian-reference/apa.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch01.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch02.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch03.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch04.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch05.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch06.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch07.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch08.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch09.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch10.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch11.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/ch12.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/debian-reference.css
> dpkg-query: no path found matching pattern /usr/share/debian-reference/debian-reference.en.pdf
> dpkg-query: no path found matching pattern /usr/share/debian-reference/debian-reference.en.txt.gz
> dpkg-query: no path found matching pattern /usr/share/debian-reference/images
> dpkg-query: no path found matching pattern /usr/share/debian-reference/index.en.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/index.html
> dpkg-query: no path found matching pattern /usr/share/debian-reference/pr01.en.html
>
> These files do however seem to exist in the package, though registered as:
> $ grep /usr/share/doc/debian-reference-common/docs /var/lib/dpkg/info/debian-reference-common.list
> /usr/share/doc/debian-reference-common/docs
> /usr/share/doc/debian-reference-common/docs/.htaccess
> /usr/share/doc/debian-reference-common/docs/debian-reference.css
> /usr/share/doc/debian-reference-common/docs/images
> /usr/share/doc/debian-reference-common/docs/images/caution.png
> /usr/share/doc/debian-reference-common/docs/images/home.png
> /usr/share/doc/debian-reference-common/docs/images/important.png
> /usr/share/doc/debian-reference-common/docs/images/next.png
> /usr/share/doc/debian-reference-common/docs/images/note.png
> /usr/share/doc/debian-reference-common/docs/images/prev.png
> /usr/share/doc/debian-reference-common/docs/images/tip.png
> /usr/share/doc/debian-reference-common/docs/images/up.gif
> /usr/share/doc/debian-reference-common/docs/images/warning.png
> /var/lib/dpkg/info$ grep /usr/share/doc/debian-reference-common/docs /var/lib/dpkg/info/debian-reference-en.list
> /usr/share/doc/debian-reference-common/docs
> /usr/share/doc/debian-reference-common/docs/apa.en.html
> /usr/share/doc/debian-reference-common/docs/ch01.en.html
> /usr/share/doc/debian-reference-common/docs/ch02.en.html
> /usr/share/doc/debian-reference-common/docs/ch03.en.html
> /usr/share/doc/debian-reference-common/docs/ch04.en.html
> /usr/share/doc/debian-reference-common/docs/ch05.en.html
> /usr/share/doc/debian-reference-common/docs/ch06.en.html
> /usr/share/doc/debian-reference-common/docs/ch07.en.html
> /usr/share/doc/debian-reference-common/docs/ch08.en.html
> /usr/share/doc/debian-reference-common/docs/ch09.en.html
> /usr/share/doc/debian-reference-common/docs/ch10.en.html
> /usr/share/doc/debian-reference-common/docs/ch11.en.html
> /usr/share/doc/debian-reference-common/docs/ch12.en.html
> /usr/share/doc/debian-reference-common/docs/debian-reference.en.pdf
> /usr/share/doc/debian-reference-common/docs/debian-reference.en.txt.gz
> /usr/share/doc/debian-reference-common/docs/index.en.html
> /usr/share/doc/debian-reference-common/docs/pr01.en.html
>
> That, in my case, is a symlink:
> $ ls -al /usr/share/doc/debian-reference-common/docs
> lrwxrwxrwx 1 root root 22 Dec 19  2013 /usr/share/doc/debian-reference-common/docs -> ../../debian-reference
>
>
> I'd blinly presume, that one this was indeed a symlink, but no longer is
> and when the switch was made, no proper cleanup took place leaving now
> all people that upgraded behind with that situation?
>
> Any ideas what's going on here and how to clean up?

In debian-reference-common version 2.108 and earlier,
/usr/share/doc/debian-reference-common/docs was a symlink, as you had
noticed.  Version 2.109 switched it to a directory, but as mentioned
in Policy[1] dpkg never replaces a symlink to a directory with a
directory and rather leaves the existing state alone.

The solution is to use maintainer scripts to turn the symlink into a
directory.  Please refer to dpkg-maintscript-helper(1) and
dh_installdeb(1) how this is usually done.

Cheers,
       Sven


1. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#details-of-unpack-phase-of-installation-or-upgrade

Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bug#1058960: dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty Christoph Anton Mitterer <calestyo@scientia.org> - 2023-12-18 23:10 +0100
  Bug#1058960: dpkg: warning: unable to delete old directory '/usr/share/debian-reference': Directory not empty Sven Joachim <svenjoac@gmx.de> - 2023-12-19 17:30 +0100

csiph-web