Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a remote yum warehouse commonly used by enterprises in CentOS 7 system, detailed teaching!

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Brief introduction:

Yum (Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora and RedHat as well as in CentOS. Based on RPM package management, RPM packages can be downloaded and installed automatically from designated servers, dependencies can be automatically dealt with, and all dependent software packages can be installed at one time without tedious downloading and installation.

Sometimes we have our own private RPM package in the enterprise, and we have to build a remote yum repository when we want to use it.

Actual operation:

1. First, mirror the CD to the server and see if the mount is successful.

Input: mount / dev/sr0 / mnt/ input: df-h

two。 Use the cd command to enter the "/ var/" directory, and then install a "vsftpd" service using the yum repository.

Input: cd / var/ input: yum install vsftpd-y

3. Go to the "/ var/ftp/" directory, create a new "centos7" directory, and copy all the files under the image mount directory "/ mnt/" to the "centos7" directory (slow tasks are recommended in the background). At the same time, set up a "other" directory, and use createrepo tools to create warehouse data files in the "other" directory.

Input: cd ftp/ input: mkdir centos7 input: cp-rf / mnt/* centos7 & input: mkdir other input: createrepo-g / mnt/repodata/repomd.xml other/

4. Enter the "centos7" directory and the "other" directory, respectively, and use the "ls" command to see if the files have been added successfully.

Input: cd centos7/ input: ls input: cd.. / other/ input: ls input: ls repodata/

5. Turn on the "vsftpd" service while turning off the firewall and security enhancements. The server has been configured.

Input: systemctl start vsftpd input: systemctl stop firewalld.service input: setenforce 0

6. Install the "ftp" service on the client side using the yum repository.

Enter: yum install ftp-y

7. Use the ftp command to connect to the server and check if it can be connected. You can see that you can connect.

Input: ftp 192.168.52.131 input: ls

8. Exit the ftp connection, go to the "/ etc/yum.repos.d/" directory, create a "bak" directory, and move all system yum configuration files to the "bak" directory.

Input: cd / etc/yum.repos.d/ input: mkdir bak input: mv CentOS* bak/

9. At this point, let's clean up the yum cache and then try to install the httpd service with the yum repository

Input: yum clean all input: yum install httpd-y

10. Create a new file "centos7.repo" with the vim editor and edit it.

Enter: vim centos7.repo add: [base] name=centos7.Packagesbaseurl= ftp://192.168.52.131/centos7enabled=1gpgcheck=1gpgkey=ftp://192.168.52.131/centos7/RPM-GPG-KEY-CentOS-7[other]name=other.Packagesbaseurl=ftp://192.168.52.131/otherenabled=1gpgcheck=0

11. Let's clean up the yum cache again, and then install the httpd service with the yum repository again, and the installation is successful.

Input: yum clean all input: yum install httpd-y

Related commands of yum warehouse 1.yum update command: update the software package and update the software and system kernel at the same time. 2.yum upgrade command: update only the software package. 3.yum groupupdate command: update package group 4.yum list command: view software list 5.yum info command: display installation package information 6.yum search command: find package 7.yum grouplist command: view package group list 8.yum groupinfo command: display installation package group information 9.yum install command: install package group command: install package group 11:yum remove command: uninstall package 12:yum clean all command: clean cache

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report