在Ubuntu 24.04中更换为清华源的步骤

在Ubuntu 24.04中更换为清华源的步骤

‌1.备份原有的源配置文件‌:

  从 Ubuntu 24.04 开始,Ubuntu 的软件源配置文件变更为 DEB822 格式,路径为 /etc/apt/sources.list.d/ubuntu.sources。

  打开终端,输入以下命令来备份原有的源配置文件:
  sudo  cp  /etc/apt/sources.list.d/ubuntu.sources   /etc/apt/sources.list.d/ubuntu.sources.bak

2.编辑源配置文件‌:

  使用vim或其他文本编辑器打开源配置文件:

  sudo vim /etc/apt/sources.list.d/ubuntu.sources

3. 添加清华源的配置‌:  

  在打开的文件中,删除原有的内容,并粘贴以下清华源的配置:

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

4. 更新源‌:  

  更新源配置并升级系统:

  sudo apt-get update
  sudo apt-get upgrade

通过以上步骤,你可以成功将Ubuntu 24.04的源更换为清华源。

posted on 2024-10-10 08:55  sdlyxyf  阅读(9117)  评论(0)    收藏  举报

导航