Linux-yum源介绍

来源:互联网 发布:浪漫的c语言小程序 编辑:程序博客网 时间:2024/06/01 20:26

yum简介:

Yellow dog Updater, Modified由Duke University团队,修改Yellow Dog Linux的Yellow Dog Updater开发而成,是一个基于RPM包管理的字符前端软件包管理器。能够从指定的服务器自动下载RPM包并且安装,可以处理依赖性关系,并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。被Yellow Dog Linux本身,以及Fedora、Red Hat Enterprise Linux采用。
软件包来源:
可供Yum下载的软件包包括Fedora本身的软件包以及源自rpmfusion等非官方软件仓库的软件包,全部是由Linux社区维护的,并且基本是自由软件。所有的包都有一个独立的GPG签名,主要是为了用户的系统安全。对于Fedora core 4及更高版本的用户,来自新软件仓库的签名是自动导入并安装的.


yum 文件介绍:

yum的配置文件位置    /etc/yum.repos.dyum的默认生效文件    CentOS-Base.repo本地yum仓库的生效文件 CentOS-Media.repo
[root@localhost yum.repos.d]# pwd/etc/yum.repos.d[root@localhost yum.repos.d]# lsCentOS-Base.repo  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo

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 - Basemirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7# 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为容器的名称,可以随便取,一定要放在[]之中[base]   name=CentOS-$releasever - Base#镜像站点mirrorlist,可以注释掉,一般mirrorlist和baseurl配置了一个就可以了,默认是启用的mirrorlist配置mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates[updates]name=CentOS-$releasever - Updatesmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$releasever - Extrasmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plusmirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

linux配置国内yum源

懒人法:直接下载yum的配置文件;makecache:生成缓存比较慢,可以不生成缓存

阿里云

阿里云Linux安装镜像源地址:http://mirrors.aliyun.com/CentOS系统更换软件安装源1):备份你的原镜像文件,以免出错后可以恢复。mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bac2):下载新的CentOS-Base.repo 到/etc/yum.repos.d/CentOS 5系列wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repoCentOS 6系列wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo3):运行yum makecache生成缓存yum clean allyum makecache

网易

网易开源镜像站地址:http://mirrors.163.com/CentOS系统更换软件安装源1):备份你的原镜像文件,以免出错后可以恢复。mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup2):下载新的CentOS-Base.repo 到/etc/yum.repos.d/CentOS5系列wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repoCentOS6系列wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repoCentOS7系列wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo3):运行yum makecache生成缓存yum clean allyum makecache

搜狐

搜狐开源镜像站地址:http://mirrors.sohu.com/CentOS系统更换软件安装源1):备份你的原镜像文件,以免出错后可以恢复。mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup2):下载新的CentOS-Base.repo 到/etc/yum.repos.d/wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.sohu.com/help/CentOS-Base-sohu.repo3):运行yum makecache生成缓存yum clean allyum makecache

光盘本地yum源搭建

在没有网络的环境下如何使用yum源?可以使用光盘搭建本地yum源.

1.挂在光盘

#建立挂载点mkdir /mnt/cdrom#挂在光盘(将光盘挂在到cdrom文件夹下面)#mount /dev/cdrom /mnt/cdrom/mount /dev/sr0 /mnt/cdrom/

2.使网络yum源失效,配置光盘yum源
- 使网络yum源失效
- 列表内容
- 配置光盘yum源:
- 这里写图片描述


配置文件详细说明

yum配置文件 容器的属性介绍:
yum文件

配置说明:

  1. 通过配置文件,我们知道该配置文件配置了5个容器(每配置一个[]就代表配置了一个容器),要注意的是enabled属性在容器中不写默认是enabled=1 也就是使该容器生效.
  2. gpgcheck为验证,防止了安装了假的rpm包,对系统造成影响,开始数字验证,会跟官方的rpm包来比对,不相同,会组织安装.(gpgcheck=1代表生效>简介)gpgkey代表证书位置.
  3. 一般改linux系统的本地源,也也就是只需要将base容器的mirrorlist属性替换为本地的镜像地址既可.比如国内163源或者清华大学的源.

国内部分yum源列表如下:

    1.企业贡献:    搜狐开源镜像站:http://mirrors.sohu.com/    网易开源镜像站:http://mirrors.163.com/    2.清华大学:    http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6)    3.大学教学:    北京理工大学:    http://mirror.bit.edu.cn (IPv4 only)    http://mirror.bit6.edu.cn (IPv6 only)    北京交通大学:    http://mirror.bjtu.edu.cn (IPv4 only)    http://mirror6.bjtu.edu.cn (IPv6 only)    http://debian.bjtu.edu.cn (IPv4+IPv6)    兰州大学:http://mirror.lzu.edu.cn/    厦门大学:http://mirrors.xmu.edu.cn/

参考:
http://liqingbiao.blog.51cto.com/3044896/1727894
http://www.jianshu.com/p/d8573f9d1f96

原创粉丝点击