Ubuntu24.04常见问题

发布于:2025-06-12 ⋅ 阅读:(16) ⋅ 点赞:(0)

换源

Ubuntu24.04不再使用sources.list作为源的路径,而是换成同文件夹所属子文件夹sources.list.d中的ubuntu.souces作为源的路径,输入 sudo nano /etc/apt/sources.list.d/ubuntu.sources进入该文件编辑,清除所有数据(记得先做好备份)然后把下方的ustc源粘贴进去:

Types: deb
URIs: https://mirrors.ustc.edu.cn/ubuntu/
Suites: noble noble-updates noble-backports noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

更多:https://blog.csdn.net/Zzp750/article/details/145771731

使用apt-fast 替换apt
安装编译工具和依赖:

sudo apt update
sudo apt install build-essential git

克隆 apt-fast 的 Git 仓库:

git clone https://github.com/ilikenwf/apt-fast.git
cd apt-fast

编译并安装:

sudo make install

使用 apt-fast

安装完成后,你可以通过以下方式使用 apt-fast 替代 apt 或 apt-get:

sudo apt-fast update
sudo apt-fast install package_name

更换ppa源

修改ppa:
在这里插入图片描述

点添加,输入 deb https://launchpad.proxy.ustclug.org/graphics-drivers/ppa/ubuntu/ noble main

换完发现没有公钥,keyserver.ubuntu.com 是一个常用的 GPG 密钥服务器,国内可能访问不上,使用pgpkeys.mit.edu替代:

gpg --keyserver pgpkeys.mit.edu --recv-key FCAE110B1118213C
gpg -a --export FCAE110B1118213C | sudo apt-key add -

或者专用密钥环文件(推荐):

sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/graphics-drivers.gpg --keyserver pgpkeys.mit.edu --recv-keys FCAE110B1118213C

若报密钥存储在过时的 trusted.gpg 密钥环中(/etc/apt/trusted.gpg)
把/etc/apt/trusted.gpg复制到 trusted.gpd.d 目录中(快速而不优雅的方法)

sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d