位置: IT常识 - 正文

ubuntu 更换阿里源实例(ubuntu18更换为阿里源)

编辑:rootadmin
这篇文章主要介绍了ubuntu 更换阿里源实例的相关资料,这里提供了详细的步骤,需要的朋友可以参考下... 16-10-18

推荐整理分享ubuntu 更换阿里源实例(ubuntu18更换为阿里源),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:ubuntu更换阿里云,ubuntu更换阿里源的详细步骤,ubuntu更换阿里源的详细步骤,ubuntu更换阿里源的详细步骤,ubuntu1804更换为阿里源,ubuntu更换阿里源命令,ubuntu更换阿里云,ubuntu更换阿里云,内容如对您有帮助,希望把文章链接给更多的朋友!

网上应该可以找到很多关于ubuntu源的设置方法,但是如果不搞清楚就随便设置的话,不仅不能起到应有的效果,还会由于一些问题导致apt不可用。

最正确的更换源的方法应该如系统提示的:

## a.) add ‘apt_preserve_sources_list: true‘ to /etc/cloud/cloud.cfg## or do the same in user-data## b.) add sources in /etc/apt/sources.list.d## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

这种方法有点没弄明白在/etc/apt/sources.list.d应该添加的是什么内容,如果是源文件的话,最后更改的模板又是什么作用?也没有去尝试,有时间会解决一下。

以下提供设置阿里源的方法,其他源也可以如法炮制:

1. 首先查看自己的ubuntu系统的codename,这一步很重要,直接导致你更新的源是否对你的系统起效果,查看方法:

lsb_release -a

如,我的系统显示:

No LSB modules are available.Distributor ID:UbuntuDescription:Ubuntu 14.04.2 LTSRelease:14.04Codename:trusty

ubuntu 更换阿里源实例(ubuntu18更换为阿里源)

显示了一些ubuntu的版本信息,需要得到的是Codename,比如,我这里是trusty

2. 确认阿里源支持:

登陆以下网页:http://mirrors.aliyun.com/ubuntu/dists/

该网页显示了阿里云支持的ubuntu系统下各个Codename版本,确保自己的Codename在该网页中存在(一般都会有的)

2. 备份系统源:

cd /etc/apt sudo mv sources.list sources.list_bak

3. 添加新的源文件:

sudo vi sources.list

并添加以下内容:注意,每一行的trusty应该用第一步查看得到的Codename来代替

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universedeb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universedeb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

4. 保存并且sudo apt-get update,更新成功

5. 以下提供配置脚本:

1 Codename=$( (lsb_release -a)|awk ‘{print $2}‘|tail -n 1 )2 echo "\3 deb http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe4 deb http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe5 deb http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe6 deb http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe7 deb http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe8 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename main multiverse restricted universe9 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-backports main multiverse restricted universe10 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-proposed main multiverse restricted universe11 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-security main multiverse restricted universe12 deb-src http://mirrors.aliyun.com/ubuntu/ $Codename-updates main multiverse restricted universe ">sources.list13 apt-get updatesudo运行该脚本即可(注意运行之前最好备份之前的sources.list)

本文链接地址:https://www.jiuchutong.com/zhishi/276243.html 转载请保留说明!

上一篇:关闭固定在任务栏图标的常用项列表(关闭固定在任务栏的功能)

下一篇:媒体文件不显示缩略图怎么办(媒体文件不能播放)

  • 金税盘数据怎么备份
  • 董事会职权是否为强制规定
  • 政府补贴款需要缴纳增值税
  • 个人所得税哪里报税
  • 进项税转出主要内容包括
  • 本月进项税大于销项税有留底,如何做会计分录
  • 报销职工住院费多久到账
  • 捐赠的所得税怎么处理
  • 收到员工的罚款钱怎么写分录
  • 销售中央空调并安装账务处理
  • 一般纳税人贸易公司每个月最低费用多少
  • 水泥厂水泥增值税率是多少?
  • 车辆购置税固定资产
  • 税务的电子钥匙是干嘛的
  • 在下列哪种情况下
  • 个人股权激励收入计入年度综合个人所得税吗
  • 固定资产取得方式A04代号
  • 总分类账户和明细分类账户平行登记的内容可以概括为
  • 应收账款减值准备和坏账准备的区别
  • 住房公积金证书更新
  • 事业单位转账支票管理
  • 税号都对开户行错了影响抵扣
  • 一张发票上可以开几行
  • 小规模企业所得税按季度还是按年
  • 企业银行承兑汇票
  • linux中!
  • word如何修改正文字体
  • 收到地税退税会计分录
  • 贷款利息 发票
  • 如何通过路由器查看宽带账号密码
  • win11系统怎么投屏
  • 月末账务结转
  • dl是什么文件
  • 土地增值税可以扣除的税金
  • thinkphp 数据库查询
  • 应收账款债权融资计划业务操作指引
  • php pop
  • PHP基于国秘s2m加解密的处理方式
  • web用户管理系统报告
  • python字符串多行
  • 长期借款的主要成本包括
  • 赠送礼品账务处理会计分录
  • 冷饮成本价
  • 企业给企业借款收入会计处理
  • 劳务外包收入如何纳税
  • 金税卡报税流程
  • 支付员工的餐费怎么入账
  • 需要计提坏账准备的有哪些科目
  • 预提费用在资产负债表中如何列示
  • 销售返利可以税前扣除吗
  • 其他综合收益算当期损益吗
  • 无形资产减值迹象有哪些
  • 预付卡发票能不能走福利账户
  • 外购入库暂估补差单
  • 关于发票丢失的处罚
  • 总分类账的依据
  • mysql获取字段中的数字
  • windows资源管理器
  • win10预览版选哪个
  • centos7 network
  • linux-gnu
  • win7系统点击桌面图标闪退
  • iphone手机文件怎么传到电脑
  • linux 管理员登录
  • 手游频繁崩溃怎么解决
  • bootstrap入门
  • jquery图片轮播无缝连接
  • jquery倒计时60秒
  • unity 3.0
  • nodejs创建项目
  • linux shell实战
  • ecmascript新特性
  • javascript.
  • 社保信息怎么补全
  • 于开年 山东省国家税务局
  • 代收工会经费标准规定
  • 怎么查询公司法人电话号码
  • 土地的几种类型
  • 船舶吨税是中央税还是地方税
  • 环保标识码
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设