Test whether the system image CD can be used as a YUM repository in Linux.

Source: Internet
Author: User
Tags yum repolist

Tutorial Background:

There are two prerequisites for installing the packages using the yum tool:

1. There is a valid yum configuration file (the file ending with. repo in the/etc/yum. repos. d directory)

2. specify a valid yum repository in the yum configuration file ).

For systems of the Red Hat series, the original CD itself is a valid yum repository, which is mounted to/media/cdrom and then enabled. You can use it.

Purpose:

Test whether the system image CD can be used as the yum Repository

Lab environment:

VmwareWorkstation 9, CentOS 6.4

Tutorial steps:

1. Mount System Images in virtual machines

2. Attach the disc to the/media/cdrom directory.

Check the CD directory. If the repodata directory already exists, the directory is already a valid yum database. If one of the preceding conditions is met, check whether a valid yum configuration file exists and direct it to the yum repository.

3. Modify the repo configuration file

/Etc/yum. repos. by default, a file CentOS-Media.repo exists under the d directory, which is the yum configuration file corresponding to the disc yum repository, view this file, one of which is baseurl = file: // media/cdrom /, this is why you need to attach the disc to the/media/cdrom directory. Enabled = 0, that is, the yum repository of the optical disk is not enabled by default. Modify the value to 1, that is, enable the yum repository.

4. Now, the two prerequisites for the yum tool are met.

Test whether it can be used:

Using the yum repolist command, you can see that the yum repository of the displayed CD is saved as a c6-media.

However, if you use the yum list all command to query all the software packages in the yum repository, the command fails to be executed. The returned information shows that the command is terminated due to a network fault when you look for the yum repository base. Because the operating system in this experiment environment is indeed not connected to the network. But the object of the experiment is CD as the yum warehouse c6-media, does not involve network connection, how to solve it?

Idea 1: the configuration file CentOS-Base.repo exists by default, with the yum repository base, extras, and updates enabled. If these yum repositories are disabled, there is only one available yum repository c6-media in the system to complete the test.

Method a: modify the configuration file name to make it invalid.

Method B: temporarily disable all yum repositories and only enable c6-media to execute the yum command

Idea 2: Because the command yum list all queries all the yum repositories that are enabled in the current system, if you specify to only query from the yum repository c6-media, you can complete the experiment. How can I query the specified yum repository?

Idea 3: Because the command yum list all queries all the yum repositories enabled in the current system, the system first searches from the base by default. If the search fails, the command is automatically terminated, how can I continue searching for other yum repositories after it fails? Or is the specified yum repository preferred?

Failed to modify cost value. (Test whether the install package can be modified after cost is modified. It is invalid)

Lab issues:

1. Q: To enable the yum repository, modify enabled = 1 in the configuration file. If yes, run the following command?

A: yum -- enablerepo = repoid COMMAND

This command only enables the yum repository at one time and runs the following command. The enabled value in the configuration file is not modified.

2. Q: When multiple available yum repositories exist, how does the yum command specify the yum repository operations, such as yumlist and install?

A: # yum -- disablerepo = * -- enablerepo = c6-media COMMAND this COMMAND can be implemented.

Is there any other method?

3. Q: How do I select the yum list command mechanism when multiple repositories exist? (Yum install is selected by cost value, but in this experiment, the url in the base repository is invalid and cannot bypass the base even if the cost value for the c6-media is modified to the lowest)

Recommended reading:

RedHat Linux local yum source configuration

RedHat 6.2 modify yum source in Linux use CentOS source for free

Configure the epel yum Source

Redhat local yum source configuration

Description of yum configuration file

Install yum in RedHat 6.1)

YUM installation and cleaning

Related Article

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.