如果我运行,apt list python-py
我会看到该包python-py
(我刚刚通过 安装,sudo apt install python-py
以为它是其他东西):
Listing... Done
python-py/bionic,bionic 1.5.2-1 all
尝试通过运行来卸载该包sudo apt remove python-py
,我收到以下提示:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python-py' is not installed, so not removed
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
apt
好像自相矛盾,这是怎么回事?
答案1
该apt list
命令不仅仅检查已安装的软件包。它还会检查所有已知来源的所有已知软件包的数据库,无论是否已安装。
apt list
以下是已安装包的示例:
$ apt list python3
Listing... Done
python3/cosmic-updates,now 3.6.7-1~18.10 amd64 [installed]
apt list
会清楚地告诉您哪些包已[安装]。