Ubuntu的官方源对于国内用户来说是比较慢的,可以将它的源换成国内的源,用起来就快很多了。

# Ubuntu server 环境
ubuntu@ubuntu:~$ sudo su -
[ sudo ] password for ubuntu: root@ubuntu:~ # uname -r
3.19.0-25-generic
root@DDTSC-Test-01:~ # lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:    trusty
root@ubuntu:~ # ufw status
Status: inactive
root@ubuntu:~ # ufw version
ufw 0.34~rc-0ubuntu2
Copyright 2008-2012 Canonical Ltd. # Ubuntu自带的源
root@ubuntu:~ # grep -E -v '^#|^$' /etc/apt/sources.list
deb http: //us .archive.ubuntu.com /ubuntu/ trusty main restricted
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty main restricted
deb http: //us .archive.ubuntu.com /ubuntu/ trusty-updates main restricted
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty-updates main restricted
deb http: //us .archive.ubuntu.com /ubuntu/ trusty universe
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty universe
deb http: //us .archive.ubuntu.com /ubuntu/ trusty-updates universe
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty-updates universe
deb http: //us .archive.ubuntu.com /ubuntu/ trusty multiverse
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty multiverse
deb http: //us .archive.ubuntu.com /ubuntu/ trusty-updates multiverse
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty-updates multiverse
deb http: //us .archive.ubuntu.com /ubuntu/ trusty-backports main restricted universe multiverse
deb-src http: //us .archive.ubuntu.com /ubuntu/ trusty-backports main restricted universe multiverse
deb http: //security .ubuntu.com /ubuntu trusty-security main restricted
deb-src http: //security .ubuntu.com /ubuntu trusty-security main restricted
deb http: //security .ubuntu.com /ubuntu trusty-security universe
deb-src http: //security .ubuntu.com /ubuntu trusty-security universe
deb http: //security .ubuntu.com /ubuntu trusty-security multiverse
deb-src http: //security .ubuntu.com /ubuntu trusty-security multiverse # 备份源列表
root@ubuntu:~ # mv /etc/apt/sources.list /etc/apt/sources.list_bak # 阿里云源
root@ubuntu:~ # vim /etc/apt/sources.list
deb https: //mirrors .aliyun.com /ubuntu/ trusty main restricted universe multiverse
deb-src https: //mirrors .aliyun.com /ubuntu/ trusty main restricted universe multiverse
deb https: //mirrors .aliyun.com /ubuntu/ trusty-security main restricted universe multiverse
deb-src https: //mirrors .aliyun.com /ubuntu/ trusty-security main restricted universe multiverse
deb https: //mirrors .aliyun.com /ubuntu/ trusty-updates main restricted universe multiverse
deb-src https: //mirrors .aliyun.com /ubuntu/ trusty-updates main restricted universe multiverse
deb https: //mirrors .aliyun.com /ubuntu/ trusty-backports main restricted universe multiverse
deb-src https: //mirrors .aliyun.com /ubuntu/ trusty-backports main restricted universe multiverse
## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 以上内容的带有词含义解析:
  proposed  预发布软件源,不建议启用
  deb-src      源码 # 更新源
root@ubuntu:~ # apt-get update
...
...若出现以下错误提示
... "Hash Sum mismatch"  解决办法:
   sudo rm -rf /var/lib/apt/lists/ *       # 删掉/var/lib/apt/lists 这个目录下的东西
   sudo mkdir /var/lib/apt/lists/partial     # 新建相应文件夹
   sudo apt-get update              # 重新update # 更新软件
