In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how CentOS7 manually created their own YUM warehouse, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
I. brief introduction
There are three ways to install software on the linux system. First, the source code form, the vast majority of open source software are directly released in the form of source code, generally packaged into tar.gz archive compressed files, this form of source code programs need to be compiled into binary form before they can be run and used, although this form is compatible and controllable, it is troublesome to use, and there are a large number of dependencies that need to be solved. Second, RPM installation package, RPM by compiling the source code based on a specific platform system into executable files, and saving dependencies, simplifies the installation of open source software, but still needs to solve the dependencies manually; third, YUM software management, the main purpose of YUM design is to automatically solve RPM dependencies, you can group RPM, introduce the concept of repo and support multiple warehouses, configuration is relatively simple.
YUM uses the repository to save and manage the RPM software package. The configuration file of the repository is saved in the / etc/yum.repos.d/ directory. The configuration file included with CentOS is as follows:
[root@localhost ~] # cd / etc/yum.repos.d/
[root@localhost yum.repos.d] # ll
Total 24
-rw-r--r--. 1 root root 1664 Mar 31 15:27 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Mar 31 15:27 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Mar 31 15:27 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 290 Mar 31 15:27 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 1331 Mar 31 15:27 CentOS-Sources.repo
-rw-r--r--. 1 root root 1002 Mar 31 15:27 CentOS-Vault.repo
Delete these files, rm-rf CentOS* or remove the folder mv CentOS* / yum.
Second, manually configure the YUM warehouse
1. Copy all the rpm packages to a folder. Here we use the rpm package that comes with CentOS 7, which can be used when the VMware physical machine cannot be connected to the Internet. Mount the CentOS7 installation image under CentOS. The default path of the file is under / run/media/centostest/, CentOS6 is saved under / media/, where centostest is your user name, and the rpm software package is saved in the image file Packages folder.
Create a folder and copy it, the copy time will be longer, the virtual CD will be faster.
[root@localhost ~] # cd /
[root@localhost /] # mkdir yum-packages
[root@localhost /] # cp-rv / run/media/centostest/CentOS\ 7\ x8631 * / yum-packages/
2. Install the createrepo software through the rpm command, and the createrepo package is included in the previously copied rpm file.
Install createrepo software, the software name can be automatically completed by Tab key.
[root@localhost /] # cd yum-packages/
[root@localhost yum-packages] # rpm-ivh createrepo-0.9.9-23.el7.noarch.rpm
Warning: createrepo-0.9.9-23.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... # # [100%]
Package createrepo-0.9.9-23.el7.noarch is already installed
3. Run the createrepo command to build the index
Createrepo / yum-packages/
After completion, a repodata folder will be created under the yum-packages folder, in which the index information will be stored.
4. Add a profile
Add a configuration file under the / etc/yum.repos.d/ folder.
[root@localhost yum-packages] # cd / etc/yum.repos.d/
[root@localhost yum.repos.d] # vim ownyum.repo
[root@localhost yum.repos.d] # cat ownyum.repo
[centos]
Name = centos yum
Baseurl = file:///yum-packages/
[root@localhost yum.repos.d] #
The simplest configuration has been made here. You can choose any name for [centos] and name, and enabled and gpgcheck can be configured or not.
5. Clear YUM Cache
Clear with the yum clean all command and view the yum library with the yum list command
[root@localhost yum.repos.d] # yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: centos
Cleaning up everything
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d] # yum list
You can see the information of the yum warehouse built by yourself.
Xorg-x11-xbitmaps.noarch 1.1.1-6.el7 centos
Xpp3.noarch 1.1.3.8-11.el7 centos
Xrestop.x86_64 0.4-14.el7 centos
Xsane-common.x86_64 0.999-9.el7 centos
Xsane-gimp.x86_64 0.999-9.el7 centos
Xsettings-kde.x86_64 0.12.3-7.el7 centos
Xsom.noarch 0-10.20110809svn.el7 centos
Xterm.x86_64 295-3.el7 centos
Xulrunner.x86_64 31.4.0-1.el7.centos centos
Xz-devel.x86_64 5.1.2-9alpha.el7 centos
Yp-tools.x86_64 2.14-3.el7 centos
Ypbind.x86_64 3VR 1.37.1-7.el7 centos
Ypserv.x86_64 2.31-8.el7 centos
Yum-plugin-aliases.noarch 1.1.31-29.el7 centos
Yum-plugin-changelog.noarch 1.1.31-29.el7 centos
Yum-plugin-tmprepo.noarch 1.1.31-29.el7 centos
Yum-plugin-verify.noarch 1.1.31-29.el7 centos
Yum-plugin-versionlock.noarch 1.1.31-29.el7 centos
Zlib-devel.x86_64 1.2.7-13.el7 centos
Zsh.x86_64 5.0.2-7.el7 centos
Zziplib.x86_64 0.13.62-5.el7 centos
The centos here is the name in [centos].
The above is all the contents of the article "how CentOS7 creates its own YUM repository by hand". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.