Linux configuration local yum (CentOS7)

I often encounter problems in the work process that the system with the mini version is missing user components or dependencies, but the production environment cannot access the external network, which is very troublesome

Here we introduce how to use local yum

All yum of CentOS7 are stored in /etc/yum.repos.d

1.cd /etc/yum.repos.d

You can make a backup of the original repo

mkdir -p /etc/yum.repos.d/bak

mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak

2. Set up a local repo

vim local.repo

#centos 7
[local]
name = local
baseurl = file:///mnt/
gpgcheck = 0
enabled = 1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#Note: The baseurs here is the path you want to mount in a while

3. Mount the decompressed system and share it

4. Mount the share

mount -t cifs -o username="username",password='password',gid=65534,uid=65534,vers=2.1 //shared IP address/CentOS-7/ /mnt/

5.yum clean all

6.yum makecache

Then you can use yum to install the software

 

Guess you like

Origin blog.csdn.net/zetion_3/article/details/103855251