让 CentOS 使用 yum

本文详细介绍了从普通码农成长为架构师的步骤和关键技能,包括下载并安装yum,配置yum仓库,理解版本与架构的重要性,并提供实际操作指南。文章深入探讨了成为架构师所需的技术积累和思维方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 下载安装 yum

Download CentOS6.3 yum i386: wget http://mirrors.163.com/centos/6.3/os/i386/Packages/yum-3.2.29-30.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.3/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm wget http://mirrors.163.com/centos/6.3/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm wget http://mirrors.163.com/centos/6.3/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

x86_64: wget http://mirrors.163.com/centos/6.3/os/x86_64/Packages/yum-3.2.29-30.el6.centos.noarch.rpm wget http://mirrors.163.com/centos/6.3/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm wget http://mirrors.163.com/centos/6.3/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm wget http://mirrors.163.com/centos/6.3/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

Install CentOS6.3 yum i386: rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm (Must install both at the same time.)

x86_64: rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm rpm -ivh yum-3.2.29-30.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

  1. 配置 新建 /etc/yum.repos.d/CentOS5-Base.repo 一个文件,内容如下:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#  file: /etc/yum.repos.d/CentOS5-Base.repo
#  yum clean all
#  yum makecache
#

[base]
name=CentOS-5.10 - Base
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates 
[updates]
name=CentOS-5.10 - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-5.10 - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=addons
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5.10 - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5.10 - Plus
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5.10 - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

其中 版本为 : 5.10, arch 为 x86_64, 请自己修改相应的版本号

我们看到,http://mirrorlist.centos.org/?release=5.10&arch=x86_64&repo=os 对应下面的mirror列表

  1. 然后运行下面的目录,更新 yum repo
# yum clean all
# yum make clean
  1. 然后就可以使用 yum 了
# yum search xxx
# yum install xxx

转载于:https://my.oschina.net/sub/blog/312169

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值