9

I built and installed a debian package from the following folder structure:

  • myprog
    • DEBIAN
      • control
    • usr
      • local
        • bin
          • myprog.sh

... using the following commands:

dpkg -b myprog/ myprog.deb && dpkg -i myprog.deb

When i now remove the package by typing:

dpkg -r myprog

.. I got the following warning:

dpkg: warning: while removing myprog, directory '/usr/local' not empty so not removed.

As I think this is an every day scenario, how can I avoid the warning?

Greets Thorsten!

# Edit

I tried to install the file to /bin instead of /usr/local/bin and got no warning when removing it. Seems so, that the /usr/local/.. folder will not treated as a system folder (?) by dpkg.

4

2 回答 2

9

没错——包不应该接触/usr/local目录,它是由文件系统层次标准为系统管理员保留的,是他们的职责范围。

于 2010-09-13T22:17:48.923 回答
0

根据这篇文章,为了避免警告,是创建一个“core-custom”/dummy 包,它将安装在 /opt 中,并且是您的主包所必需的。

因此,当您卸载主包时,至少您的虚拟包将留在 /opt 中,并且 dpkg 不会发出警告。

您还可以将该虚拟包用作元包来安装您喜欢的所有常规包。

于 2013-08-14T06:53:13.117 回答