• 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

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

  • 相关阅读:
    Python 性能剖分工具
    串口编程
    拼音输入法实现
    Android 第三方分享中遇到的问题以及解决方案
    linux C 获取与修改IP地址
    git拉取远程分支并创建本地分支
    再次探讨企业级开发中的Try......Catch性能问题
    [手游新项目历程]-38-Supervisord守护进程
    公务员考试
    概念的内涵和外延
  • 原文地址:https://www.cnblogs.com/Cqlismy/p/12848400.html
Copyright © 2020-2023  润新知