`
desert3
  • 浏览: 2160635 次
  • 性别: Icon_minigender_1
  • 来自: 合肥
社区版块
存档分类
最新评论

Yum install man、Yum仓库(CentOS-Base.repo)、本地yum仓库

 
阅读更多
CentOS版本查看:
cat /etc/*release*
cat /etc/redhat-release
CentOS release 5.7 (Final)

由于使用的CentOS中不包含man程序,手动安装:
yum install man
根据系统提示操作后,报如下错误:
warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897
GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory: '/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5'

出错原因:
这是因为:指定的文件/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5在本地不存在导致的。

解决:
1,去官网http://mirror.centos.org/centos/下载相应文件,然后重新执行命令
cd /etc/pki/rpm-gpg;wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5;yum install man

默认的yum仓库文件/etc/yum.repos.d/CentOS-Base.repo:
在CentOS 5.5 里,默认的yum更新源是镜像列表来的,系统会根据你的速度及地区自动检测一个速度较快的更新源并使用此更新源,很多时候,所检测并用到的是163
也可以修改其它的或你认为快的源,只需要修改 /etc/yum.repos.d/CentOS-Base.repo 这个文件即可
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

CentOS-Base.repo.163
# CentOS-Base.repo  
#  
# The mirror system uses the connecting IP address of the client and the  
# update status of each mirror to pick mirrors that are updated to and  
# geographically close to the client. You should use this for CentOS updates  
# unless you are manually picking other mirrors.  
#  
# If the mirrorlist= does not work for you, as a fall back you can try the   
# remarked out baseurl= line instead.  
#  
#  
  
[base]  
name=CentOS-$releasever - Base  
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os  
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6  
   
#released updates   
[updates]  
name=CentOS-$releasever - Updates  
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates  
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6  
   
#additional packages that may be useful  
[extras]  
name=CentOS-$releasever - Extras  
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras  
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/  
gpgcheck=1  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6  
   
#additional packages that extend functionality of existing packages  
[centosplus]  
name=CentOS-$releasever - Plus  
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus  
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6  
   
#contrib - packages by Centos Users  
[contrib]  
name=CentOS-$releasever - Contrib  
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib  
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/  
gpgcheck=1  
enabled=0  
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


配置本地Yum仓库:
一、挂载本地光盘到系统:把Cent6.2安装光盘放入光驱,在终端命令行下操作
mkdir /mnt/cdrom   #新建挂载目录
mount /dev/cdrom  /mnt/cdrom #挂载光盘到/mnt/cdrom目录下
cd  /mnt/cdrom #进入挂载目录
ls   #查看挂载目录,光盘挂载成功
二、配置本地yum源
cd /etc/yum.repos.d/   #进入yum配置目录
vi  CentOS-Media.repo   #编辑配置文件,添加以下内容

[GuangPan]
name=CentOS-$releasever - Media #自定义名称
baseurl=file:///mnt/cdrom/ #本地光盘挂载路径
gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查
enabled=1 #启用yum源,0为不启用,1为启用

三、清除yum缓存,使用yum install自动安装软件
yum clean all   #清除yum缓存
yum install php   #安装php
如果仍然使用的是网络上的repo,那么把/etc/yum.rpos. d/目录下的CentOS-Base.repo  CentOS-Debuginfo.repo文件进行改名,这样就可以绕过网络进行本地源的安装。
分享到:
评论
1 楼 di1984HIT 2014-06-04  
谢谢,学习了

相关推荐

    阿里云主机centos7 CentOS-Base.repo

    阿里云主机centos7自带的 CentOS-Base.repo 文件,在此备份,用于自用。能够加速yum下载,同时能够提高主机性能

    CentOS-Base.repo

    在Linux系统中,`CentOS-Base.repo` 文件是一个至关重要的配置文件,它定义了`yum`包管理器如何连接到软件仓库以获取更新和安装软件。`yum`(Yellowdog Updater, Modified)是 CentOS 和其他基于 RPM 的 Linux 发行...

    CentOS-Base.repo(centos7)

    CentOS-Base.repo

    CentOS-Base.repo.txt文件

    `CentOS-Base.repo`是位于`/etc/yum.repos.d/`目录下的一个配置文件,这个文件包含了CentOS软件仓库的信息。在系统中,可能有多个`.repo`文件,每个文件代表一个不同的软件源,例如`CentOS-Updates.repo`、`CentOS-...

    5、6、7系统CentOS-Base.repo文件.zip

    2020年12月份,Centos官方宣布了...分享下5、6、7系统的CentOS-Base.repo文件,基于清华大学及Centos官方vault.centos.org 的旧版本国外yum源地址。 替换之后yum clean all 、rm -rf /var/cache/yum/ 、yum makecache

    Redhat7安装全量包 包括 CentOS-Base.repo配置文件

    Redhat7安装yum的图解,这里的资源是安装全量包,包括 CentOS-Base.repo配置文件 相关博客地址:http://blog.csdn.net/qq_34256348/article/details/78837175

    centos-8.repo源

    centos-8.repo源

    centos7.4.1708-32位清华大学yum源配置文件(CentOS-Base.repo )

    centos7.4.1708-32位,清华大学yum源配置文件,把原来的源备份后直接覆盖就可以

    CentOS-Base.repo,centos6可用源

    centos6.X从2020年11月底开始已经没有可用源了,在本地物理机,本地虚拟机都无法使用yum安装,非常不方便,为此特意解决了centos6的源问题,亲测可用,用好了希望给与好评!

    vault.centos.org 做为yum源的repo文件

    1.只保留/etc/yum.repos.d/CentOS-Base.repo 其它文件 要么删除要么改后缀 2.编辑文件 /etc/yum.repos.d/CentOS-Base.repo ,将其中的 mirrors.aliyun.com/centos/$releasever 替换成相应历史源站地址和版本号,如 ...

    Centos-6.repo

    修改yum源 Centos-6.repo; 修改yum源 Centos-6.repo; 修改yum源 Centos-6.repo;

    CentOS-Base-Debuginfo-Media.repo

    在CentOS系统中,`.repo`文件是用于定义yum或dnf(软件包管理器)仓库的配置,这些仓库是获取系统更新、安装新软件或获取调试信息的地方。"Base"通常指的是基础仓库,提供CentOS操作系统的核心组件和基本工具。...

Global site tag (gtag.js) - Google Analytics