welcome: please sign in
location: MirrorUseHowto

镜像使用指南

1. Fedora/CentOS

Fedora/CentOS 系的软件源配置文件位于 /etc/yum.repos.d/ 下,以 .repo 结尾,实为 ini 格式的文本文件。

Fedora 用户一般需要 Fedora 的软件源获取 Fedora 打包的软件的更新支持;另外可能还会用到 RPM Fusion 的软件源以得到更多的软件。CentOS 用户则会相应地用到 CentOS 和 EPEL 两个(或更多)软件源。

Fedora 的默认配置是从 Fedora 软件源的官方镜像里选取。由于 TUNA 还未加入其中,所以使用 TUNA 的 Fedora 软件源还需要手动配置。请参考下面贴出来的文件内容。

提示:其实往往就是只需更改一行 baseurl 具体指向即可。(sed/vim/...?) 下面的内容是为了完整性,和满足纯新手和懒人们的需求。

无担保

不担保下面的配置文件内容一定可用。

1.1. Fedora

1.1.1. fedora.repo

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://mirrors.tuna.tsinghua.edu.cn/fedora/releases/$releasever/Everything/$basearch/os/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
baseurl=http://mirrors.tuna.tsinghua.edu.cn/fedora/releases/$releasever/Everything/source/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

1.1.2. fedora-updates.repo

