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

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你可以按照以下步骤在 Ubuntu 22.04更换阿里来安装软件: 1. 打开终端(Ctrl + Alt + T)。 2. 备份系统默认的软件列表文件: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup ``` 3. 编辑软件列表文件: ``` sudo nano /etc/apt/sources.list ``` 4. 将原来的内容替换为以下阿里的内容: ``` deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse ## Not recommended # deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse # deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse ``` 5. 按 Ctrl + X 组合键保存并退出编辑器。确认保存时选择 "Y"。 6. 更新软件包列表: ``` sudo apt update ``` 现在,你的 Ubuntu 22.04 系统已经切换为阿里,你可以使用 `apt` 命令或其他包管理工具安装软件了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值