How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

Summary:

Yum (called the Yellow dog Updater, Modified) is a front end package manager Shell Fedora and RedHat and CentOS in. RPM-based package management, can automatically download from the specified server RPM package and installed, you can automatically handle dependencies, and install all packages depending on, again and again without the cumbersome download and installation.
And we sometimes have their own private enterprise among RPM package, when we want to have to use a self-built remote yum repository.

Actual operation:

1. First light in the CD image to the server and see if the mount is successful.

输入:mount /dev/sr0 /mnt/
输入:df -h

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

2. Go to "/ var /" directory using the cd command, then use the yum repository to install a "vsftpd" service.

输入:cd /var/
输入:yum install vsftpd -y

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

3. Copy all the files into the "/ var / ftp /" directory, create a "centos7" directory, the mirror mount directory "/ mnt /" under the "centos7" directory (task slower advise keeping the background). While establishing a "other" directory, and the establishment of warehouse data file in "other" directory with createrepo tool.

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

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

4. Display "centos7" directory and "other" directory with "ls" command to see if the file is added successfully.

输入:cd centos7/
输入:ls
输入:cd ../other/
输入:ls
输入:ls repodata/

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

5. Turn "vsftpd" service, and turn off the firewall and security enhancements. The client is configured.

输入:systemctl start vsftpd
输入:systemctl stop firewalld.service
输入:setenforce 0

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

6. In the warehouse server with yum install "ftp" service.

输入:yum install ftp -y

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

7. ftp command to connect with the server, to check whether the connection. I can see you can understand.

输入:ftp 192.168.52.131
输入:ls

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

8. Quit ftp connection, enter "/etc/yum.repos.d/" directory, create a "bak" directory, all the systems yum configuration file into "bak" directory.

输入:cd /etc/yum.repos.d/
输入:mkdir bak
输入:mv CentOS* bak/

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

9. At this time we clean up the yum cache, and then try to use yum install httpd service warehouse

输入:yum clean all
输入:yum install httpd -y

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

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

输入:vim centos7.repo
添加:
[base]
name=centos7.Packages
baseurl=ftp://192.168.52.131/centos7
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.52.131/centos7/RPM-GPG-KEY-CentOS-7

[other]
name=other.Packages
baseurl=ftp://192.168.52.131/other
enabled=1
gpgcheck=0

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!
How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

11. Once again, we clean up the cache yum, yum warehouse and then again install httpd service, the result of a successful installation.

输入:yum clean all
输入:yum install httpd -y

How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!
How to build a common enterprise remote yum repository in CentOS 7 system, detailed teaching!

Guess you like

Origin blog.51cto.com/14449541/2436949