Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux configure local YUM source

Shulou Source: shulou.com Published: 2022-06-02 05:04:16 10月02日 Update

Most of the database servers in the production environment run on the intranet and will definitely not be connected to the public network, which is more dangerous, has great security risks, and does not rule out the possibility of being hacked.

The default linux is to make use of the yum resources of the network, so when there is no external network. We want to build a local yum source yum advantages, you can automatically analyze the dependency system, before the rpm command installation, if you encounter a dependency, install this to show.

1 Mount the CD to the directory can be viewed by the command mount, generally, it will be mounted automatically by default. If there is no automatic mount, the manual mount method looks at the cdrom command ll / dev | grep cdrom

Mount / dev/scd0 / media

2 copy the software package in the system disk to this system

Cp-r / mnt/Server/* / var/ftp/pub

Copy all the software packages in the CD to the / var/ftp/pub directory can be customized, but you can build a ftp server in the future, and the directory accessed by anonymous ftp users is in this place, so you can let others use the yum source you built through ftp.

3 generate dependency relationship createrepo-g / var/ftp/pub/repodata/comps-rhel5-server-core.xml / var/ftp/pub/ this step is mainly to use createrepo to save the dependency file generated by the software package in this directory in the repodata/comps-rhel5-server-core.xml file, when the package will first open this file to analyze the dependency. Comps-rhel5-server-core.xml is available on the default installation CD.

4 create a new warehouse file

Cd / etc/yum.repos.d (create a new warehouse file, must end with .repo) vi yum.repo [base] name=base / / the warehouse name can be customized baseurl= file:///var/ftp/pub / / this is the local yum source address

Enabled=1 / / whether to enable the source

Enter the command yum list to see the package.

Tags: Files commands situations directories repositories CDs systems software software packages dependencies servers analysis services generation great dangerous security advantages however can be obtained through the Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Microsoft NVidia Shulou Technology Apple