1. 程式人生 > >服務搭建第0步之YUM配置

服務搭建第0步之YUM配置

linuxyum

系統版本:CentOS7.X

在線YUM


# vi /etc/yum.repos.d/CentOS-Base.repo (編輯自帶YUM配置文件

[base]

name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

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

#released updates

[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

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

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

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

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

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

# yum clean all (清空緩存

# yum makecache (重建緩存


本地YUM


# mount /dev/sr0 /mnt (掛載鏡像文件

# ll /mnt (查看鏡像目錄下有repodata數據庫目錄

drwxrwxr-x. 2 admin admin 4096 Dec 5 2016 repodata

# rm -rf /etc/yum.repos.d/* (清空YUM工具配置文件

# vi /etc/yum.repos.d/local.repo (創建本地配置文件

[local]

name=local #庫名

baseurl=file:///mnt #庫路徑,指向存有repodata數據庫目錄的文件夾

gpgcheck=0 #安裝時跳過簽名檢查/

enable=1 #開啟此配置

# yum clean all (清空緩存

# yum makecache (重建緩存


服務搭建第0步之YUM配置