Post by Jake MI accidentally installed pip or pip3 as root and got the warning about
possible danger to my system. Therefore, I'd like to remove it. Please
let me know the best commands and thanks in advance.
https://www.getpagespeed.com/server-setup/do-not-run-pip-as-root
"Now, pip is the installer/manager for Python modules available via PyPI.
But it has no idea whatsoever about your package manager.
It has no idea about RPM format either, nor about what you already
have installed through the system (yum) packages.
So when you invoke pip as root, it will more than likely overwrite Python modules
that were installed via system packages.
The result of running pip as root, would be a dirty mix of Python modules
installed via yum package management, and pip installed Python modules.
Example of breakage
...
"
So if you ran "pip" as root again, did "pip remove",
then I would expect damage where a system version of a
file would be removed. Then if you used the package management
to remove pip locally, now you'd have a gap-toothed set of
system python packages.
Which is better then ? To have "pip remove" the erroneous files,
or have non-root "pip remove" leave the tainted (unknown version)
of a file put there instead ? Now you need a means to have your
package manager reinstall all the system modules.
When a software developer knows that root usage is destructive,
not only should they issue a warning, they should "drop dead" on
the spot, and stop doing shit. If the activity serves no useful
purpose (damaging tree-installed content), what the hell ? There
are already some other softwares on your machine, that check for
root invocation and deny it.
( Um, yeah, this looks safe. An official version of this approach might be nice. )
https://askubuntu.com/questions/57682/find-and-reinstall-packages-with-corrupted-files-without-breaking-anything
Summary: All I've tried to do here, is find an example of what the
damage mechanism is. You're the administrator, and now it
is up to you to deal with a malicious case of tree damage.
Reinstalling packages is one way to un-taint them.
Even modifying a script to just produce a scan of the tree
without fixing anything, is a start.
Paul