CentOS uses CD as local Yum source

Source: Internet
Author: User
Tags gpg

[Email protected] centos]# Mkdir/media/centos
Load CD to Local
[Email protected] centos]# Mount/dev/cdrom/media/centos

In the/etc/yum.repos.d/directory, there are two files
Centos-base.repo records the address and path information of the Yum source on the network, etc.
Centos-media.repo Records media and paths that can be used locally as a Yum source. There is one such note:
Modify the Centos-media.repo as follows:
# Centos-media.repo
#
# This repo was used to mount the default locations for a CDROM/DVD on
# CentOS-5. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put on your DVD and use it with the other repos too:
# yum--enablerepo=c5-media [command]
#
# or for the media repo, does this:
#
# yum--disablerepo=\*--enablerepo=c5-media [command]

[C5-media]
name=centos-$releasever-media
Baseurl=file:///media/centos
Gpgcheck=1
Enabled=0
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-beta

We just need to edit the next Bashurl and write our own disc path.
Feel that the source of your disc is enough. No network source is required, or there is no network.
You can use Yum--disablerepo=\*--enablerepo=c5-media [command]

The Yum command allows the source of local media media to be used. The correct command is as follows (update GCC as an example):
Could not retrieve Mirrorlist

[email protected] cdrom]# Yum--disablerepo =*--enablerepo=c5-media install gcc
Loading "Installonlyn" plugin
Setting up Update Process
Setting up repositories
C5-media 100% |=========================| 1.1 KB 00:00
Reading repository metadata in from local files
Primary.xml.gz 100% |=========================| 834 KB 00:00
################################################## 2400/2400
No Packages marked for update/obsoletion

Like installing GDB.
[email protected] cdrom]# Yum--disablerepo =*--enablerepo=c5-media install GDB
Loading "Installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing Package Install arguments
Resolving Dependencies
--Populating transaction set with selected packages. Please wait.
---> Downloading header for GDB to pack into transaction set.
gdb-6.5-25. el5.i386.rpm 100 |=========================| KB 00:00
---> Package gdb.i386 0:6.5-25. El5 set to be updated
--Running Transaction check

Dependencies resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
GDB i386 6.5-25. El5 C5-media 3.1 M

Transaction Summary
=============================================================================
Install 1 package (s)
Update 0 Package (s)
Remove 0 Package (s)

Total Download size:3.1 M
Is this OK [y/n]: Y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing:gdb ######################### [1/1]

Installed:gdb.i386 0:6.5-25. El5
Complete!
[email protected] cdrom]# Yum--disablerepo =*--enablerepo=c5-media install Kernel-header glibc-headers glibc-devel Lib gcmp GCC gcc-c++

The following error often occurs when using Yum for install
Warning:rpmts_HdrFromFdno:Header V3 DSA Signature:nokey, key ID 1ac70ce6
Causes the installation to fail. Here's how to fix it:
[Email protected] centos]# rpm--import/etc/pki/rpm-gpg/rpm-gpg-key-centos-5
[Email protected] centos]# rpm--import/etc/pki/rpm-gpg/rpm-gpg-key-beta

[Email protected] ~]# yum-y--disablerepo =*--enablerepo=c5-media install kernel-header glibc-headers gcc gcc-c++ autoc Onf Automake
[Email protected] ~]# cd/usr/src/
[Email protected] src]# tar zxvf mysql-5.1.56.tar.gz
[Email protected] src]# CD mysql-5.1.56

Http://blog.chinaunix.net/uid-26167002-id-2182637.html

CentOS uses CD as local Yum 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.