linux Centos 配置本地yum源
2014-03-06 16:42
561 查看
yum安装源配置两种yum安装源的配置1.操作系统无法联网情况下#mkdir /yum#cd /media/CentOS_5.8_Final/ (进入到系统安装光盘下)#cp * /yum –R#>/etc/yum.repos.d/CentOS-Base.repo(清空该文件)#vi /etc/yum.repos.d/CentOS-Base.repo(为该文件添加如下内容)[rhel-debuginfo]name=Red Hat Enterprise Linuxbaseurl=file:///yum/enabled=1gpgcheck=0 ok!这样要安装什么直接yum install xxx就ok咯^_^ 2.操作系统能联网
由于rhel操作系统没有直接的yum源,所以我们可以更换他的yum包,比如说使用centos的 yum包然后指定centos的yum源,就可以更新软件包了。采用如下步骤更新。最后 yum makecache 以后 yum update 一下,你的系统内核就更换成了centos的了。就跟你直接装的centos的系统差不多了。嘿嘿。装完以后需要重启哟~注意事项:必须注意事项#uname -a 查看操作系统内核是32位还是64位(由此选择不同的下载目录)#cat /etc/issue 或者 cat /etc/redhat-release 查看系统安装的什么操作系统(由此选择不同的下载目录)1.查看操作系统内核: #uname -a Linux IZP 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux 2.查看系统安装的yum程序: #rpm -qa | grep yum yum-metadata-parser-1.1.2-2.el5 yum-3.2.19-18.el5 yum-security-1.1.16-13.el5 yum-rhn-plugin-0.5.3-30.el5 yum-updatesd-0.9-2.el5 3.卸载系统自带安装的yum程序: #rpm -qa | grep yum | xargs rpm -e --nodeps 4.下载CentOS的yum安装包: #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-26.el5.centos.noarch.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm #wget http://ftp.sjtu.edu.cn/centos/5/os/x86_64/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm 5.安装下载点rpm安装包: #rpm -ivh *.rpm --nodeps 6.创建yum源: #vi /etc/yum.repos.d/CentOS-Base.repo ==================================== [base] name=CentOS-5 - Base baseurl=http://ftp.sjtu.edu.cn/centos/5/os/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 #released updates [update] name=CentOS-5 - Updates baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-5 - Addons baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-5 - Extras baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/x86_64/ gpgcheck=1 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-5 - Plus baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/x86_64/ gpgcheck=1 enabled=0 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-5 - Contrib baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/x86_64/ gpgcheck=1 enabled=0 gpgkey=http://ftp.sjtu.edu.cn/centos/RPM-GPG-KEY-CentOS-5 ======================================= 7.测试yum是否成功: yum makecache 以后 yum update 一下 安装成功之后仍然报错。可能是如下原因:如果升级python2.6后,不能使用YUM可使用如下办法解决. 恢复办法: rm -rf /usr/bin/python ln -s /usr/bin/python2.4 /usr/bin/python 或者修改: # vi /usr/bin/yum //来指定一下版本,更简单。 #!/usr/bin/python2.4import sys |
相关文章推荐
- Centos6 编译安装Python
- 硬盘安装CentOS 6.2以及添加GRUB启动菜单
- CentOS 6.2实战部署Nginx+MySQL+PHP
- centos 5.6 升级php到5.3的方法
- CentOS mysql安装系统方法
- centos下安装mysql服务器的方法
- CentOS 5.1 4.6最新官方下载地址列表
- Centos搭建GTK+Codeblock完整版
- CentOS 5.1下跑Mono和Asp.net的实现方法
- centos 安装免费控制面板kloxo步骤
- CentOS服务器+监控宝SNMP监控全攻略分享
- Centos 5下配置https服务器的方法
- centos 5.1下的安全设置(适合所有的linux版本)
- 比较详细的基于CentOS的WWW服务器架设指南第1/2页
- CentOS 5.4 服务器配置 yum安装Apache+php+Mysql
- CentOS的图形安装及初始环境设置教程
- linux服务器用centos还是ubuntu系统
- CentOS 5.5使用yum来安装LAMP(php运行环境)
- 使用LNMP一键安装包配置CentOS服务器环境教程
- CentOS Linux 下配置Apache2+PHP5+MySQL5+GD库的方法