-
[root@localhost ~]# yum -ivh python-iniparse-0.4-9.el7.noarch.rpm
-
[root@localhost ~]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
-
[root@localhost ~]# rpm -ivh python-chardet-2.2.1-1.el7_1.noarch.rpm
-
[root@localhost ~]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
-
[root@localhost ~]# rpm -ivh yum*
在网上下载repo文件上传到etc/yum.repos.d/ 目录下
repo地址:
做完之后发现,%24releasever/os/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found,再比较网上的rpm包路径,建议把下载下来的Centos-7.repo文件进行修改
:%s/$releasever/7/g
进行测试:
yum clean all
-
root@localhost yum.repos.d]# yum install wget
-
已加载插件:fastestmirror, product-id, subscription-manager
-
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
-
base | 3.6 kB 00:00:00
-
extras | 3.4 kB 00:00:00
-
updates | 3.4 kB 00:00:00
-
(1/4): extras/x86_64/primary_db | 149 kB 00:00:00
-
(2/4): base/x86_64/group_gz | 155 kB 00:00:00
-
(3/4): updates/x86_64/primary_db | 5.7 MB 00:00:05
-
base/x86_64/primary_db FAILED
2.ifconfig命令没有的解决办法
ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装Redhat等Linux发行版的时候会默认不安装ifconfig等命令。我们的环境变量里有/sbin这个路径,也就是说如果ifconfig命令存在并且就是位于/sbin目录下的话我们肯定就是可以运行的,结果表明我们的/sbin目录下并没有ifconfig命令,所以我们的结论是:我们的Redhat7里边是没有安装ifconfig。
我们的解决办法是:yum安装ifconfig这个命令包
root@localhost ~]# yum search ifconfig
已加载插件:fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
====================================================================================== 匹配:ifconfig =======================================================================================
net-tools.x86_64 : Basic networking tools
[root@localhost ~]#
ifconfig这个命令是在net-tools.x86_64这个包里,接下来我们安装这个包就行了。
[root@localhost ~]# yum install net-tools
已加载插件:fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 net-tools.x86_64.0.2.0-0.17.20131004git.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
=============================================================================================================================================================================================
Package 架构 版本 源 大小
=============================================================================================================================================================================================
正在安装:
net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k
事务概要
=============================================================================================================================================================================================
安装 1 软件包
总下载量:304 k
安装大小:917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
验证中 : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
已安装:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
完毕!
[root@localhost ~]# ifconfig
eno16777736: flags=4163 mtu 1500
inet 192.168.1.109 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:feb3:a90 prefixlen 64 scopeid 0x20
ether 00:0c:29:b3:0a:90 txqueuelen 1000 (Ethernet)
RX packets 17751 bytes 21269888 (20.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5468 bytes 617049 (602.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#
此内容介绍到此,可以加入此群号一起学习linux知识: