近日,阿里云增设了linux开源软件镜像站点( 镜像地址:
http://mirrors.aliyun.com/ ),为CentOS、Debian、Ubuntu等linux云服务器提供了软件源,您可参考镜像右边【help】链接进行配置。若您的云服务器无公网ip,可将软件源域名从mirrors.aliyun.com改为mirrors.aliyuncs.com来访问软件源。
搭建此开源镜像的目的在于宣传自由软件的价值,提高自由软件社区文化氛围,在国内推广自由软件,满足linux云服务器用户安装软件的需求,欢迎大家使用,有问题请随时反馈我们。下面以Centos 5.7 64位、Centos 6.3 64位、Ubuntu 12.04,Debian 6.0.6为例简单介绍阿里云开源软件源的使用。
Centos 5.7 64位
1. 进入/etc/yum.repos.d/ 备份老的配置文件
cd /etc/yum.repos.d/ && mkdir -p back && mv *.repo back
2.下载配置
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-5.repo
如果是阿里云服务器可以把域名替换成内网域名,这样访问源的时候不占有公网带宽
sed -i 's/aliyun.com/aliyuncs.com/' /etc/yum.repos.d/CentOS-Base.repo
3. 更新索引
yum clean all && yum makecache
4. 使用yum安装软件,以安装apache为例:
yum search httpd
yum install httpd -y
参考:
http://mirrors.aliyun.com/help/centos
Centos 6.3 64位
1. 进入/etc/yum.repos.d/ 备份老的配置文件
cd /etc/yum.repos.d/ && mkdir -p back && mv *.repo back
2.下载配置
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-6.repo
如果是阿里云服务器可以把域名替换成内网域名,这样访问源的时候不占有公网带宽
sed -i 's/aliyun.com/aliyuncs.com/' /etc/yum.repos.d/CentOS-Base.repo
3. 更新索引
yum clean all && yum makecache
4. 使用yum安装软件,以安装apache为例:
yum search httpd
yum install httpd -y
参考:
http://mirrors.aliyun.com/help/centos
Ubuntu 12.04
1. 使用vim 编辑/etc/apt/sources.list
删除原有配置,新增如下配
deb
http://mirrors.aliyuncs.com/ubuntu precise main restricted universe multiverse
deb
http://mirrors.aliyuncs.com/ubuntu precise-security main restricted universe multiverse
deb
http://mirrors.aliyuncs.com/ubuntu precise-updates main restricted universe multiverse
deb
http://mirrors.aliyuncs.com/ubuntu precise-proposed main restricted universe multiverse
deb
http://mirrors.aliyuncs.com/ubuntu precise-backports main restricted universe multiverse
deb-src
http://mirrors.aliyuncs.com/ubuntu precise main restricted universe multiverse
deb-src
http://mirrors.aliyuncs.com/ubuntu precise-security main restricted universe multiverse
deb-src
http://mirrors.aliyuncs.com/ubuntu precise-updates main restricted universe multiverse
deb-src
http://mirrors.aliyuncs.com/ubuntu precise-proposed main restricted universe multiverse
deb-src
http://mirrors.aliyuncs.com/ubuntu precise-backports main restricted universe multiverse
2.apt使用
2.1 apt-get update #更新索引
2.2 apt-cache search nginx #搜索关键字还有nginx的包
2.3 apt-get install nginx #安装nginx
参考:
http://mirrors.aliyun.com/help/ubuntu
debian 6.0.6
1. 使用vim 编辑/etc/apt/sources.list
删除原有配置,新增如下配
deb
http://mirrors.aliyuncs.com/debian/ squeeze main non-free contrib
deb
http://mirrors.aliyuncs.com/debian/ squeeze-proposed-updates main non-free contrib
deb-src
http://mirrors.aliyuncs.com/debian/ squeeze main non-free contrib
deb-src
http://mirrors.aliyuncs.com/debian/ squeeze-proposed-updates main non-free contrib
2.apt使用
2.1 apt-get update #更新索引
2.2 apt-cache search nginx #搜索关键字还有nginx的包
2.3 apt-get install nginx #安装nginx