ifconfig查看IP地址遇到的一系列问题
想用python虚拟环境,网上下载了ubuntu20.4镜像装了一个vmware虚拟机
http://mirrors.aliyun.com/ubuntu-releases/20.04/ ubuntu20.4下载地址
打开后ifconfig没有ip地址
终端运行 sudo apt install net-tools 后提示软件包net-tools没有可安装候选
需要更新软件源
sudo apt-get update
更新很慢,到最后还出现了报错
想试试重新更新的时候出现了无法定位软件包错误
我百度之后更换国内软件源可以解决
打开源配置文件
sudo gedit /etc/apt/sources.list (gedit和/中间加个空格)
将里面的内容更换为国内阿里的源地址
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
其他源可自行百度
保存退出
就能正常安装net-eools后查看ip地址了