首页 » VPS 知识 » 浏览内容

CentOS使用163软件源


2012-06-16 17:16:37 16,786 0 发表评论 字体: 作者:C.K.

体验版 88 元,个人版 128 元,多用户版 288元个人版160元升级到多用户版。

使用163的yum源

vi /etc/yum.repos.d/CentOS-Base.repo

1.进入http://mirrors.163.com/.help/centos.html下载CentOS-Base-163.repo, 放入/etc/yum.repos.d/

2.yum clean metadata 清除以前的缓存

3.yum makecache 生成缓存

yum search softwarename 查找软件

yum list softwarename 列出已装软件

yum install softwarename 安装软件

yun remove softwarename 卸载软件

(sohu yum源: http://mirrors.shou.com,使用方法相同)

参考:

# 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/
  • baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
  • gpgcheck=1
  • #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • gpgkey=http://mirror.centos.org/centos/PRM-GPG-KEY-CentOS-6
  • #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/
  • baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
  • gpgcheck=1
  • #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • gpgkey=http://mirror.centos.org/centos/PRM-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://mirror.centos.org/centos/$releasever/extras/$basearch/
  • baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
  • gpgcheck=1
  • #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • gpgkey=http://mirror.centos.org/centos/PRM-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://mirror.centos.org/centos/$releasever/centosplus/$basearch/
  • baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
  • gpgcheck=1
  • enabled=0
  • #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • gpgkey=http://mirror.centos.org/centos/PRM-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://mirror.centos.org/centos/$releasever/contrib/$basearch/
  • baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
  • gpgcheck=1
  • enabled=0
  • #gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  • gpgkey=http://mirror.centos.org/centos/PRM-GPG-KEY-CentOS-6
  • 使用光盘yum源

    1.挂载光盘
    mount -t iso9660 -o loop /dev/cdrom /media/CentOS
    2.移除/etc/yum.repos.d目录原有的repo文件
    3.创建新repo文件
    vi /etc/yum.repos.d/CentOS-Media.repo
    加入如下字段:
    [c5-media]
    name=CentOS-$releasever – Media
    baseurl=file:///media/CentOS/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    4.刷新repos
    yum makecache

    参考 /etc/yum.repos.d/CentOS-Media.repo文件

    # CentOS-Media.repo
  • #
  • # This repo is 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 in your DVD and use it with the other repos too:
  • # yum –enablerepo=c5-media [command]
  • #
  • # or for ONLY the media repo, do this:
  • #
  • # yum –disablerepo=\* –enablerepo=c5-media [command]
  • [c5-media]
  • name=CentOS-$releasever – Media
  • baseurl=file:///media/CentOS/
  • file:///media/cdrom/
  • file:///media/cdrecorder/
  • gpgcheck=1
  • enabled=0
  • gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
  • 1 2

    网站统计 Statistics

    • 创建时间: 2005年1月3日 距今5095 天
    • 日志总数: 2461
    • 评论总数: 630
    • 标签总数: 654
    • 链接总数: 273
    • 最后更新: 2018-8-31 17:57:04
    • 您是本站第 14273176 位访客

    广告区 Guǎng Gào