zoukankan      html  css  js  c++  java
  • Ubuntu替换国内源(清华源)

    第一步

    清华大学开源镜像站找到自己的linux系统版本

    我的是Ubuntu 18.04LTS:

    # 默认注释了源码镜像以提高 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
    
    # 预发布软件源,不建议启用
    # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
    

    第二步

    apt-get配置文件所在的目录为/etc/apt,故先进入目录,然后对原配置文件进行一份备份:sudo cp sources.list sources.list.bak,以防丢失。最后使用vim打开sources.list文件,将原内容删除,替换为新的配置内容(在root模式下进行)。备份命令如下:

    ubuntu:~$ cd /etc/apt
    ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak
    

    第三步

    更新源,使配置生效

    ubuntu:~$ sudo apt-get update 
    
  • 相关阅读:
    canvas和svg
    表单控件及表单属性
    ajax
    数据结构与算法经典问题解析-Java语言描述
    SpringBoot
    ThreadLocal 原理
    代理模式-结构型
    框架面试
    Hash算法总结
    集合与多线程面试
  • 原文地址:https://www.cnblogs.com/pengweii/p/12580479.html
Copyright © 2011-2022 走看看