当前位置:首页 > 网络技术 > 正文内容

Ubuntu把软件源修改为国内源并且更新源

旺达泥网5年前 (2019-10-05)网络技术1788

1. 备份原始文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup


2. 修改文件并添加国内源

sudo vim /etc/apt/sources.list


3. 注释原文件内的源并添加如下地址

#Ubuntu 官方源 

deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

#阿里云

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

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

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

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

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

#网易163

deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse


4. 放置非官方源的包不完整,可在为不添加官方源

deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse


5. 更新源

sudo apt-get update


6. 更新软件

sudo apt-get dist-upgrade

sudo apt-get upgrade

由于包与包之间存在各种依赖关系。upgrade只是简单的更新包,不管这些依赖,它不和添加包,或是删除包。而dist-upgrade可以根据依赖关系的变化,添加包,删除包。upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来. dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,就会试着去安装/移除它. (所以通常这个会被认为是有点风险的升级) 


7. 常见的修复安装命令

sudo apt-get -f install




#Ubuntu 官方源
#deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

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

#网易163
#deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
#deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
#deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse

扫描二维码推送至手机访问。

版权声明:本文由旺达泥网发布,如需转载请注明出处。

本文链接:http://wangdani.cn/post/2904.html

分享给朋友:

“Ubuntu把软件源修改为国内源并且更新源” 的相关文章

php报错解决方式Warning: file_get_contents

废话不说直接进入主题:        php.ini  配置修改3个地方extension=php_openssl.dllallow_url_include = Onallow_url_fopen = On如果...

Ubuntu首次使用设置root密码

一、默认密码Ubuntu的默认root密码是随机的,即每次开机都有一个新的root密码。我们可以在终端输入命令 sudo passwd,然后输入当前用户的密码,enter,//下面可不看二、设置密码sudo passwd root[sudo] password for you :–> 输入你的...

ubuntu更新软件库

sudo apt-get updatesudo apt-get install...

ubuntu安装远程桌面xface4

1:安装轻量级桌面 xfce 使用下面的命令(需要远程桌面的话,建议装这个):sudo apt-get install xubuntu-desktop2:xrdp安装配置方法sudo apt-get install xrdpsudo apt-get install vnc4server tightv...

如果Eclipse新导入jar项目(zip)变红

解决方案:        把java的类库加载进去              &...

Ubuntu上安装VMware

第一步:下载        去官网下吧第二步:在下载文件目录赋予权限        sudo chmod +x VMware的文件名&nbs...