更改 Ubuntu 的 apt 源

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

  

  

 

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

时间: 2024-11-05 19:05:28

更改 Ubuntu 的 apt 源的相关文章

[转帖]ubuntu 修改 apt源的方法

https://www.cnblogs.com/dadonggg/p/11129973.html ubuntu 和 centos 是不一样的 ubunut 里面 用deb开头 放置到 /etc/apt/sources.list 里面 centos 是在 /etc/yum.repos.d/xxxx.repo 里面 主要 [name] name baseurl enable gpgcheck 等字段 以Ubuntu18.04为例: 1. 备份原有软件源文件 cp /etc/apt/sources.l

ubuntu的apt源

修改文件:/etc/apt/sources.list 内容如下: # 电子科大(教育网用户推荐) deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse deb http://ubuntu.uestc.e

Ubuntu 16.1 更改apt源

1 修改apt源配置文件,把/etc/apt/sources.list替换为以下内容: sudo gedit /etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ precise main restricted deb-src http://mirrors.163.com/ubuntu/ precie main restricted deb http://mirrors.163.com/ubuntu/ precise-updates m

ubuntu更换apt-get源&apt命令使用手册

ubuntu更换apt-get源 # cp /etc/apt/sources.list /etc/apt/sources.list.bak # vim /etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ precise main restricted deb-src http://mirrors.163.com/ubuntu/ precise main restricted deb http://mirrors.163.com/ubu

ubuntu apt源

deb http://mirrors.oschina.net/ubuntu/ raring main restricted universe multiversedeb http://mirrors.oschina.net/ubuntu/ raring-backports main restricted universe multiversedeb http://mirrors.oschina.net/ubuntu/ raring-proposed main restricted univers

Ubuntu 18.04 国内的 apt 源

h2 { text-align: left; background-color: #00FF00; color: #075db3 } h3 { text-align: left; background-color: #DEBD94; color: #075db3 } h3#nbs { background-color: #DEBD94; color: blue } 一.Ubuntu 18.04 国内的 apt 源 1. 阿里源 deb http://mirrors.aliyun.com/ubun

ubuntu如何修改IP地址、和apt源

新安装的ubuntu没有vim,使用vi修改自己的IP地址 [email protected]:~# cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) auto lo iface lo inet loopback auto ens3 iface ens3 inet static address 192.168.200.7 netmask 255.255.255.0 gateway 192.

Ubuntu 18.04 更换apt源

1.备份apt源 cp /etc/apt/sources.list /etc/apt/sources.list.bak 2.修改apt源 sudo gedit /etc/apt/sources.list 3.删除所有,添加阿里源 #添加阿里源 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-se

装hadoop的第一步,装ubuntu并换源并装jdk

如何装ubuntu,这个自己百度.具体安装网站:http://www.ubuntu.com 我安装的是ubuntu Server版本的,然后是全英文安装.所以它的源自动定位到美国 下面是如何换源的,第一个是操作.第二个是对操作的详细讲解. 1 //里面具体输入的命令,//表示注释内容,不需要管 2 sudo su -root //切换到管理员权限 3 4 vi /etc/apt/sources.list. //用vi打开sources.list 5 6 shift+: //进入命令模式这个时候会