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

news/2024/7/9 20:40:10 标签: ubuntu, postgresql, 数据库

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

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

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。将系统自带的该文件做个备份,将该文件替换为下面内容,即可使用选择的软件源镜像。

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


http://www.niftyadmin.cn/n/5115367.html

相关文章

Elasticsearch第二篇:es之间版本比较

一、前言 在学习Elasticsearch 时候,因为各个版本的问题,搞不清,非常的头疼,官方也给出了各个版本更新的情况,不过是英文版本,版本更新信息又特别多,最近学习,看了很多资料&#xf…

喜报!湖南欧拉生态创新中心获评“国家2023年全民数字素养与技能提升月工作表现突出单位”

10月19日,以“数字赋能 全民共享”为主题的2023年湖南省全民数字素养与技能提升成果交流会在长沙举办。活动现场通报表扬了国家和我省2023年全民数字素养与技能提升月工作表现突出单位和个人。麒麟信安与湘江新区、华为公司合作共建的湖南欧拉生态创新中心获评“国家…

Elasticsearch 写入优化,从 3000 到 8000/s,让你的 ES 飞起来

背景 基于elasticsearch-5.6.0 机器配置:3个云ecs节点,16G,4核,机械硬盘 优化前,写入速度平均3000条/s,一遇到压测,写入速度骤降,甚至es直接频率gc、oom等;优化后,写入速…

Apollo与TypeScript:强大类型检查在前端开发中的应用

前言 「作者主页」:雪碧有白泡泡 「个人网站」:雪碧的个人网站 「推荐专栏」: ★java一站式服务 ★ ★ React从入门到精通★ ★前端炫酷代码分享 ★ ★ 从0到英雄,vue成神之路★ ★ uniapp-从构建到提升★ ★ 从0到英雄&#xff…

Java 通过反射修改字符串 String 类型变量的取值而不改变字符串变量的指向

注意点 由于 JDK 8 中有关反射相关的功能自从 JDK 9 开始就已经被限制了,如:通过反射修改 String 类型变量的 value 字段(final byte[]),所以要能够使用运行此方法,需要在运行项目时,添加虚拟机(VM)选项:-…

uni-app 小宠物 - 会说话的小鸟

在 template 中 <view class"container"><view class"external-shape"><view class"face-box"><view class"eye-box eye-left"><view class"eyeball-box eyeball-left"><span class"…

1978-2021年全国各省有效灌溉面积数据

1978-2021年全国各省有效灌溉面积数据 1、时间&#xff1a;1978-2021年 2、来源&#xff1a;农业统计NJ、各省NJ、国家统计J 3、指标&#xff1a;有效灌溉面积 4、范围&#xff1a;31省市 5、指标解释&#xff1a; 有效灌溉面积指具有一定的水源&#xff0c;地块比较平整…

Java 线程池调度周期性任务“异常“探究

背景 在做性能监控需求的过程中&#xff0c;会存在很多监控任务需要定时执行。比如在卡顿监控的实现中&#xff0c;我们需要每50ms 执行一次主线程调用栈的任务&#xff0c;此时由于任务本身可能存在一些耗时&#xff0c;可能需要对任务下次调度的时间做一些调整&#xff0c;避…