Use the installation CD of CentOS to create a local yum source to complete the RPM Package [summary]

Source: Internet
Author: User
CentOS uses the installation CD to create a local yum source to install the RPM Package [summary] in the CentOS or RHEL system environment, RPM dependency is a headache. After each system installation is complete, I want to install another software package. before I press enter, I am scared to jump out of a dependency error... use the installation CD of CentOS to create a local yum source to complete the RPM Package [summary]

In CentOS or RHEL systems, RPM dependency is a headache. After each system installation is complete, I want to install another software package. before I press the Enter key, I am scared to jump out of a dependency error. Behind a dependency error, more dependencies may be involved. This problem is daunting for many Linux users.
The dependency of the RPM Package is simple because the so-called dependency is just A simple one, such as "to install A, you need to prepare a1, a2, a3" in advance.

For example, when we install gcc. Find the installation disc, carefully mount it, and find the gcc-4.1.2-50.el5.i386.rpm to try to use
Rpm-ivh gcc-4.1.2-50.el5.i386.rpm
. The system tells us that glibc-devel and libgomp are missing. when you try to install glibc-devel, the system prompts that glibc-headers is missing. Continue and find the lack of kernel-headers. I was so worried that it would be nice if I had chosen to install it completely! At the same time, I also complained about how Linux is so difficult to use. how nice it would be if I had been running next in Windows! Finally, according to the dependency prompt, the gcc installation is completed recursively. I am glad to have completed this task. In fact, this installation task is not complex enough to scare us away.
I strongly recommend yum!

Yum's RPM package processing is a typical "space for time" process. By preprocessing all RPM packages in the source, indexes of all installation packages including files, dependencies, conflicts, and other information are generated, and stored in the/var/cache/yum directory in sqlite format.
Use a DVD to create a local yum source

Since yum has effectively solved the RPM package dependency problem, the speed problem should be solved. The access speed of the local optical drive is even faster than that of the 100 M Lan. in some recent releases, the repo information has been preset and stored in the directory named repodata. The installation disk is a ready-made yum source. In CentOS5, multiple repo are preset and placed in the/etc/yum. repos. d Directory;


First, attach the CD to the optical drive and attach the CD.
# Mount/dev/hdc/media/cdrom
Mount: block device/dev/hdc is write-protected, mounting read-only

CentOS 5.6 can be automatically mounted, so you do not need to create a cdrom folder to mount the DVD, you can directly use CentOS_5.6_Final
If an image is installed locally, it is mounted to the corresponding directory through loop.
# Mount-o loop CentOS-5.6-i386-bin-DVD.iso/media/cdrom
Then, edit the yum source configuration file and add a local yum source. Here is a CentOS 5.6 DVD installation disk. its repo corresponds to the dvd. repo

If it is a RHEL Server, the corresponding baseurl is
Baseurl = file: // media/cdrom/Server

Or create a new dvd. repo directly in the/etc/yum. repos. d Directory.
Open it with vi and write the following class content:
[Dvd]
Name = install CentOS DVD
Baseurl = file: // media/cdrom
Enable = 1
Gpgcheck = 0

After the local source configuration is complete, you can use yum to complete the RPM package. First, check the configured yum source.
Yum list

Then, install the software package through the well-known yum install. From the output information, we can see that yum will help us handle the dependency of the RPM package. At the same time, because the packages are all local, the download time is almost negligible.

Additional instructions: common commands
Run the rpm-q xxx command to check whether the xxx software is successfully installed.
Rpm-ivh xxx. rpm installs xxx software from the rpm Package of the local xxx software. the software dependency must be manually resolved.
Rpm-Uvh http: // yy/xxx. rpm online update xxx software
Yum install xxx automatically installs software from the software source (which can be the DVD source set up in this article. The software dependency system automatically resolves the issue.
Yum list view the software source used by the current system
Yum search xxx: check whether any software with xxx name exists in the software source
Yum list xxx: check whether any software with xxx name exists in the software source
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.