我已经在WSL上为Turi安装了Ubuntu,但是当我开始时:
sudo apt install python3-pip..。我知道错误:
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source"我该怎么解决这个问题?
发布于 2022-08-14 15:42:23
简短答覆:
sudo apt update那就安装。
更多解释:
如果您试图在WSL上安装Ubuntu之后立即安装任何软件包,您将看到以下内容:
Package <package_name> is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source和/或:
E: Package '<package_name>' has no installation candidate这是因为apt缓存尚未填充。为了节省在WSL上下载和安装Ubuntu时的带宽,默认情况下不填充包列表。在WSL上基于apt的发行版上需要一个初始sudo apt update。
但是作为一般规则,在安装任何基于Debian的发行版之后,建议首先使用sudo apt update。否则,您可能会收到安装错误,因为缓存中的包和URL经常更改。
示例-来自WSL上的新Ubuntu安装:
> sudo apt install python3-pip
[sudo] password for ntd:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3-pip' has no installation candidate
> sudo apt update && sudo apt upgrade -y
... output trimmed
> sudo apt install python3-pip
... installs as expectedhttps://stackoverflow.com/questions/73352338
复制相似问题