码迷,mamicode.com
首页 > 系统相关 > 详细

更改 Ubuntu 的 apt 源

时间:2018-03-28 00:06:04      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:bak   vim   post   大学   运行   ict   date   hive   ack   

1.在更改apt源之前要先备份官方自带的apt源

cd   /etc/apt
sudo  cp sources.list  sources.list.bak 

2. 更改 sources.list 文件

sudo gedit sources.list  或者  sudo  vim  sources.list 

3.一些 国内的 apt 源 

  香港中文大学:

deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty-backports main restricted universe multiverse

 或者用阿里云:

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

 ubuntu的源, 最好也加上,避免某些库下载不到  

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

4.运行

sudo  apt-get  update
sudo  ape-get  upgrade

  

  

 

更改 Ubuntu 的 apt 源

标签:bak   vim   post   大学   运行   ict   date   hive   ack   

原文地址:https://www.cnblogs.com/hk-faith/p/8660845.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!