[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://mirrors.tuna.tsinghua.edu.cn/fedora/updates/$releasever/$basearch/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
failovermethod=priority
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[updates-source]
name=Fedora $releasever - Updates Source
failovermethod=priority
baseurl=http://mirrors.tuna.tsinghua.edu.cn/fedora/updates/$releasever/SRPMS/
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-source-f$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

注:debuginfo,source 一般用不上,也不启用。所以配置中没有修改他们对应的 URL。

1.2. RPMFusion

注意要使用 RPMFusion 第三方源,首先要安装 rpmfusion-*.rpm,请参考 http://rpmfusion.org/Configuration

1.2.1. rpmfusion-free.repo

[rpmfusion-free]
name=RPM Fusion for Fedora $releasever - Free
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

[rpmfusion-free-debuginfo]
name=RPM Fusion for Fedora $releasever - Free - Debug
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

[rpmfusion-free-source]
name=RPM Fusion for Fedora $releasever - Free - Source
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

1.2.2. rpmfusion-free-updates.repo

[rpmfusion-free-updates]
name=RPM Fusion for Fedora $releasever - Free - Updates
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/updates/$releasever/$basearch/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

[rpmfusion-free-updates-debuginfo]
name=RPM Fusion for Fedora $releasever - Free - Updates Debug
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

[rpmfusion-free-updates-source]
name=RPM Fusion for Fedora $releasever - Free - Updates Source
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=free-fedora-updates-released-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch

1.2.3. rpmfusion-nonfree.repo

[rpmfusion-nonfree]
name=RPM Fusion for Fedora $releasever - Nonfree
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/releases/$releasever/Everything/$basearch/os/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

[rpmfusion-nonfree-debuginfo]
name=RPM Fusion for Fedora $releasever - Nonfree - Debug
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

[rpmfusion-nonfree-source]
name=RPM Fusion for Fedora $releasever - Nonfree - Source
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/releases/$releasever/Everything/source/SRPMS/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

1.2.4. rpmfusion-nonfree-updates.repo

[rpmfusion-nonfree-updates]
name=RPM Fusion for Fedora $releasever - Nonfree - Updates
baseurl=http://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/updates/$releasever/$basearch/
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

[rpmfusion-nonfree-updates-debuginfo]
name=RPM Fusion for Fedora $releasever - Nonfree - Updates Debug
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-debug-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

[rpmfusion-nonfree-updates-source]
name=RPM Fusion for Fedora $releasever - Nonfree - Updates Source
mirrorlist=http://mirrors.rpmfusion.org/mirrorlist?repo=nonfree-fedora-updates-released-source-$releasever&arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch

1.3. CentOS

1.3.1. 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://mirrors.tuna.tsinghua.edu.cn/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.tuna.tsinghua.edu.cn/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.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=0
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.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=0
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.tuna.tsinghua.edu.cn/centos/$releasever/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=file:////etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

1.3.2. EPEL

EPEL 源的安装:http://fedoraproject.org/wiki/EPEL/FAQ#howtouse

epel.repo 可以修改为:

[epel]
name=EPEL RPM Repository for Red Hat Enterprise Linux
baseurl=http://mirrors.tuna.tsinghua.edu.cn/epel/6/$basearch/
gpgcheck=1
enabled=1

2. Ubuntu

Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用 TUNA 的软件源镜像。

注意:Ubuntu 的版本代号(codename)是直接写在软件源配置文件中的,所以不同的版本所需的配置文件内容不通用。 下面仅贴出了最常用的版本的可用配置文件,其余版本请自行做相应修改(参考这里)。

2.1. 10.04

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-backports main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-proposed main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-proposed main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ lucid-updates main multiverse restricted universe

2.2. 11.10

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-proposed main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ oneiric-updates main multiverse restricted universe

2.3. 更多

更多版本的设置,请参看下表中列出的 Ubuntu 版本号和代号的对应关系,将上面的配置中的代号全部替换为相应代号即可。

版本号

代号

完整代号

8.04 LTS

hardy

Hardy Heron

10.04 LTS

lucid

Lucid Lynx

10.10

maverick

Maverick Meerkat

11.04

natty

Natty Narwhal

11.10

oneiric

Oneiric Ocelot

12.04 LTS

precise

Precise Pangolin

12.10

quantal

Quantal Quetzal

2.4. 参考

Ubuntu 相关内容参考自 http://mirror.bjtu.edu.cn/cn/howto.html

3. Raspbian

3.1. Raspbian简介

Raspbian是专门用于ARM卡片式计算机Raspberry Pi®“树莓派”的操作系统。

Raspberry Pi®“树莓派”是2012年问世的ARM计算机,旨在为儿童和所有的计算机爱好者提供一套廉价的编程学习与硬件DIY平台。树莓派基于ARM11,具有1080P高清视频解析能力,附带用于硬件开发的GPIO接口,使用Linux操作系统。售价仅$25~$35。

Raspbian系统是Debian 7.0/wheezy的定制版本。得益于Debian从7.0/wheezy开始引入的“带硬件浮点加速的ARM架构”(armhf),Debian 7.0在树莓派上的运行性能有了很大提升。Raspbian默认使用LXDE桌面,内置C和Python编译器。

Raspbian是树莓派的开发与维护机构The Raspbeery Pi Foundation“树莓派基金会”,推荐用于树莓派的首选系统。

由于以下原因,Raspbian需要单独组建软件仓库,而不能使用Debian的仓库:

3.2. 系统架构与版本

架构:

版本:

注:Raspbian系统由于从诞生开始就基于(为了armhf,也必须基于)当时还是testing版本的7.0/wheezy,所以Raspbian不倾向于使用stable/testing表示版本。

3.3. 使用说明

基本与Debian一致。使用管理员权限(经由sudo),编辑/etc/apt/sources.list文件。参考命令行为:

pi@raspberrypi ~ $ sudo nano /etc/apt/sources.list

删除原文件所有内容,用以下内容取代:

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ wheezy main non-free contrib
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ wheezy main non-free contrib

注意:网址末尾的raspbian重复两次是必须的。因为Raspbian的仓库中除了APT软件源还包含其他代码。APT软件源不在仓库的根目录,而在raspbian/子目录下。

编辑镜像站后,请使用sudo apt-get update命令,更新软件源列表,同时检查您的编辑是否正确。

3.4. 声明

Raspbian是由独立开发者维护的,与树莓派硬件的开发与维护者The Raspberry Pi Foundation“树莓派基金会”并无直接联系。

3.5. 相关链接

3.5.1. Raspbian链接

3.5.2. 树莓派链接

3.6. 关于本文档

本文档内容由Raspberry Pi中文社区“树莓爱好者论坛”提供。按照知识共享署名-非商业性使用 3.0 中国大陆许可协议授权清华大学镜像站使用。


CategoryHowto

MirrorUseHowto (2013-04-16 19:18:56由alick编辑)