ubuntu 22.04 设置 apt 代理 配置 清华源

如果没有代理配置文件就创建一个
sudo touch /etc/apt/apt.conf.d/proxy.conf

编辑配置
sudo vim /etc/apt/apt.conf.d/proxy.conf

python 复制代码
Acquire::http::Proxy "http://[username]:[password]@ [proxy-web-or-IP-address]:[port-number]";
Acquire::https::Proxy "http://[username]:[password]@ [proxy-web-or-IP-address]:[port-number]";

输入 sudo apt update 测试

参考
https://linuxiac.com/how-to-use-apt-with-proxy/
https://phoenixnap.com/kb/ubuntu-proxy-settings

设置清华源

Ubuntu 的软件源配置文件是 /etc/apt/sources.list。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用选择的软件源镜像。

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

参考
https://zhuanlan.zhihu.com/p/251009600
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

相关推荐
2301_783848653 分钟前
Go 中实现高效图最大团划分的实践与边界分析
jvm·数据库·python
2401_884454154 分钟前
C#怎么实现Socket心跳包 C#如何在TCP Socket通信中设计心跳机制检测连接状态【网络】
jvm·数据库·python
Jetev16 分钟前
不同品牌SSD对HTML函数工具加载速度影响大吗_存储测试汇总【汇总】
jvm·数据库·python
SelectDB技术团队17 分钟前
时间序列近邻关联性能实测:Doris ASOF JOIN 领先 ClickHouse、DuckDB
数据库·人工智能·selectdb
Traving Yu35 分钟前
向量数据库Milvus
数据库·人工智能·milvus
2501_9010064739 分钟前
golang如何使用DTM分布式事务框架_golang DTM分布式事务框架使用方法
jvm·数据库·python
2501_9012005344 分钟前
Golang如何做Clean Architecture_Golang整洁架构教程【详解】
jvm·数据库·python
咖啡里的茶i44 分钟前
实验三 数据完整性实验
数据库·oracle
韶博雅44 分钟前
oracle + parfile(数据泵)
数据库·oracle
weixin_459753941 小时前
Go 中嵌入类型字段在派生结构体字面量中的初始化规则详解
jvm·数据库·python