Ubuntu替换清华源或者阿里源
倒腾pygame包的问题(Ubuntu 19.10),安装好pip后,又要安装一个pygame的包,倒腾了两天两夜,硬是因为网络问题(可能被强大的墙阻挡了),安装不成功,后面在网上找了篇帖子,用清华源,夸张点说,5秒不到就搞定了pygame的安装。
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pygame
我使用的是python3.7.5,如有必要,请换成pip。
然后就萌生了改了Linux的软件源的想法,在网上也查了下,都说清华的源速度快,5分钟更新一次,于是开工换清华的源。步骤如下:
找到sources.list,备份以防万一:
cd /etc/apt #进入软件源文件目录
sudo cp sources.list sources.list.20200304bak #找到sources.list并拷贝一份以防万一,我喜欢用日期做备份备注,个人喜好
sudo gedit sources.list #打开要编辑的源文件
清空打开的源文件,把下面代码复制到源文件
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-security main restricted universe multiverse # 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ eoan-proposed main restricted universe multiverse
我用的Ubuntu19.10的,所以我选择的源是19.10,其他版本的自行替换。
接下来就是愉快的随心所欲的更新软件包或者安装软件包了。再也不要受墙的气了。先更新一波压压惊:
sudo apt-get update #更新索引,也可以叫软件信息数据库
sudo apt-get upgrade #更新软件
sudo apt-get dist-upgrade #进行系统升级
写在最后,再也不要因为用linux而受GFW的鸟气了。
清华源帮助页面,很有用的东西:
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
Ubuntu替换清华源或者阿里源的更多相关文章
- ubuntu16.04更改源为阿里源
一.通过系统更换源 第一步:备份原来的源文件cd /etc/apt/ 然后会显示下面的源文件sources.list输入命令sudo cp sources.list sources.list.bak ...
- [转]centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv CentOS-Base.repo ...
- centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 安装base reop源 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv Cen ...
- Ubuntu 修改apt-get源为阿里源
原文件重命名备份 sudo mv /etc/apt/sources.list /etc/apt/source.list.bak 编辑源列表文件 sudo vim /etc/apt/sources.li ...
- Saltstack设置安装源为阿里源
Saltstack设置安装源为官方源有时候在国内网络不好安装较慢或者安装不上,可设置为阿里源 比如对于 Centos 7 系统,在 saltstack 的官网提供的配置初始化手册是: sudo yum ...
- 更改 centos 7的源为 阿里源
阿里源的网址在这里:http://mirrors.aliyun.com/repo/ 一.进入源文件存放目录 cd /etc/yum.repos.d 二.安装基本源: 1.如果要备份原来的源文件 sud ...
- 在centos中修改yum源为阿里源
cd /etc/yum.repos.d 备份旧的配置文件:mv CentOS-Base.repo CentOS-Base.repo.bak 下载阿里源的文件: wget -O CentOS-Base. ...
- Centos 7 修改yum源为阿里源
因为官方的yum源在国内访问效果不佳, 需要改为国内比较好的阿里云或者网易的yum源, 具体修改步骤如下: cd /etc/yum.repos.d # 备份旧的配置文件 mv CentOS-Base. ...
- 设置centos的yum仓库源为阿里源
前提 使我们的主机能够连接到外网 cd /etc/yum.repos.d/ #切换到yum仓库目录下 rm -rf * #删除默认配置仓库 wget -O /etc/yum.repos.d/CentO ...
随机推荐
- HTTPS原理剖析
一.HTTP隐患 客户端向服务器发送HTTP请求,服务器收到请求后返回响应给客户端: 抓包如图: 我们可以发现:HTTP报文明文传输(而TCP/IP是可能被窃听的网络):且客户端跟服务器之间没有任何身 ...
- 牛客练习赛68 牛牛的无向图 题解(krusal思想)
题目链接 题目大意 要你查询q 次询问,每次询问给出一个 L ,询问\(\sum_{i=1}^n\sum_{j=i+1}^n[d(i,j)<=L]\).其中 [C] 表示当命题 C 为真的时候为 ...
- TIOBE 11月指数:C语言居首,稳居宝座,Python直逼第二!
官方网址:https://www.tiobe.com/tiobe-index/ 这是自近20年前TIOBE指数开始以来,Java和C第一次不再占据前两位.C仍然是第一位的,但是现在第二个位置是 ...
- LeetCode 037 Sudoku Solver
题目要求:Sudoku Solver Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells ...
- bypass disable_function
windows 1.com组件绕过 <?php$command=$_POST['a'];$wsh = new COM('WScript.shell'); // 生成一个COM对象 Shell.A ...
- AndroidStudio新导入项目,无法编译,rebuild、clean都无效
此按钮,可以用gradle重新编译
- Feign 自定义 ErrorDecoder (捕获 Feign 服务端异常)
问题描述 Feign 客户端捕获不到服务端抛出的异常 问题解决 重新 ErrorDecoder 即可,比如下面例子中在登录鉴权时想使用认证服务器抛出 OAuth2Exception 的异常,代码如下: ...
- git全流程
服务器:Ubuntu 使用git前准备工作: 下载git之前先更新: apt-get update 安装git: apt-get install git 创建本地仓库: mkdir test git初 ...
- linux下的bash shell
运行bash shell命令的方式 vi t1.sh 并输入 pwd ls pwd 然后:x保存关闭 1.首先查看权限 ls -l,如果没有执行权限则用chmod a+x t1.sh ,最后运行./t ...
- 第12.5节 Python time模块导览
一.时间相关的概念 time模块模块提供了各种时间相关的函数,在介绍时间相关功能前,先介绍一些术语和惯例: epoch 是时间开始的点,并且取决于平台.对于Unix, epoch 是1970年1月1日 ...