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 configure local Yum source for RedHat system

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

Share

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

This article mainly explains "how to configure local Yum source in RedHat system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to configure the local Yum source on the RedHat system.

YUM, short for Yellow dog Updater Modified, was originally developed by Terra Soft, the developer of the yellow dog distribution, written in python and then called yup (yellow dog updater). It was later improved by the Linux@Duke development team at Duke University. The purpose of yum is to automatically upgrade, install / remove rpm packages, collect information about rpm packages, check dependencies, and automatically prompt users for resolution. The key point of yum is to have a reliable repository, as the name implies, this is a software repository, it can be a http or ftp site, it can also be a local software pool, but it must contain the header of rpm. Header includes all kinds of information about rpm packages, including descriptions, functions, provided files, dependencies, etc. It is the collection and analysis of these header that automates the remaining tasks.

If you have experienced the pain of rpm installation, I am sure they will choose yum instead of rpm 100%. Yum is very convenient to use. If you want to use rpm, you must configure repository (software repository), because the yum online update of RHEL is free and cannot be used without registration. If you want to install some packages using yum, you need to configure a local YUM source. Here's how to configure it. Red Hat Enterprise Linux Server release 6.6 is used as the experimental scenario below. There may be slight differences between different versions of Linux.

One: Mount the local CD to the system

If the server is a virtual machine, you can enter the control platform through vSphere Client and specify the ISO image file of the operating system in "Edit Settings"-> "hardware"-> "CD/DVD Drive". If it is a physical machine, you need to enter the computer room to find the server and put the installation CD in the CD-ROM drive. This is relatively troublesome, so it is generally best to copy CD files to your local hard disk.

Method 1: the optical drive mounts the image

The code is as follows:

[root@getlnx06 ~] # mkdir / mnt/cdrom

[root@getlnx06] # mount-t iso9660 / dev/cdrom / mnt/cdrom

Mount: block device / dev/sr0 is write-protected, mounting read-only

[root@getlnx06 ~] #

Method 2: copy CD files

The file / tmp/rehl6.tar.gz is copied from the CD package and unzipped to the specified directory / mnt/cdrom.

The code is as follows:

[root@localhost ~] # mkdir / mnt/cdrom/

[root@localhost] tar zxvf / tmp/rehl6.tar.gz-C / mnt/cdrom/

Two: configure local YUM source

The code is as follows:

[root@localhost ~] # cd / etc/yum.repos.d/

[root@localhost yum.repos.d] # ls

Redhat.repo rhel-source.repo

[root@localhost yum.repos.d] touch rhel-media.repo

[root@localhost yum.repos.d] # vi rhel-media.repo

[media]

Name=Red Hat Enterprise Linux 6.6

Baseurl= file:///mnt/cdrom

Enabled=1

Gpgcheck=1

Gpgkey= file:///mnt/cdrom/RPM-GPG-KEY-redhat-release

Clear the original cache

The code is as follows:

[root@localhost ~] # yum clean all

Loaded plugins: product-id, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Cleaning repos: media

Cleaning up Everything

Get yum list

The code is as follows:

Manager to register.media | 4.1 kB 00:00. Media/group_gz | 211 kB 00:00. Media/filelists_db | 3.3MB 00:00... Media/primary_db | 3.1 MB 00:00. Media/other_db | 1.4 MB 00:00... Metadata Cache Created [root@localhost ~] #

Third: verify whether the yum configuration is successful

The code is as follows:

[root@localhost ~] # yum grouplist | grep Server

Network Infrastructure Server

Server Platform

Web Server

Backup Server

Directory Server

Identity Management Server

Network Storage Server

Print Server

Server Platform Development

At this point, I believe that everyone on the "RedHat system how to configure the local Yum source" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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