how-to-set-up-yum-repo

UP: Tutorials

If you want set up a specific YUM repository, you have to create a custom file *.repo in /etc/yum.repos.d.

I created my.repo file shown below

# my.repo

#

[JAIST-BASE]

name=CentOS-$releasever - Base

baseurl=http://ftp.jaist.ac.jp/pub/Linux/CentOS/$releasever/os/$basearch

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[JAIST-EPEL]

name=Extra Packages for Enterprise Linux 6 - $basearch

baseurl=http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

Repository ID is shown between [ ]. For example, the repo of JAIST-BASE has url address of http://ftp.jaist.ac.jp/pub/Linux/CentOS/. The full list of mirror sites for base packages can be found at centOS webpage. The full list of mirror sites for EPEL(Extra Packages for Enterprise Linux) is given at fedora mirror manager.

To produce a list of configured repositories,

# yum repolist

Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-

: packagekit, security, tmprepo, verify, versionlock

Loading support for CentOS kernel ABI

Loading mirror speeds from cached hostfile

* base: data.nicehosting.co.kr

* epel: mirror01.idc.hinet.net

* extras: data.nicehosting.co.kr

* updates: mirror.oasis.onnetcorp.com

JAIST-BASE | 3.7 kB 00:00

JAIST-BASE/primary_db | 4.7 MB 01:15

JAIST-EPEL | 4.3 kB 00:00

JAIST-EPEL/primary_db | 5.9 MB 01:44

repo id repo name status

JAIST-BASE CentOS-6 - Base 6,696

JAIST-EPEL Extra Packages for Enterprise Linux 6 - x86_64 12,228

base CentOS-6 - Base 6,696

epel Extra Packages for Enterprise Linux 6 - x86_64 12,228

extras CentOS-6 - Extras 62

updates CentOS-6 - Updates 603

repolist: 45,209

To find a package at a specified YUM repository,

yum --disablerepo=*" --enablerepo="REPOID" list | grep PKGNAME

# yum --disablerepo="*" --enablerepo="JAIST-EPEL" list | grep sympy

sympy.noarch 0.6.3-3.el6 @epel

UP: Tutorials