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

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

  • 相关阅读:
    看到差距了,受打击
    数码相机选购指南(应小麻之作)
    sorry
    ACM集训第一天
    没事了,放心了,回到自己,又有些失落
    黑暗世界的一线光明

    无忧无虑的睡去,是一种奢华的享受(新)
    一些废话
    对事不对人
  • 原文地址:https://www.cnblogs.com/Cqlismy/p/12848400.html
Copyright © 2011-2022 走看看