ubuntu22.04 更换国内源

ubuntu22.04 更换国内源

备份原有源文件

在修改源之前,最好先备份一下原来的源文件,以防出现问题可以恢复。

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

选择国内源并修改源文件

阿里云

打开 /etc/apt/sources.list 文件进行编辑,可以使用 nanovim 等文本编辑器。

sudo vim /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

清华源

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-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-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

更新源

保存修改后的源文件后,更新源以使其生效:

sudo apt update

ubuntu22.04 切换系统语言

安装英文语言包(英语为例)

$ sudo apt install language-pack-en

设置系统语言环境变量

使用 update-locale 命令来设置系统的本地化信息

$ sudo update-locale LANG=en_US.UTF-8

注销并重新登录以使更改生效。

posted @ 2024-10-23 00:30  Jacob-Chen  阅读(6958)  评论(0)    收藏  举报