Ubuntu 無(wú)法使用ifconfig解決辦法
在使用ubuntu時(shí)需要使用ifconfig命令提示
Command 'ifconfig' not found, did you mean:
command 'iconfig' from deb ipmiutil (3.1.5-1)
command 'pifconfig' from deb python3-ethtool (0.14-3build1)
command 'fconfig' from deb redboot-tools (0.7build3)
Try: sudo apt install <deb name>
在網(wǎng)上找了很多方法說(shuō)嘗試
sudo apt-get update
apt-get install net-tools
和更換鏡像源還是不行。
最后發(fā)現(xiàn)在 Ubuntu 20.04 中,ifconfig 命令已被棄用并替換為 ip 命令。
可以使用以下命令來(lái)查看網(wǎng)絡(luò)接口和 IP 地址:
ip addr show
該命令將顯示當(dāng)前系統(tǒng)上所有網(wǎng)絡(luò)接口的詳細(xì)信息,包括每個(gè)接口的 IP 地址、MAC 地址和其他網(wǎng)絡(luò)配置。如果只想查看特定接口的信息,可以在命令后面加上接口名,如下所示:
ip addr show eth0
其中 eth0 是要查看信息的接口名稱。
最近通過(guò)更換清華鏡像源后成功安裝了ifconfig;
具體步驟如下
[安裝ifconfig解決方法]:
1、在 /etc/apt/sources.list
末尾增加如下源sudo gedit /etc/apt/sources.list
【修改sources.list文件需要使用sudo賦予權(quán)限】
將如下copy,粘貼至sources.list
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
注意: 這里的“focal”是ubuntu20.04的版本代號(hào)。
?? ? ubuntu18.04的版本代號(hào)是“bionic”
? ? ? 可以在終端通過(guò) lsb_release -a 進(jìn)行查看 即Codename所對(duì)應(yīng)的值
? ? ? 2、然后更新文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-455718.html
sudo apt-get update
最后安裝文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-455718.html
sudo apt install net-tools
到了這里,關(guān)于【Ubuntu 無(wú)法使用ifconfig解決辦法】的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!