root@ubuntu:~ # apt-get upgrade
...
...若出现以下错误提示
subprocess dpkg-deb --control returned error exit status 2
E: Sub-process /usr/bin/dpkg returned an error code (1)  解决办法:
   cd /var/lib/dpkg/
   sudo mv info/ info_bak          # 现将info文件夹更名
   sudo mkdir info                 # 再新建一个新的info文件夹
   sudo apt-get update             # 更新
   sudo apt-get -f install # 修复
   sudo mv info/* info_bak/        # 执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_bak文件夹下
   sudo rm -rf info                # 把自己新建的info文件夹删掉
   sudo mv info_bak info           # 把以前的info文件夹重新改回名 apt-get upgrade和dist-upgrade的差别:
  upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来.
  dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,就会试着去安装/移除它. (所以通常这个会被认为是有点风险的升级) ---------------------------------------------------------------------------------------------
# 清华源
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal main restricted
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-updates main restricted
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal universe
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-updates universe
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal multiverse
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-updates multiverse
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-backports main restricted universe multiverse
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-security main restricted
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-security universe
deb http: //mirrors .tuna.tsinghua.edu.cn /ubuntu/ focal-security multiverse
---------------------------------------------------------------------------------------------
# 中科大源
deb https: //mirrors .ustc.edu.cn /ubuntu/ focal main restricted universe multiverse
deb-src https: //mirrors .ustc.edu.cn /ubuntu/ focal main restricted universe multiverse
deb https: //mirrors .ustc.edu.cn /ubuntu/ focal-updates main restricted universe multiverse
deb-src https: //mirrors .ustc.edu.cn /ubuntu/ focal-updates main restricted universe multiverse
deb https: //mirrors .ustc.edu.cn /ubuntu/ focal-backports main restricted universe multiverse
deb-src https: //mirrors .ustc.edu.cn /ubuntu/ focal-backports main restricted universe multiverse
deb https: //mirrors .ustc.edu.cn /ubuntu/ focal-security main restricted universe multiverse
deb-src https: //mirrors .ustc.edu.cn /ubuntu/ focal-security main restricted universe multiverse
deb https: //mirrors .ustc.edu.cn /ubuntu/ focal-proposed main restricted universe multiverse
deb-src https: //mirrors .ustc.edu.cn /ubuntu/ focal-proposed main restricted universe multiverse
---------------------------------------------------------------------------------------------
# 网易163源
deb http: //mirrors .163.com /ubuntu/ focal main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ focal-security main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ focal-updates main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ focal-proposed main restricted universe multiverse
deb http: //mirrors .163.com /ubuntu/ focal-backports main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ focal main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ focal-security main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ focal-updates main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ focal-proposed main restricted universe multiverse
deb-src http: //mirrors .163.com /ubuntu/ focal-backports main restricted universe multiverse

Ubuntu Linux 更换国内源的更多相关文章

  1. 树莓派-为Ubuntu Mate更换国内源 [转]

    更换步骤以root身份打开 /etc/apt/sources.list    将 http://ports.ubuntu.com/ 全部替换为中科大的源 http://mirrors.ustc.edu ...

  2. Linux 更换国内源

    1.事件背景 事情起因是因为我想安装xvfb,执行sudo apt-get install xvfb发现安装报错,看报错原因是被墙导致,因为我用的默认源也没有挂代理:然后就百度,发现都是互相抄,什么换 ...

  3. kali linux 更换国内源报GPG error解决办法

    wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add

  4. Ubuntu18.04更换国内源(阿里,网易,中科大,清华等源)

    1.备份 备份/etc/apt/sources.list文件 mv /etc/apt/sources.list /etc/apt/sourses.list.backup 2.新建 新建/etc/apt ...

  5. Ubuntu18.04更换国内源

    Ubuntu18.04更换国内源 Ubuntu本身的源使用的是国内的源,下载速度比较慢,不像CentOS一样yum安装的时候对镜像站点进项选择, 所以选择了更换成国内的源. 以下内容整合自网络 备份/ ...

  6. yum更换国内源、yum下载rpm包、源码包安装 使用介绍

    第5周第4次课(4月19日) 课程内容: 7.6 yum更换国内源7.7 yum下载rpm包7.8/7.9 源码包安装 7.6 yum更换国内源 当yum仓库的软件不好用时,例如很多yum源都是国外的 ...

  7. pip/pip3更换国内源

    pip/pip3更换国内源 用途:pip更换为国内源,可以大大的提高安装成功率和速度. Windows更换pip/pip3源 打开目录:%appdata% 新增pip文件夹,新建pip.ini文件 给 ...

  8. yum更换国内源 yum下载rpm包 源码包安装

    7.6 yum更换国内源 7.7 yum下载rpm包 7.8/7.9 源码包安装 yum更换国内源 cd  /etc/yum.repo.d/ 删除源 rm -f   dvd.repo rm -f  C ...

  9. yum更换国内源及yum下载rpm包

    一.yum更换国内源 运维开发技术交流群欢迎大家加入一起学习(QQ:722381733) 1.前往yum文件路径地址 [root@web1 ~]# cd /etc/yum.repos.d/ [root ...

  10. FreeBSD更换国内源(pkg源使用台湾源,中科大源备用)

    安装后第一件事就是更换国内源,不然后面安装桌面等,不用国内源下载太慢. 修改 pkg 源 创建用户级 pkg 源目录:mkdir -p /usr/local/etc/pkg/repos ee /usr ...

随机推荐

  1. Midjourney|文心一格prompt教程[基础篇]:注册使用教程、风格设置、参数介绍、隐私模式等

    Midjourney|文心一格prompt教程[基础篇]:注册使用教程.风格设置.参数介绍.隐私模式等 开头讲一下为什么选择Midjourney和文心一格,首先Midjourney功能效果好不多阐述: ...

  2. Flutter编写的数独游戏

    一个使用Flutter编写的每日数独小游戏,支持Android和ios.代码已上传到github:https://github.com/huhx/flutter_sudoku Library 状态管理 ...

  3. 【Linux】详解Centos7的下载安装配置

    本文时间 2023-05-17 作者:sugerqube漆瓷 为什么是Centos7 centos8已经停止维护,centos7将在2024-06-30停止维护(所以暂时选7) 未来替代品参考: Al ...

  4. centOS 7 添加删除用户和用户组

    1.添加新用户 由于日常使用时root用户权限过大,所以添加一个用户供日常使用,或者供他人使用. 1 新增用户 adduser [用户名] [root@centos ~]# adduser dex 2 ...

  5. List的拆分的几种方式

    开发中我们可能会遇到一个大的集合,然后我们需要对集合进行拆分,然后再对拆分的集合进行相关的操作.当然我们可以自己写一个拆分的方法,我自己写过用了不少代码,但是感觉还不是很好,最近看了不少工具才发现很多 ...

  6. [ARM 汇编]进阶篇—异常处理与中断—2.4.2 ARM处理器的异常向量表

    异常向量表简介 在ARM架构中,异常向量表是一组固定位置的内存地址,它们包含了处理器在遇到异常时需要跳转到的处理程序的入口地址.每个异常类型都有一个对应的向量地址.当异常发生时,处理器会自动跳转到对应 ...

  7. 浅谈TCP和UDP

    简介 在计算机网络中,TCP(传输控制协议)和UDP(用户数据报协议)是两个常用的传输层协议.它们分别提供了可靠的数据传输和快速的数据传送,成为互联网世界中的双子星.本文将探讨TCP和UDP的特点.优 ...

  8. Python运维开发之路《模块》

      一.模块 1. 模块初识 模块定义:模块(module),通常也被称为库(lib,library),是一个包含所有你定义的函数和变量的文件,其后缀名是.py.模块可以被别的程序引入,以使用该模块中 ...

  9. Uniapp下GoEasy通知栏推送不工作问题排查记录

    我们是uniapp开发的app,项目中的系统消息推送使用的是GoEasy Websocket 实时推送,上线一段时间后,客户反馈说,当app没有在前台运行时也需要想办法通知用户一些重要的系统通知.那么 ...

  10. MYSQL之批量删除(mybatis)

    如果参数是array数组 <update id="deleteAll"> delete from C_V WHERE UUID in <foreach item= ...