Ubuntu换国内源

2020/7/19 2:17:00 人评论 次浏览 分类:学习教程

之前用了别人介绍的在sources中GUI修改源,从美国的换到中国的源,不过里面的包下载速度也不太好,安装一个git都能整一个小时。而且没有阿里源和清华源。只能手动换一个:
在这里插入图片描述
在换了阿里源之后,下载安装都快多了!
在这里插入图片描述

  1. 首先在进入Ubuntu的时候别进入游客模式,要不然会出现没有权限修改不了sources.list的情况。
  2. 备份,打开sources.list
    可以到computer->etc->apt中找到sources.list手动备份,然后右键gedit打开 在这里插入图片描述
    或者桌面打开终端,执行命令备份:
sudo  cp   /etc/apt/sources.list   /etc/apt/sources.list.bak

执行命令打开文件:

sudo  gedit   /etc/apt/sources.list 
  1. 删除里面的内容,粘贴阿里源和清华源其中任意一个,保存(注意,如果没有安装VMTool,是没办法进行粘贴复制)
    阿里源:
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

清华源:

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
  1. 更新源
    在终端中执行命令,完成换源:
sudo apt update

相关资讯

    暂无相关的资讯...

共有访客发表了评论 网友评论

验证码: 看不清楚?
    -->