Opened 20 years ago
Last modified 9 years ago
#2665 closed defect
Forgetting sudo breaks 'port uninstall' — at Initial Version
Reported by: | cssdev@… | Owned by: | darwinports-bugs@… |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | base | Version: | 1.0 |
Keywords: | Cc: | ||
Port: |
Description
I have a nasty habit of forgetting to sudo when uninstalling. This leads to problems, as I am then unable to uninstall the package. For example, I updated gsl and wanted to get rid of the old version:
[css@vectorsigma:/Users/Shared/darwinports]$ port uninstall gsl 1.5_0 ---> Uninstalling gsl 1.5_0 port uninstall failed: error deleting "/opt/local/var/db/dports/software/gsl/1.5_0/opt/local/share/ aclocal/gsl.m4": permission denied
Oops, I forgot the 'sudo' again. After I added it, port complained that it could not find the required files:
[css@vectorsigma:/Users/Shared/darwinports]$ sudo port uninstall gsl 1.5_0 ---> Uninstalling gsl 1.5_0 port uninstall failed: could not read "/opt/local/var/db/dports/software/gsl/1.5_0/opt/local/share/ man/man3": no such file or directory
Using port -d uninstall, it looks like uninstall removes files from /opt/local/var/db/dports/software without requiring admin authority. The uninstall stops when it lacks permission for removing files in / opt/local/share. When the second uninstall runs, it fails to find any files in /opt/llocal/var/db/dports/ software, so it fails. Perhaps the installer isn't securing proper permissions for the staging directory? In any case, it seems that forgetting to add the 'sudo' shouldn't restrict future uninstalls.