赞
踩
目录
一、sudo apt install XX时提示找不到软件包或time out
ubuntu | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror
lsb_release -a //查看ubuntu版本
我的是20.04版本。复制下面的这段代码。
vi /etc/apt/sources.list
不建议现在的大多数教程中的直接将原来的源码备份后在原文件中删掉,这样可以以后要用的时候就找不到了。
所以我选择将原本的注释掉,然后在开头复制。
vim中Del后,命令行输入“:wq”保存并退出。
- # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
- # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
- # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
- deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
- # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
- # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
- # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
- deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
- # deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
- # 预发布软件源,不建议启用
- # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
- # # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
- sudo apt-get update
- sudo apt-get upgrade
换了清华源,更新时直接从国内镜像站获取软件包,更新速度会快很多。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。