创建私有yum仓库

创建私有yum仓库

Written by Zak Zhu

参考

  • 马哥linux视频
  • RHCE培训(rh133-unit2)

创建私有yum仓库思路

Creating a Private yum Repository

  • Create a directory to hold your packages
  • Make this directory available via http or ftp or nfs
  • Install the createrepo RPM
  • Run createrepo -v /dir/packagedir
    • Creates/Re-creates a repodata subdirectory
    • Files contain extracted package header information

配置文件

  • /etc/yum.conf

    Default settings in /etc/yum.conf

    创建私有yum仓库

  • /etc/yum.repos.d/

    yum配置中的宏:

    • $releasever # 只替换主版本号
    • $basearch # 系统基本架构

    vim /etc/yum.repos.d/REPO_NAME.repo

    [repo-name] # yum源在本地, repo-name一般取名为base

    name= A nice description

    baseurl=URL

    • baseurl=file:///path/to/repodata_parent_dir
    • baseurl=http://server/path/to/repodata_parent_dir
    • baseurl=ftp://server/path/to/repodata_parent_dir
    • baseurl=nfs://server/nfs_path

    enabled=1

    gpgcheck=0

    cost=1000 # 默认yum仓库cost为1000, cost越小越优先

    创建私有yum仓库

创建yum源

# Step1
mount /dev/sr0 /mnt/cdrom
临时配置下yum仓库
yum install createrepo -y # Step2
cd /var/www/html/
mkdir -p redhat/releases/6Server/os/x86_64/
cp /mnt/cdrom/* ./ -avr
rm ./repodata -rf # Step3
createrepo -v /var/www/html/redhat/releases/6Server/os/x86_64/

最后秀一下实验结果哈

创建私有yum仓库

创建私有yum仓库

上一篇:poj1017


下一篇:python opencv SIFT,获取特征点的坐标位置