[英]Trying to delete all installed files on ubuntu
I want to delete all the packages installed when I ran我想删除运行时安装的所有软件包
sudo apt install python3-pip
which is the only thing I installed so far (alongside numpy).这是我迄今为止安装的唯一东西(与 numpy 一起)。 I tried using
我尝试使用
pip3 uninstall -y -r <(pip freeze)
But for every single package in pip3 list I get a statement as such:但是对于 pip3 列表中的每一个 package 我都会得到这样的声明:
Found existing installation attrs 19.3.0找到现有的安装 attrs 19.3.0
Not uninstalling attrs at /ur/lib/python3/dist-packages, outside environment /usr不在 /ur/lib/python3/dist-packages 卸载 attrs,外部环境 /usr
Can't uninstall 'attrs'.无法卸载“属性”。 No files were found to uninstall.
找不到要卸载的文件。
This is on a Windows OS using the Windows Subsystem for linux and Ubuntu 20.04.2.这是在 Windows 操作系统上使用 Windows 子系统的 linux 和 Z3D945423F8E9496C429A5D8.045B。
Can't seem to find a solution online that doesn't display the bold text above:(似乎无法在线找到不显示上面粗体文本的解决方案:(
You can do an apt-get remove <package_name>
OR an apt-get purge <package_name>
.您可以执行
apt-get remove <package_name>
或apt-get purge <package_name>
。
remove will uninstall the binaries and can be executed like so: remove将卸载二进制文件,可以像这样执行:
sudo apt-get remove python3-pip
purge will uninstall the binaries and remove any related cruft like config files that were created as a part of the installation. purge将卸载二进制文件并删除任何相关的杂乱无章的配置文件,例如在安装过程中创建的配置文件。 You can execute like so:
你可以像这样执行:
sudo apt-get purge python3-pip
If you installed libraries specifically via pip3 install
and wanted to delete everything you've installed via pip3, you can do:如果您专门通过
pip3 install
安装了库并想删除您通过 pip3 安装的所有内容,您可以执行以下操作:
for x in $(pip3 list | awk '{print $1}' | egrep -v '^(Package|[-]+)'); do echo "${x}"; done
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.