Super simple configuration of yum Source

Source: Internet
Author: User

1. Attach the CD first.

Run the "mount-o loop/dev/sr0/mnt/cdrom" command ". If the command "mount-o loop/dev/cdrom/mnt/cdrom" is used, errors may occur sometimes, the reason is that/dev/cdrom is a soft link file of/dev/sr0. If this setting is not performed, you will be asked to check the file system. /Create a new cdrom directory under mnt.

2. Set the configuration definition file of the yum source. The file must be stored in the/etc/yum. repos. d directory and end with ". repo. This document uses dvd. repo as an example to edit the configuration definition file:

[Dvd] ---------------> required. The content in brackets can be written as needed, but must contain brackets.
Name = yum server -----------> it can be written or not, and the content is casual. It mainly serves as a prompt.
Baseurl = file: // mnt/cdrom ---------------> be sure to write, define the repository of the yum Source
Enabled = 1 ---------------------> the number 1 indicates that the current yum source is enabled, and 0 indicates that the yum source is disabled. The default value is 1.
Gpgcheck = 0 -----------------------> whether to check the digital signature of the rpm package. The value 1 indicates the check, and the value 0 indicates the check. You can leave the check empty.

The procedure is as follows:

1. Create/mnt/cdrom Directory: mkdir/mnt/cdrom

2. mount the CD: "mount-o loop/dev/sr0/mnt/cdrom", and then enter the mount directory to view the content of the CD. The-o loop parameter is attached to a special device.

3. Create the yum source configuration file vim/etc/yum. repos. d/dvd. repo. Then enter the content. Note: The baseurl is followed by the directory where the disk is attached. Of course, you can also use other yum sources, such as ftp and http.

[Dvd]
Name = yum server
Baseurl = file: // mnt/cdrom
Enabled = 1
Gpgcheck = 0

4. install the software for testing. "yum-y install mysql". After successful installation, "Complete!" will appear at the end !".

Yum troubleshooting

1. Check whether the disc is mounted successfully.

2. Check whether the yum source definition file is incorrect. This file is strictly required. Any word or letter error may cause yum problems.

3. check whether there are other yum source definition files. Some default yum sources may exist in the system. It is best to disable or delete these yum sources.

4. Run the "yum clear all" command to clear the cache.

5. Can the software packages in the yum source be correctly listed by running the command "yum list.

6. If NOKEY occurs, import the key.

Rpm -- import/etc/pki/rpm-gpg/R [Tab key]-release

7. If you reinstall another software package after installing the software package for the first time, you may find an error. The error message is as follows:

Error: Cannot retrieve repository metadata (repomd. xml) for repository: InstallMedia. Please verify its path and try again

Solution: After reading and modifying the software warehouse for the first time, rhel6 will copy the original root directory of the CD, that is, the media that you copied to the software warehouse directory together. copy the repo to/etc/yum. repos. d/, and the file is also the culprit that causes local yum source failure.

Step 1: Uninstall a software: yum remove PackageKit.

Step 2: Go to the/etc/yum. repos. d/directory and delete the configuration file copied by the system.

I am using the system RHEL6.0, so the file to be deleted is the packagekit-media.repo. Keep your own configuration file dvd. repo.

Recommended reading:

Configure the epel yum Source

RedHat local yum source configuration

RedHat Linux local yum source configuration

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

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.