Chinaunix首页 | 论坛 | 博客
  • 博客访问: 346694
  • 博文数量: 81
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 847
  • 用 户 组: 普通用户
  • 注册时间: 2015-03-25 22:29
个人简介

执一不失,能君万物http://weidian.com/s/284520723?wfr=c

文章分类

全部博文(81)

文章存档

2016年(11)

2015年(70)

我的朋友

分类: LINUX

2016-07-09 01:56:35

RHEL7.0最小化安装之后缺少太多的功能,急需配置yum;
redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题
1.配置成Centos7.0的源

点击(此处)折叠或打开

  1. [root@localhost yum.repos.d]# rpm -qa|grep yum
  2. yum-metadata-parser-1.1.4-10.el7.x86_64
  3. yum-3.4.3-118.el7.noarch
  4. yum-rhn-plugin-2.0.1-4.el7.noarch
  5. [root@localhost yum.repos.d]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps
  6. [root@localhost yum.repos.d]# rpm -e yum-3.4.3-118.el7.noarch --nodeps
  7. [root@localhost yum.repos.d]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps
  8. [root@localhost yum.repos.d]# rpm -qa|grep yum
  9. [root@localhost yum.repos.d]#
进入以下网站上面查看软件包的版本是否升级或者找到自己系统所对应的文件包版本更新:

需要下载一下rpm包:
-rw-r--r--. 1 root root  232224 7月   9 01:06 python-chardet-2.2.1-1.el7_1.noarch.rpm
-rw-r--r--. 1 root root   39800 7月   9 01:05 python-iniparse-0.4-9.el7.noarch.rpm
-rw-r--r--. 1 root root  273012 7月   9 00:50 python-kitchen-1.1.1-5.el7.noarch.rpm
-rw-r--r--. 1 root root 1272736 7月   9 00:44 yum-3.4.3-132.el7.centos.0.1.noarch.rpm
-rw-r--r--. 1 root root   28348 7月   9 00:44 yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
-rw-r--r--. 1 root root   30600 7月   9 00:46 yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
-rw-r--r--. 1 root root   23432 7月   9 00:45 yum-updateonboot-1.1.31-34.el7.noarch.rpm
-rw-r--r--. 1 root root  115904 7月   9 00:44 yum-utils-1.1.31-34.el7.noarch.rpm
安装顺序:


点击(此处)折叠或打开

  1. [root@localhost ~]# yum -ivh python-iniparse-0.4-9.el7.noarch.rpm
  2. [root@localhost ~]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
  3. [root@localhost ~]# rpm -ivh python-chardet-2.2.1-1.el7_1.noarch.rpm
  4. [root@localhost ~]# rpm -ivh python-kitchen-1.1.1-5.el7.noarch.rpm
  5. [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

点击(此处)折叠或打开

  1. root@localhost yum.repos.d]# yum install wget
  2. 已加载插件:fastestmirror, product-id, subscription-manager
  3. This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  4. base | 3.6 kB 00:00:00
  5. extras | 3.4 kB 00:00:00
  6. updates | 3.4 kB 00:00:00
  7. (1/4): extras/x86_64/primary_db | 149 kB 00:00:00
  8. (2/4): base/x86_64/group_gz | 155 kB 00:00:00
  9. (3/4): updates/x86_64/primary_db | 5.7 MB 00:00:05
  10. 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知识:

点击(此处)折叠或打开

  1. Linux攻城湿学习交流群






阅读(2386) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~