Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Yum source building, including intranet and local yum sources: draw lessons from a lot of netizens. Contain a lot of

Shulou Source: shulou.com Published: 2022-06-01 07:14:15 10月24日 Update

Http://www.zyops.com/autodeploy-yum Zhang directed the blog

The details are attached:

Concrete construction

Chapter 1 Fast deployment script for setting up Local yum Source 1.1: mkdir / mnt/cdrommount / dev/cdrom / mnt/cdromecho "mount / dev/cdrom / mnt/cdrom" > > / etc/rc.localcd / etc/yum.repos.d/cp CentOS-Base.repo CentOS- Base.repo.source.bak.`date +% Ymuri% d`cat > / etc/yum.repos.d/CentOS-Base.repo / etc/rc.local writes mount commands to / etc/rc.local

In the configuration file, the purpose is to realize the automatic mount of the optical drive when booting.

Cd / etc/yum.repos.d/ changes to the YUM configuration file directory

Cp CentOS-Base.repo CentOS-Base.repo.bak backs up the original YUM configuration file

Cat > / etc/yum.repos.d/CentOS-Base.repo / etc/rc.local will mount the command

Write it to the / etc/rc.local configuration file in order to automatically mount the CD-ROM drive when booting

[root@localhost ~] # cat / etc/rc.local | grep mount checks whether the mount command is written to

/ etc/rc.local in this configuration file. Method 1

[root@localhost ~] # tail-1 / etc/rc.local method 2

Mount / dev/cdrom / mnt/

1.2.4 back up the original YUM configuration file of the system

[root@localhost ~] # cd / etc/yum.repos.d/ switch to the YUM configuration file directory

[root@localhost yum.repos.d] # cp CentOS-Base.repo CentOS-Base.repo.local.bak backup original

Start YUM profile

[root@localhost yum.repos.d] # ll check whether the configuration file of YUM is backed up

-rw-r--r--. 1 root root 1991 Aug 3 2015 CentOS-Base.repo

-rw-r--r--. 1 root root 1991 Mar 26 10:59 CentOS-Base.repo.bak

1.2.5 overwriting content to the CentOS-Base.repo file

[root@localhost ~] # cat > / etc/yum.repos.d/CentOS-Base.repo perform transaction check-- > Package zsh.x86_64 0VOR 4.3.11-4.el6.centoswill be installation-- > complete dependency calculation dependency resolution = package architecture version repository Size = installation: zsh x86 transactions 64 4.3.11-4.el6.centos oldboy 2.2m transaction summary = Install 1 Package (s) total downloads: 2.2MInstalled size: 5.0m download package: zsh-4.3.11-4.el6. Centos.x86_64.rpm | 2.2 MB 00:00 run rpm_check_debug to execute transaction test transaction test successfully executed transaction Warning: RPMDB altered outside of yum. In the process of installation: zsh-4.3.11-4.el6.centos.x86_64 1 Verifying: zsh-4.3.11-4.el6.centos.x86_64 1 has been installed: Zsh.x86_640:4.3.11-4.el6.centos

Over!

2.3 permanently modify the yum source

The above is the source of temporarily using private network yum. If you want to use the yum-y install lrzsz command permanently and simply, you need to modify the configuration.

File closes the default repo file.

[root@oldboy ~] # cd / etc/yum.repos.d/

[root@oldboy yum.repos.d] # vimCentOS-Base.repo

# add to each startup source

# enabled=0 # is enabled if it is changed to 1, or if this parameter is not used.

[base]

.

Enabled=0

[updates]

.

Enabled=0

[extras]

.

Enabled=0

# other open warehouses are closed using this method.

Attachment: http://down.51cto.com/data/2367699

Tags: File configuration directory check cache repository optical drive transaction content name command folder software update success address backup plug-in original native Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Huawei Xiaomi Shulou Tech Info macOS