搭建linux的YUM源

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1.启动REDHAT Linux ,并放入安装光盘

2.挂载光驱 mount /dev/cdrom /mnt

3.安装createrepo软件包

cd /mnt/Server

rpm -ivh createrepo*

4.删除原来的/etc/yum.conf文件和/etc/yum.repo.d目录

rm -rf /etc/yum.conf

cd /etc/yum.repos.d/

rm -rf rhel-debuginfo.repo

5.重新编译配置文件

vi /etc/yum.conf

[main]

cachedir=/var/cache/yum

keepcache=1

debuglevel=2

logfile=/var/log/yum.log

pkgpolicy=newest

distroverpkg=redhat-release

tolerant=1

exactarch=1

obsoletes=1

gpgcheck=1

plugins=1

metadata_expire=1800

# PUT YOUR REPOS HERE OR IN separate files named file.repo

# in /etc/yum.repos.d

[base]

name=centos-5 - Base

baseurl=/centos/5/os/i386/

# the other site: /centos/5/os/i386/

# you can find more site in: /modules/tinycontent/in dex.php?id=13

enabled=1

gpgcheck=1

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 #released updates

[update]

name=CentOS-5 - Updates

baseurl=/centos/5/updates/i386/

gpgcheck=1

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released

[addons]

name=CentOS-5 - Addons

baseurl=/centos/5/addons/$basearch/

gpgcheck=1

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful

[extras]

name=CentOS-5 - Extras

baseurl=/centos/5/extras/$basearch/

gpgcheck=1

gpgkey=/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages [centosplus]

name=CentOS-5 - Plus

baseurl=/centos/5/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users

[contrib]

name=CentOS-5 - Contrib

baseurl=/centos/5/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 #packages in testing

[testing]

name=CentOS-5 - Testing

baseurl=/centos/5/testing/$basearch/

gpgcheck=1

enabled=0

gpgkey=/centos/5/os/i386/RPM-GPG-KEY-CentOS-5 :wq 保存

到此就ok了,是不是很方便!!!,这个是中科大的源,号称每隔小时跟新一次,速度确实蛮快

连上网测试下,

yum -y install system-config-date ok.................................

yum -y install system-config-date

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

update | 1.9 kB 00:00

primary.sqlite.bz2 | 332 kB 00:15

base | 2.1 kB 00:00

primary.sqlite.bz2 | 1.6 MB 00:22

addons | 951 B 00:00

primary.xml.gz | 202 B 00:00

extras | 2.1 kB 00:00

primary.sqlite.bz2 | 185 kB 00:06

Setting up Install Process

Parsing package install arguments

Resolving Dependencies

--> Running transaction check

---> Package system-config-date.noarch 0:1.8.12-4.el5.centos set to be updated

--> Finished Dependency Resolution

Dependencies Resolved

===================================================================== ===========

Package Arch Version Repository

Size

===================================================================== ===========

Updating:

system-config-date noarch 1.8.12-4.el5.centos base 1.5 M Transaction Summary

===================================================================== ===========

Install 0 Package(s)

Update 1 Package(s)

Remove 0 Package(s)

Total download size: 1.5 M

Downloading Packages:

system-config-date-1.8.12-4.el5.centos.noarch.rpm | 1.5 MB 00:38 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

相关文档
最新文档