0


Ubuntu22.04换源(自用)以及pip临时换源

转自两位,仅整合

Ubuntu 22.04换国内源 清华源 阿里源 中科大源 163源_ubuntu22阿里源_nudt_qxx的博客-CSDN博客

ubuntu换镜像源(ubuntu换源)_乌班图镜像源_Fighting_1997的博客-CSDN博客

#备份镜像源设置文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

#编辑镜像源设置文件

sudo gedit /etc/apt/sources.list

清华源:

# 默认注释了源码镜像以提高 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 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

其他源:

阿里源:

deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse

pip

国内比较好的PyPI源库有:

    清华大学:https://pypi.tuna.tsinghua.edu.cn/simple
    阿里云:http://mirrors.aliyun.com/pypi/simple
    豆瓣:http://pypi.douban.com/simple

一、临时使用国内pypi镜像安装

比如安装 PyQt6,需要加镜像参数 :

pip install PyQt6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip install PyQt6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
标签: linux 服务器 运维

本文转载自: https://blog.csdn.net/2301_77295675/article/details/133850659
版权归原作者 怼怼老婆贴贴 所有, 如有侵权,请联系我们删除。

“Ubuntu22.04换源(自用)以及pip临时换源”的评论:

还没有评论