[Recommended] configure the yum server in RedHat 5 [use a DVD disk as the yum source]

Source: Internet
Author: User
N has not been written for a long time. His life lies in sports. His blog lies in updates. Let's update it.

The platform is still in RedHat 5. The preparation is very simple. You only need a DVD.

Of course, the old saying is:VmwarevmNot a physical machine, but mostly the same, not exactly!

What is the yum server used? Simply put, it is used to install software. Isn't there a saying that using a computer is equivalent to using software? Although I don't know if this sentence is correct, at least I have no reason to refute it... After all, operations are also a kind of software ..

PreviousArticleAs mentioned, installing software in Linux is not as simple as in windows. It can be roughly divided into three types: source code package, self-compiling, and RPM installation, you only need one command. You need several source code packages. The last installation method is yum.

Software Installation in Linux is related. For example, if the prerequisite for installing software A is that software B must be installed first, only software B can be installed, the prerequisite for installing software B is that software C must be installed first... And so on, this often happens: A lot of software is installed to install a software .. In addition, this relationship is complex, and manual clarification takes a lot of time.

The yum server can solve this problem well. It has already set the prerequisites for various software. For example, if we want to install the above software a, just enter"Yum install", Followed by B, c... When a lot of software is installed automatically, it saves a lot of trouble and time.

I will introduce the simplest method here. However, although this method is simple, it is not applicable in many cases, you can only test this method before using other methods. If you can, you can do it in 2 minutes. If not, continue with other methods, however, it takes a long time ~~

Step 1: firstAttach a cd, AndAttach a cdTo a directory. For example, I use/cdyum.

I will not talk about the CD loading step. I have already introduced it and set it in the Virtual Machine Software. Next I will talk about mounting: The command used is"Mount", I don't know much about this command (I don't know what to say, but I will use it ),It can be used to view system mounting information and perform mounting operations..

Let's take a look at the mounting status:

[Root @ localhost ~] # Mount
/Dev/sda1 on/type ext3 (RW)
Proc on/proc type proc (RW)
Sysfs on/sys type sysfs (RW)
Devpts on/dev/PTS type devpts (RW, gid = 5, mode = 620)
Tmpfs on/dev/SHM type tmpfs (RW)
None on/proc/sys/fs/binfmt_misc type binfmt_misc (RW)
None on/proc/fs/vmblock/mountpoint type vmblock (RW)
SunRPC on/var/lib/nfs/rpc_pipefs type rpc_pipefs (RW)
/Dev/HDC on/Media/rhel_5.4 i386 DVD type iso9660 (RO, noexec, nosuid, nodev, uid = 0) This is the disk mount point.

If you know the mount information, we can mount it, although the default mount point is also acceptable, .. This name is really too long. Let's change it to a better name.

[root @ localhost ~] # Mkdir/cdyum = create a folder for mounting
[root @ localhost ~] # Mount/dev/HDC/cdyum/= To the created folder
mount: block device/dev/HDC is write-protected, mounting read-only
[root @ localhost ~] # Mount = view mounting information
/dev/sda1 on/type ext3 (RW)
proc on/proc type proc (RW)
sysfs on/sys type sysfs (RW)
devpts on/dev/PTS type devpts (RW, gid = 5, mode = 620)
tmpfs on/dev/SHM type tmpfs (RW)
none on/proc/sys/fs/binfmt_misc type binfmt_misc (RW)
none on/proc/fs/vmblock/mountpoint type vmblock (RW)
SunRPC on/var/lib/nfs/rpc_pipefs type rpc_pipefs (RW)
/dev/HDC on/Media/rhel_5.4 i386 DVD type iso9660 (RO, noexec, nosuid, nodev, uid = 0)
/dev/HDC on/cdyum type iso9660 (RO) = "this is the directory we manually Mount

After mounting, modify the configuration file of the yum server. The file is "/etc/yum. repos. d/rhel-debuginfo.repo "in order to prevent various problems after correction, we back up the source file below before modification, once an error occurs, we can also overwrite the restoration.

[Root @ localhost ~] # Cp-A/etc/yum. Repos. d/rhel-debuginfo.repo/etc/yum. Repos. d/rhel-debuginfo.repo.bak

The original settings are as follows:

[RHEL-debuginfo]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Debug
Baseurl = Signature/
Enabled = 0
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release

Let's modify it here

Name = Red Hat Enterprise Linux $ releasever-$ basearch-Debug
Baseurl = file: // cdyum/
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release

Okay, you can use it after modification. Let's try the following. Here we take the BIND software necessary to place the DNS server as an example: Check whether there is any information about this software:

loaded plugins: rhnplugin, security
available packages
name: bind
arch: i386
epoch: 30
Version: 9.3.6
release: 4. p1.el5
size: 978 k
repo: RHEL-debuginfo
Summary: Berkeley Internet domain name (BIND) DNS (Domain Name System) server.
URL: http://www.isc.org/products/BIND/
license: BSD-like
Description: BIND (Berkeley Internet domain name) is an implementation of DNS (Domain Name System) protocol.
: bind includes a DNS server (named) that resolves the host name to an IP address.
: a parser Library (which applies the routines used by the Program when communicating with DNS), and checks
: A tool used to check whether the DNS server is correctly operated.

Yes. Now, we can install it ~~

[Root @ localhost ~] # Yum install bind
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up install process
Resolving Dependencies
-> Running transaction check
-> Package bind. i386 30: 9.3.6-4. p1.el5 set to be updated
-> Finished dependency resolution

Dependencies resolved

================================ ========================================================== ========< br> package arch version repository size
================ ========================================================== =============================< br> installing:
bind i386 30: 9.3.6-4. p1.el5 fig 978 k

transaction summary
======================= ========================================================== =============< br> install 1 package (s)
Update 0 package (s)
remove 0 package (s)

Total download size: 978 K
Is this OK [Y/n]: Y
Downloading packages:
Running rpm_check_debug
Running transaction Test
Finished transaction Test
Transaction test succeeded
Running transaction
Installing: bind 1/1

Installed:
Bind. i386 30: 9.3.6-4. p1.el5

Complete!
[Root @ localhost ~] #

Okay, you can install it. It indicates that the yum server is running normally. Of course, if the two computers are interconnected, you only need to configure one, and you only need to modify the configuration file. As I mentioned earlier, this is the simplest method, which is not applicable in many cases. I feel that it is only applicable to the DVD version, if it is a VCD version .. You cannot specify the file directory either .... So we have to use other methods. I will write other methods later, because there are several methods .. I have to sort out my ideas... Note,

1. If installation fails when the local ground source is used, check whether the DVD disk has been loaded (view the mount command) and reload it once if it is not loaded...

After the computer is shut down or restarted, the corresponding mounting information will be lost, and you have to mount it again when using it ).
2. After changing the yum source, you have to clear the yum configuration cache (Yum clean all), Otherwise, you will still find something in the path of the old configuration.

 

[Root @ localhost ~] # Y Um clean all
Loaded plugins: fastestmirror
Cleaning up everything
Cleaning up list of fastest mirrors

 

From: http://www.wangchong.me/configuring-yum-server-redhat-5/ attachment: [Baidu know] how to mount a CD Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.