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

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

ma, 2006-03-06 kello 19:39 -0800, Mike Fogel kirjoitti:
> 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??

What seems to happen here is that your package contains /opt as part of
the .deb, but nothing else on the system owns it. Thus, when you install
your package, dpkg assigns ownership of /opt to your package, and when
you remove the package, dpkg sees that only your package owns /opt, and
thus tries to remove it. Since it is not removable, you get a warning.

/opt is created by the base-files postinst script
(see /var/lib/dpkg/info/base-files.postinst), instead of being included
in the base-files package. I am not sure why, but that's how it works.

I think you can just ignore the warning, even if it is a bit ugly. I
don't know of a way to get dpkg not remove the directory.

It's pointless to argue with someone with no soul. -- Skip Middleton

Reply to: