1、备份原有源列表

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

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

vi /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 更新国内源的更多相关文章

  1. [Linux]ubuntu更改国内源

    转自: https://blog.csdn.net/qq_35451572/article/details/79516563 推荐快速更新国内源 https://blog.csdn.net/qq_35 ...

  2. ubuntu添加国内源

    安装Ubuntu 18.04后,使用国外源太慢了,修改为国内源会快很多. 修改阿里源为Ubuntu 18.04默认的源 备份/etc/apt/sources.list#备份cp /etc/apt/so ...

  3. Ubuntu更换国内源--解决终端下载速度慢的问题

    目前我已知的更改国内源的方法基本上就两种,第一种,把/etc/apt/sources.list文件里的源更换一下,改成阿里云或者其它源.第二种,更换在设置中software&updates(软 ...

  4. [教程]KALI LINUX 2.0 2019 更新国内源

    2019年最新版本KALI 为 KALI 2019.1 下载地址:https://www.kali.org/downloads/ 有的新入门的朋友可能会问,为什么每次都无法手动更新 例如:Update ...

  5. Ubuntu更换国内源

    打开终端,输入:sudo gedit /etc/apt/sources.list 在文件最底部输入以下内容: deb http://mirrors.ustc.edu.cn/ubuntu/ xenial ...

  6. ubuntu和windows上pip和windows上conda国内源更新module

    ubuntu上: -i http://pypi.douban.com/simple --trusted-host pypi.douban.com # pip install web.py -i htt ...

  7. Ubuntu ARM更改为国内源

    关键词:ubuntu  arm  ubuntu-ports  国内源  镜像  阿里源  apt apt-get install update  0%working  速度慢  rk3399  开发板 ...

  8. 让Ubuntu使用阿里云国内源,解决下载速度慢问题。

    阿里云镜像官方地址 http://mirrors.aliyun.com/ 找到最新源地址列表: http://www.linuxdiyf.com/linux/23163.html 软件包管理中心(推荐 ...

  9. ubuntu 把软件源修改为国内源

    国内有很多Ubuntu的镜像源,比如:阿里源.网易源等,还有很多教育网的源,比如:清华源.中科大源等. 这里以清华源为例讲解如何修改Ubuntu 18.04里面默认的源. 修改步骤 第一步:备份原始源 ...

随机推荐

  1. C 二维数组与指针

    http://c.biancheng.net/view/2022.html 1. 区分指针数组和数组指针 指针数组:存放指针的数组,如 int *pstr[5] = NULL; 数组中每个元素存放的是 ...

  2. Java 学习 时间格式化(SimpleDateFormat)与历法类(Calendar)用法详解

    基于Android一些时间创建的基本概念 获取当前时间 方式一: Date date = new Date(); Log.e(TAG, "当前时间="+date); 结果: E/T ...

  3. duilib教程之duilib入门简明教程6.XML配置界面

    前面那些教程都是为了让小伙伴们从win32.MFC过渡到duilib,让大家觉得duilib不是那么陌生,如果大家现在还对duilib非常陌生的话,那就说明前面的教程做得不好,请大家在下面留言,我会一 ...

  4. 关于InputMethodManager的使用方法

    InputMethodManager是一个用于控制显示或隐藏输入法面板的类(当然还有其他作用).获取InPutMethodManager的方法很简单. InputMethodManager imm = ...

  5. Linux课程---13、linux中任务计划介绍(任务计划分类)

    Linux课程---13.linux中任务计划介绍(任务计划分类) 一.总结 一句话总结: 1.一次性任务计划:at 2.周期性任务计划:crontab 1.linux中如何添加一次性任务计划? at ...

  6. fatal error U1087: cannot have : and :: dependents for same target Stop.

    转自VC错误:http://www.vcerror.com/?p=72 问题描述: 完成后编译,发现有错误  D:\WinDDK\7600.16385.1\bin\makefile.new(7117) ...

  7. iOS开发NSLayoutConstraint代码自动布局

    1.NSLayoutConstraint简介 适配界面大多用Masonry工具,也是基于NSLayoutConstraint写的!通过使用两个类方法实现自动布局: + (NSArray<__ki ...

  8. Windows下 vundle的安装和使用

    准备工作 1. 安装git 去官网下载,安装即可. 2. 添加git的环境变量 并将Git 的安装路径加入环境变量Path,如 D:\Program Files\Git\cmd 然后运行cmd,输入 ...

  9. Eclips安装STS(Spring Tool Suite (STS) for Eclipse)插件

    Spring Tool Suite(sts)就是一个基于Eclipse的开发环境, 用于开发Spring应用程序.它提供了一个现成的使用环境来实现, 调试, 运行, 和部署你的Spring应用程序.包 ...

  10. stop slave->reset slave->start slave 复制从哪个位置开始?reset slave all呢?

    reset slave首先来看下当前master-slave情况 mysql> prompt \u@\h,\p:\d>\_ PROMPT set to '\u@\h,\p:\d>\_ ...