[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: custom package error: dpkg -P tries to remove /opt

Mike Fogel wrote:
> hello all debian-devel,
> This seems like a very basic issue, but I've searched through the
> mailing lists and web and haven't found any help.
> I'm trying to create a basic set of custom packages which will hold some
> of our software, complied and customized as we like it for our machines.
>  We like to put our custom build software in /opt.  Everything is
> working fine, I have basic postinst and prerm scripts working well.
> However, I can't seem to figure out how to resolve this error:
> $ dpkg -i custom-package.deb
>  ... installation goes perfectly ....
> $ dpkg -P custom-package
>  ... removal goes perfectly until this error/warning....
> dpkg - warning: while removing custom-package, unable to remove
> directory `/opt': Device or resource busy - directory may be a mount
> point ?
> Well, yeah, /opt is a mount point, and it would definitely be a good
> thing if it wasn't removed.  But how can I tell dpkg that I don't want
> it to try to remove /opt??
> Thanks much!!!
> Mike
Hello Mike,

This question is really more appropriate for debian-user.  However, the
message you see from dpkg is just that, a warning.  Whenever a Debian
package is removed and there are no packages left with files in a
particular directory, dpkg tries to remove the directory.  Of course, it
doesn't do an rm -rf (thankfully), so directories that are still
populated can't be removed.  You see this, for example when removing a
kernel-image package after you have added your own modules that are not
part of a package under the control of dpkg.

Anyhow, the warning is relatively harmless and can be safely ignored.

(I hope that all of this is correct.  If I messed somethig up, someone
please let me know.)


Roberto C. Sanchez

Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: