Related pages
Example1
proxy=http://proxysvr.yourdom.com:3128
Example2
#If the proxy server requires authentication proxy=http://proxysvr.yourdom.com:3128 proxy_username=yumacc proxy_password=clydenw
# grep -E "\[*\]|name|baseurl" /etc/yum.repos.d/*.repo
# yum --disablerepo=* --enablerepo=test-repo repolist
Directive | Description |
---|---|
name | Descriptive name for the repository channel. This directive must be specified. |
baseurl | Location of the repository channel (expressed as a file://, ftp://, http://, or https:// address). This directive must be specified. |
gpgcheck | If set to 1, verify the authenticity of the packages by checking the GPG signatures. You might need to set gpgcheck to 0 if a package is unsigned. |
enabled | If set to 1, permit yum to use the channel. |
gpgkey | Pathname of the GPG public key file. |
Variable | Explanation | Example |
---|---|---|
$releasever | You can use this variable to reference the release version of Red Hat Enterprise Linux. Yum obtains the value of $releasever from the distroverpkg=value line in the /etc/yum.conf configuration file. | 6.4 |
$arch | You can use this variable to refer to the system's CPU architecture | i586, i686, x86_64 |
$basearch | You can use $basearch to reference the base architecture of the system. | i386, x86_64 |
Custome Variables
echo "Red Hat Enterprise Linux" > /etc/yum/vars/osname
XXX.repo
name=$osname $releasever
/etc/yum.repos.d/CentOS-Base.repo
repository | enabled | Explanation |
---|---|---|
base | 1 | This repository is equal to DVD iso. |
updates | 1 | released updates |
extras | 1 | additional packages that may be useful |
centosplus | 0 | additional packages that extend functionality of existing packages |
contrib | 0 | packages by Centos Users |
Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux,
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm or # wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm
/etc/yum.repos.d/epel.repo
[epel] (abbr) enabled=0 #temporality (1:enable, 0:temporality) (abbr)
Example
# yum search python26 --enablerepo=epel # yum -y install python26 --enablerepo=epel
/etc/yum.repos.d/tmp.repo
[tmp-repo] name=TMP repo baseurl=http://192.168.0.100/repo/spp/RedHatEnterpriseServer/6.7-Server/x86_64/current gpgcheck=0 enabled=1
check with 'yum repolist'
'# yum --disablerepo=* --enablerepo=test-repo repolist'
/etc/yum.repos.d/dvd.repo
# mount /dev/cdrom /mnt
[dvd] baseurl=file:///mnt/repo/Server enabled=0 gpgcheck=1 gpgkey=file:///mnt/RPM-GPG-KEY-redhat-release
# yum --disablerepo=\* --enablerepo=dvd list # yum search XXXX --disablerepo=\* --enablerepo=dvd # yum -y install XXXX --disablerepo=\* --enablerepo=dvd
/etc/yum.repos.d/intra-repo.repo
[intra-repo] name=CentOS-6.5 - Intra repo baseurl=http://192.168.0.100/yum/$basearch/ gpgcheck=0 enabled=1 [intra-repo-rpm] name=Intra repo rpm baseurl=http://192.168.0.100/yum/rpm/ gpgcheck=0 enabled=1 [intra-repo-extra] name=Intra repo extra baseurl=http://192.168.0.100/yum/extra/ gpgcheck=0 enabled=0
http://vault.centos.org/
/etc/yum.repos.d/CentOS-Base.repo
[base] name=CentOS-$releasever - Base baseurl=http://vault.centos.org/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates baseurl=http://vault.centos.org/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
/etc/yum.repos.d/CentOS-Base.repo
[base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-$releasever [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-$releasever [extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-$releasever
mount -o loop /home/elf/isos/CentOS-6.0-x86_64-bin-DVD1.iso /mnt/cdmedia rsync -av /mnt/cdmedia/Packages /var/www/html/CentOS-6.0/x86_64/. rsync -av /mnt/cdmedia/repodata /var/www/html/CentOS-6.0/x86_64/. umount /mnt/cdmedia mount -o loop /home/elf/isos/CentOS-6.0-x86_64-bin-DVD2.iso /mnt/cdmedia rsync -av /mnt/cdmedia/Packages /var/www/html/CentOS-6.0/x86_64/. umount /mnt/cdmedia createrepo /var/www/html/CentOS-6.0/x86_64/
rsync -avSHP --delete --exclude "local*" --exclude "isos" rsync://example.com/centos/5.4/ /var/www/html/mirror/centos/5.4/ #Example #http://ftp.riken.jp/Linux/centos/6/ #ftp://ftp.riken.jp/Linux/centos/6/ #CentOS 6 x64 rsync -rptv --delete rsync://ftp.nara.wide.ad.jp/pub/Linux/centos/6/updates/x86_64/ /var/www/centos/6/updates/x86_64/ rsync -rptv --delete rsync://ftp.nara.wide.ad.jp/pub/Linux/centos/6/os/x86_64/ /var/www/centos/6/os/x86_64/ #CentOS 5 x64 # rsync -rptv --delete rsync://ftp.nara.wide.ad.jp/pub/Linux/centos/5/updates/x86_64/ /var/www/centos/5/updates/x86_64/ # rsync -rptv --delete rsync://ftp.nara.wide.ad.jp/pub/Linux/centos/5/os/x86_64/ /var/www/centos/5/os/x86_64/
cobbler import --path=rsync://your_centos_mirror_site/centos --name=centos --arch=x86_64 #cron 0 1 * * */usr/bin/cobbler reposync --tries=3 --no-fail > /dev/null 2>&1
/etc/yum.repos.d/CentOS-Base.repo
[base] name=CentOS-$releasever - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ baseurl=http://192.168.0.10/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 priority=1 #released updates [updates] name=CentOS-$releasever - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ baseurl=http://192.168.0.10/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 priority=1
Creating a new Repository
yum install createrepo cp myfile1.rpm /var/www/html/myrepo/x86_64/RPMS/ createrepo /var/www/html/myrepo/x86_64/RPMS
Updateing a Repository
cp myfile2.rpm /var/www/html/myrepo/x86_64/RPMS/ createrepo --update /var/www/html/myrepo/x86_64/RPMS
/etc/yum.repos.d/my.repo
# my original yum repository [mypkgs] name=my original RPM packages baseurl=http://192.168.0.10/myrepo/x86_64/RPMS/ gpgcheck=0 enabled=1
check repository
yum repolist or yum --enablerepo=myrepo list
Related pages