Local yum source and online yum source installation method

Local yum source and online yum source installation method

1. Overview of YUM

Software update mechanism based on RPM packages
can automatically resolve dependencies
All packages are provided by the centralized YUM software warehouse

Two, prepare the installation source

(1) How to provide software warehouse

FTP service: ftp://... (not described here)
HTTP service: http://...local
directory: file://...

(2) Source of RPM software package

A collection of RPM packages released by CentOS A collection of RPM packages released by a
third-party organization A collection of
user-defined RPM packages

Three, two ways to install yum warehouse

(1) Install local yum warehouse

step:

1、mount /dev/cdrom /mnt/ #把光盘挂载到/mnt目录下

cd /etc/yum.repos.d/
mkdir repos.bak
mv *.repo repos.bak #把 /etc里面的文件备份到repo.bak

Insert picture description here

2. Configure the local warehouse (the fixed configuration below)

cd /etc/yum.repos.d/
vim local.repo
[local] #仓库类别
name=local #仓库名称
baseurl=file:///mnt #指定URL 访问路径为光盘挂载目录
enabled=1 #开启此yum源,此为默认项,可省略
gpgcheck=0 #不验证软件包的签名

Insert picture description here

3. After the configuration file is saved and exited:

yum clean all && yum makecache #删除yum缓存并更新

Insert picture description here

(2) Use online sources as YUM warehouse

1. Move the local.repo file we created above to the repo.bak directory (it can also be another backup directory)

Insert picture description here

2. Turn on the system that can connect to the Internet

​ Here choose Alibaba Cloud mirror as the online source, you can also choose other

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

将阿里云镜像下载到/etc/yum.repos.d/目录下

Insert picture description here

yum clean all && yum makecache #删除yum缓存并更新

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51573771/article/details/110953622