[MacPorts] #2665: Forgetting sudo breaks 'port uninstall'
MacPorts
noreply at macports.org
Sun Feb 7 11:00:51 PST 2016
#2665: Forgetting sudo breaks 'port uninstall'
-----------------------+---------------------
Reporter: cssdev@… | Owner: rshaw@…
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: base | Version: 1.0
Resolution: fixed | Keywords:
Port: |
-----------------------+---------------------
Changes (by ryandesign@…):
* component: deprecated => base
Old 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 at 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 at 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.
New 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 at 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 at 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/local/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.
--
--
Ticket URL: <https://trac.macports.org/ticket/2665#comment:4>
MacPorts <https://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list