zoukankan      html  css  js  c++  java
  • Ubuntu更换国内源

    Ubuntu更换国内源

    备份初始源

    • sudo cp /etc/apt/sources.list{,.bak}
    • 为了方便,也可以直接切换到root进行操作:sudo su - root 

    更换源

    • vim /etc/apt/sources.list
    • 删除全部内容之后,添加上新的源

    1)阿里源:

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

    2)清华源:

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

    更新

    • 更新软件列表
      • sudo apt-get update 
    • 更新软件(将已安装的软件与刷新的软件列表中的软件版本进行对比,如果发现已安装的软件版本太低,就会提示更新)
      • sudo apt-get upgrade
  • 相关阅读:
    centos7系统初始化
    瀑布流无限加载infinitescroll插件与masonry插件使用
    网页前端导出CSV,Excel格式文件
    js添加收藏夹
    Fiddler修改http请求响应简单实例
    Nodejs的Gruntjs使用一则
    Jquery插件validate使用一则
    PostgreSQL操作-psql基本命令
    SSH连接时出现Host key verification failed的原因及解决方法以及ssh-keygen命令的用法
    在ubuntu20.04上设置python2为默认方式
  • 原文地址:https://www.cnblogs.com/hgzero/p/13187748.html
Copyright © 2011-2022 走看看