zoukankan      html  css  js  c++  java
  • Ubuntu16.04更换国内源

    1、前言

    在Ubuntu系统上使用"apt-get install"进行软件安装更新的时候,由于使用的源是国外的,网络速度非常缓慢,本文记录在Ubuntu系统上进行更换国内源。

    2、Ubuntu换源

    首先需要将原始的源文件进行备份,命令行如下:

    $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

    接下来,修改源文件/etc/apt/sources.list,添加国内源:

    $ sudo vim /etc/apt/sources.list

    先将原文件的内容进行删除,然后添加国内源,常用的国内源有如下:

    (1)阿里源

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

    (2)清华源

    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

    将上面给出的源复制到文件/etc/apt/sources.list即可。

    最后,使用下面命令进行源更新:

    $ sudo apt-get update

    源更新完成后,安装自己需要的软件就可以了。

  • 相关阅读:
    curl 设置超时时间
    allure 2
    shell 给文件每一行都添加指定字符串
    shell 文件的包含
    shell 求数组的平均值,求和,最大值,最小值
    shell 编写进度条
    shell 换行与不换行
    Linux常用命令简述--dirname与basename
    shell中脚本参数传递getopts
    Shell 中eval的用法
  • 原文地址:https://www.cnblogs.com/Cqlismy/p/12848400.html
Copyright © 2011-2022 走看看