rhel7.2 yum使用CentOS 的更新包
redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题。
首先删除redhat原有的yum ,因为redhat 原本的yum 没有注册为redhat用户是用不了的,输入如下命令行:
redhat 的更新包只对注册的用户生效,所以我们自己手动更改成CentOS 的更新包,CentOS几乎和redhat是一样的,所以无需担心软件包是否可安装,安装之后是否有问题。
1、首先删除redhat原有的yum ,因为redhat 原本的yum 没有注册为redhat用户是用不了的。
rpm -aq|grep yum|xargs rpm -e --nodeps
rpm -aq|grep python-iniparse|xargs rpm -e --nodeps 12
2、下载163的yum 安装包
subscription-manager 是管理系统软件的工具,要想redhat 公司购买账号,输入账号信息后,就可以用yum了,http://linux.die.net/man/8/subscription-manager,详细的看这里。
subscription-manager is a client program that registers a system with the Certificate-Based Red Hat Network. To register your system with RHN Classic or with an RHN Satellite 5.x system, then use the rhn_register tool.
Red Hat provides content updates and support by issuing subscriptions for its products. These subscriptions are allocated to systems (machines); once a system is subscribed to content, it is entitled to install and update that software product. IT administrators need to track these subscriptions and how they are assigned. This entitlement and subscription management is a feature available for Red Hat platforms version 5.7 (and later) and version 6.1 (and later).
一、挂载本地光盘到系统:把rhel7.2安装光盘放入光驱,在终端命令行下操作
mkdir /run/media/rhel #新建挂载目录
mount /dev/cdrom /run/media/rhel #挂载光盘到/run/media/rhel目录下
cd /run/media/rhel #进入挂载目录
ls #查看挂载目录,光盘挂载成功
注册这块确实有变化,以前6的早期版本一般使用rhn_register之类的命令管理注册,6后期的版本包括7使用subscription-manager注册
redhat.repo是注册之后才会用到的,平时一般咱们都是私有本地repo,一般用不到的
而且redhat.repo不需要手动改,一般也是通过subscription-manager修改
那个文件确实跟注册有关,你注册后enable的channel都会在那个文件里自动生成
二、配置本地yum源
cd/etc/yum.repos.d/ #进入yum配置目录
touch rhel-media.repo #建立yum配置文件
vi rhel-media.repo #编辑配置文件,添加以下内容
[rhel-media]
name=Red Hat Enterprise Linux 7.2
baseurl=file:///run/media/rhel
enabled=1
gpgcheck=1
gpgkey=file:///run/media/rhel/RPM-GPG-KEY-redhat-release
三、清除yum缓存,使用yum install自动安装软件
yum clean all #清除yum缓存
yum install php #安装php
- RHEL6.0使用centos的YUM更新源
- RHEL 5.3使用Centos 5.3的 yum 源进行更新和安装软件
- 如何使用 yum-cron 自动更新 RHEL/CentOS Linux | Linux 中国
- 如何使用 yum-cron 自动更新 RHEL/CentOS Linux
- Centos/RHEL 使用yum安装LAMP
- RHEL 7.2 Centos 7.2 中如何在命令行中使用/操作/配置无线网卡wifi
- 在CentOS/RHEL 6.2上使用YUM安装PHP5.4
- 在CentOS/RHEL 6.2上使用YUM安装PHP5.4
- centos7.2+python2.7 gdal安装教程(校园网开启防火墙,无法使用yum,pip等工具)
- RHEL/CentOS 5.x使用yum快速安装MySQL 5.5.x
- CentOS 使用 yum 更新软件包与系统
- 利用CentOS的yum更新源来实现RHEL5的YUM功能
- Linux使用错误小结(CentOS)- yum更新软件失败
- RHEL/CentOS 下安装yum源地址汇集---不定期更新
- 64位操作系统下使用YUM只安装纯净64位软件包(RHEL 5.4 /CentOS 5.4)
- RHEL6.5系统默认不支持yum源,将红帽系统的yum源改成CentOS的yum源,可以免费使用
- 在RHEL 6.5上使用yum更新/安装软件
- RHEL/CentOS/SL Linux 6.x使用EPEL 6的yum软件源
- CentOS 7 更新源 – 使用国内 163 yum 源
- RHEL 6.4使用CentOS 6.4 yum源更新-i386的脚本