Steps to create your own YUM repository

Steps to create your own YUM repository

To put it simply, the IP of the virtual machine used as a warehouse is 192.168.149.129. I plan to use the software in the /usr/local/src directory as a YUM source. First, make sure the http service is normal.

1. I use Apache, and the default root directory is /var/www/html, so I made a soft link in this directory:

[root@bogon html]# ln -s /usr/local/src .
[root@bogon html]#ll
total 3
lrwxrwxrwx 1 root root 14 Nov 2 11:13 src -> /usr/local/src

2. Use the createrepo command to format the repository:

[root@bogon src]# createrepo .
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete
[root@bogon src]# ls
repodata
[root@bogon src]# cd repodata/
[root@bogon repodata]# ls
01a3b489a465bcac22a43492163df43451dc6ce47d27f66de289756b91635523-filelists.sqlite.bz2 6bf9672d0862e8ef8b8ff05a2fd0208a922b1f5978e6589d87944c88259cb670-other.xml.gz repomd.xml
401dc19bda88c82c403423fb835844d64345f7e95f5b9835888189c03834cc93-filelists.xml.gz 7c36572015e075add2b38b900837bcdbb8a504130ddff49b2351a7fc0affa3d4-other.sqlite.bz2
5dc1e6e73c84803f059bb3065e684e56adfc289a7e398946574d79dac6643945-primary.sqlite.bz2 dabe2ce5481d23de1f4f52bdcfee0f9af98316c9e0de2ce8123adeefa0dd08b9-primary.xml.gz

3. Put the rpm package in the src directory and update it. You should be able to see the package on the client:

[root@bogon src]# createrepo --update .
Spawning worker 0 with 1 pkgs
Spawning worker 1 with 0 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

4. Verify and create a file ending with .repo under /etc/yum.repos.d on the client:

[root@localhost yum.repos.d]# cat test.repo 
[TestYum]
name=TestYum
baseurl=http://192.168.149.129/src
gpgcheck=0
enabled=1

5. Run yum clean all && yum repolist. Well, there is indeed 1 package. Done.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • How to recover accidentally deleted messages files in Linux
  • In-depth analysis of the Linux kernel macro container_of
  • Linux loading vmlinux debugging
  • How to build svn server in linux
  • View the number of files in each subfolder of a specified folder in Linux
  • Detailed explanation of redis persistence, master-slave synchronization and sentinel under Linux
  • Detailed explanation of the use and differences of various lock mechanisms in Linux
  • Numerical calculation of shell variables in Linux
  • Overview of time configuration under Linux system
  • Basic usage tutorial of IPTABLES firewall in LINUX

<<:  How to migrate sqlite to mysql script

>>:  MySQL database green version installation tutorial to solve system error 1067

Recommend

How to use SessionStorage and LocalStorage in Javascript

Table of contents Preface Introduction to Session...

Automatically install the Linux system based on cobbler

1. Install components yum install epel-rpm-macros...

Linux uses shell scripts to regularly delete historical log files

1. Tools directory file structure [root@www tools...

Example code for element multiple tables to achieve synchronous scrolling

Element UI implements multiple tables scrolling a...

MYSQL A question about using character functions to filter data

Problem description: structure: test has two fiel...

XHTML: Frame structure tag

Frame structure tag <frameset></frameset...

Element Table table component multi-field (multi-column) sorting method

Table of contents need: Problems encountered: sol...

MySQL query_cache_type parameter and usage details

The purpose of setting up MySQL query cache is: C...

Summary of essential Docker commands for developers

Table of contents Introduction to Docker Docker e...

Comparison of mydumper and mysqldump in mysql

If you only want to back up a few tables or a sin...

Docker installs the official Redis image and enables password authentication

Reference: Docker official redis documentation 1....

CSS and JS to achieve romantic meteor shower animation

1. Rendering 2. Source code HTML < body > &...

Add a copy code button code to the website code block pre tag

Referring to other more professional blog systems...

Implementation of multi-site configuration of Nginx on Mac M1

Note: nginx installed via brew Website root direc...

How to install and configure Redis in CentOS7

Introduction There is no need to introduce Redis ...