我最近安装了 Debian 11,然后开始乱搞,最后找不到任何带有 的软件包apt
。例如,当我运行sudo apt install ifconfig
它时,它返回:E: Unable to locate package ifconfig
。我已经读了十几页,它可能与我的文件有关sources.list
。
我检查了文件,一切似乎都很好。内容sources.list
:
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-f>
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib n>
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
#buster-backports
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb http://archive.debian.org/debian stretch main contrib non-free
有人知道如何解决这个问题吗?
的输出LC_ALL=C sudo apt update
是:
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://deb.debian.org/debian buster-backports InRelease
Ign:5 http://archive.debian.org/debian stretch InRelease
Hit:6 http://archive.debian.org/debian stretch Release
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
的输出LC_ALL=C apt search ifconfig
是:
Sorting... Done
Full Text Search... Done
gnome-nettool/oldstable 3.8.1-3 amd64
network information tool for GNOME
inetutils-tools/oldstable 2:2.0-1+deb11u1 amd64
base networking utilities (experimental package)
iproute2/oldstable,now 5.10.0-4 amd64 [installed]
networking and traffic control tools
libnet-ifconfig-wrapper-perl/oldstable 0.26-1 all
multiplatform Perl wrapper for ifconfig
libnet-interface-perl/oldstable 1.016-1+b5 amd64
Perl module for manipulating host network interfaces
libsys-hostip-perl/oldstable 2.120-1 all
Perl module to determine local machine's IP address
moreutils/oldstable 0.65-1 amd64
additional Unix utilities
net-tools/oldstable 1.60+git20181103.0eebece-1 amd64
NET-3 networking toolkit
python-sh/oldoldstable 1.11-1 all
Python subprocess interface
python3-sh/oldstable 1.14.1-1 all
Python 3 subprocess interface
wmifinfo/oldstable 0.11-1 amd64
Dockapp that shows information for all interfaces
答案1
你sources.list
看上去不错*,apt update
工作,apt search
工作。
sudo apt install ifconfig
返回的原因E: Unable to locate package ifconfig
是没有名为 的包ifconfig
。
请阅读我如何找出哪个包拥有某个文件?可执行文件名为ifconfig
在名为的包中net-tools
.这应该有效并为您提供ifconfig
:
sudo apt install net-tools
注意,确实apt search ifconfig
在几个其他软件包中找到了此软件包。您声称“找不到任何带有apt
”的软件包,这似乎没有道理。
* 除了这些non-f>
,n>
我假设它们是发布nano sources.list
(或其他文本编辑器)截断行时打印的内容的结果,而不是发布实际的满的内容sources.list
。