解决方案
一、虚拟机提示-主IP地址:网络信息不可用
1.1 切换至root用户身份
[root@localhost~]
1.2 进入network-sctipts文件夹
cd /etc/sysconfig/network-scripts
1.3 找到ifcfg-ens33文件(虚拟机中),并编辑它
ls
vim ifcfg-ens33
1.4 输入i 进入编辑模式
# ONBOOT=no 原语句
ONBOOT=yes # 修改后
1.5 “:wq”退出后,重启虚拟机(最好连主机一起)
1.6 在root用户/下 安装net-tools工具
yum install net-tools
sudo apt install net-tools
1.7 命令验证
ip addr
ifconfig
二、X:无法定位软件包 net-tools
- 当我们安装好Linux系统后,由于有很多功能、服务没有安装(如ifconfig、vsftpd),所以出现一些command ‘*****’ not found,but can be installed with: xxx错误,我们就需要安装来使用,系统需要进行更新或者升级。
- 导致原因:本地没有该功能相应的资源。
2.1 运行ifconfig命令
~$ ifconfig
2.2 Linux更新系统资源,或者升级软件
-
Linux系统资源更新
sudo apt-get update