linux yum 用本地光碟片做源安裝perl

來源:互聯網
上載者:User

標籤:光碟片鏡像   linux   verify   作業系統   media   

參考:http://hi.baidu.com/pengduo66/item/abfe454f81cdb7e5a4c06675

情境說明:選擇迷你安裝linux作業系統,沒有安裝perl工具。由於網路的故障問題,無法使用yum install perl 從網上安裝perl,目前只有原版的安裝光碟片。於是嘗試使用本地的光碟片作為安裝源。

步驟1:建立光碟片掛載點

    mkdir /iso

步驟2:掛載光碟片鏡像

    mount -o loop /CentOS-6.5-x86_64-bin-DVD1.iso /iso

步驟3:設定/etc/yum.repos.d/CentOS-Media.repo,基本原理指定光碟片的掛載點

# CentOS-Media.repo

#說明,這個源能夠使用掛載的DVD源,指定一個掛載點。可以使用這個源,利用yum

#直接從光碟片鏡像中安裝軟體

#  This repo can be used with mounted DVD media, verify the mount point for

#  CentOS-6.  You can use this repo and yum to install items directly off the

#  DVD ISO that we release.

#說明:為了使用這個源,必須接上DVD,同時使用如下的指令:

#yum --enablerepo=c6-media  install  XXXX

# To use this repo, put in your DVD and use it with the other repos too:

#  yum --enablerepo=c6-media [command]

#說明:如果你只想或者只能夠使用媒體安裝源,必須使用如下的命令:

#yum --disablerepo=\* --enablerepo=c6-media install perl

# or for ONLY the media repo, do this:

#

#  yum --disablerepo=\* --enablerepo=c6-media [command]


[c6-media]

name=CentOS-$releasever - Media

###################修改的語句#######################

baseurl=file:///iso/

###########指定光碟片的掛載點#########################

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

儲存退出。

步驟4:yum --disablerepo=\* --enablerepo=c6-media install perl

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

c6-media                                                 | 4.0 kB     00:00 ... 

c6-media/primary_db                                      | 4.4 MB     00:00 ... 

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package perl.x86_64 4:5.10.1-136.el6 will be installed

--> Processing Dependency: perl-libs = 4:5.10.1-136.el6 for package: 4:perl-5.10.1-136.el6.x86_64

--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-136.el6.x86_64

--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-136.el6.x86_64

--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-136.el6.x86_64

--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-136.el6.x86_64

--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-136.el6.x86_64

--> Running transaction check

---> Package perl-Module-Pluggable.x86_64 1:3.90-136.el6 will be installed

---> Package perl-Pod-Simple.x86_64 1:3.13-136.el6 will be installed

--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-136.el6.x86_64

---> Package perl-libs.x86_64 4:5.10.1-136.el6 will be installed

---> Package perl-version.x86_64 3:0.77-136.el6 will be installed

--> Running transaction check

---> Package perl-Pod-Escapes.x86_64 1:1.04-136.el6 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


================================================================================

 Package                   Arch       Version                Repository    Size

================================================================================

Installing:

 perl                      x86_64     4:5.10.1-136.el6       c6-media      10 M

Installing for dependencies:

 perl-Module-Pluggable     x86_64     1:3.90-136.el6         c6-media      40 k

 perl-Pod-Escapes          x86_64     1:1.04-136.el6         c6-media      32 k

 perl-Pod-Simple           x86_64     1:3.13-136.el6         c6-media     212 k

 perl-libs                 x86_64     4:5.10.1-136.el6       c6-media     578 k

 perl-version              x86_64     3:0.77-136.el6         c6-media      51 k


Transaction Summary

================================================================================

Install       6 Package(s)


Total download size: 11 M

Installed size: 36 M

Is this ok [y/N]: y

Downloading Packages:

--------------------------------------------------------------------------------

Total                                            20 MB/s |  11 MB     00:00     

warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Importing GPG key 0xC105B9DE:

 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>

 Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)

 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

  Installing : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                       1/6 

  Installing : 4:perl-libs-5.10.1-136.el6.x86_64                            2/6 

  Installing : 1:perl-Pod-Simple-3.13-136.el6.x86_64                        3/6 

  Installing : 3:perl-version-0.77-136.el6.x86_64                           4/6 

  Installing : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                  5/6 

  Installing : 4:perl-5.10.1-136.el6.x86_64                                 6/6 

  Verifying  : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                  1/6 

  Verifying  : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                       2/6 

  Verifying  : 4:perl-5.10.1-136.el6.x86_64                                 3/6 

  Verifying  : 4:perl-libs-5.10.1-136.el6.x86_64                            4/6 

  Verifying  : 1:perl-Pod-Simple-3.13-136.el6.x86_64                        5/6 

  Verifying  : 3:perl-version-0.77-136.el6.x86_64                           6/6 


Installed:

  perl.x86_64 4:5.10.1-136.el6                                                  


Dependency Installed:

  perl-Module-Pluggable.x86_64 1:3.90-136.el6                                   

  perl-Pod-Escapes.x86_64 1:1.04-136.el6                                        

  perl-Pod-Simple.x86_64 1:3.13-136.el6                                         

  perl-libs.x86_64 4:5.10.1-136.el6                                             

  perl-version.x86_64 3:0.77-136.el6                                            


Complete!

步驟5:詳細說明和參考文檔的不同

參考文檔使用的是:c5-media  而我們使用的是c6-media,因為使用centos6.4版本。

在使用yum進行install時,經常會出現下面的錯誤 
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 1ac70ce6 
導致安裝不能進行。解決方案如下: 
[[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


相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.