ubuntu22.04笔记: 更换为阿里源

没有按照LTS 版本 会遇到下面问题:

参考:https://zhuanlan.zhihu.com/p/691625646

Ubuntu 22.04代号为:jammy

Ubuntu 20.04代号为:focal

Ubuntu 19.04代号为:disco

Ubuntu 18.04代号为:bionic

Ubuntu 17.04代号为:zesty

Ubuntu 16.04代号为:xenial

查询 LTS 版本:

root@user-virtual-machine:~# lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 22.04.4 LTS

Release: 22.04

Codename: jammy

root@user-virtual-machine:~#

修改sources.list文件

sudo gedit /etc/apt/sources.list

在Ubuntu 22.04中使用国内源可以提高软件包下载和更新的速度。以下是如何设置国内源的步骤:

备份原有的sources.list文件:

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

编辑sources.list文件:

sudo nano /etc/apt/sources.list

替换文件内容为国内源。以阿里云源为例,你可以将文件内容替换为以下内容:

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-backports main restricted universe multiverse

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

保存并关闭文件。

更新软件源:

sudo apt update

升级所有安装的包:

sudo apt upgrade

相关推荐
鄭郑40 分钟前
STM32学习笔记--I2C封装与OLED(2026.2.1)
笔记·stm32·学习
酒鼎2 小时前
学习笔记(4)HTML5新特性(第3章)- WebSocket
笔记·学习·html5
郝亚军2 小时前
ubuntu-18.04.6-desktop-amd64安装步骤
linux·运维·ubuntu
-Springer-2 小时前
STM32 学习 —— 个人学习笔记2-2(新建工程)
笔记·stm32·学习
tb_first3 小时前
万字超详细苍穹外卖学习笔记4
java·spring boot·笔记·学习·spring·mybatis
日更嵌入式的打工仔3 小时前
C内存布局
笔记
卡布叻_星星3 小时前
达梦数据库笔记之使用教程以及不推荐迁移选择小写
笔记
山岚的运维笔记3 小时前
SQL Server笔记 -- 第15章:INSERT INTO
java·数据库·笔记·sql·microsoft·sqlserver
孞㐑¥3 小时前
算法—队列+宽搜(bfs)+堆
开发语言·c++·经验分享·笔记·算法
charlie1145141913 小时前
嵌入式C++教程——ETL(Embedded Template Library)
开发语言·c++·笔记·学习·嵌入式·etl