阿里云服务器买后如何更换镜像

阿里云服务器买后如何更换镜像,第1张

近日,阿里云增设了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.repo3. 更新索引 yum clean all &&yum makecache4. 使用yum安装软件,以安装apache为例:yum search httpd yum install httpd -y 参考: http://mirrors.aliyun.com/help/centosCentos 6.3 64位1. 进入/etc/yum.repos.d/ 备份老的配置文件 cd /etc/yum.repos.d/ && mkdir -p back &&mv *.repo back2.下载配置 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.repo3. 更新索引 yum clean all &&yum makecache4. 使用yum安装软件,以安装apache为例:yum search httpd yum install httpd -y参考: http://mirrors.aliyun.com/help/centos Ubuntu 12.041. 使用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 multiverse2.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/ubuntudebian 6.0.61. 使用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 contrib2.apt使用 2.1 apt-get update #更新索引 2.2 apt-cache search nginx #搜索关键字还有nginx的包 2.3 apt-get install nginx #安装nginx


欢迎分享,转载请注明来源:夏雨云

原文地址:https://www.xiayuyun.com/zonghe/714245.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-08-07
下一篇2023-08-07

发表评论

登录后才能评论

评论列表(0条)

    保存