深度阅读

How to set up a third-party mirror on Ubuntu

作者
作者
2023年08月22日
更新时间
14.2 分钟
阅读时间
0
阅读量

To set up a third-party mirror on Ubuntu, you can follow these steps:

  1. Open a terminal window.
  2. Back up your original sources.list file by executing the following command:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
  1. Edit the sources.list file by running the following command:
sudo nano /etc/apt/sources.list
  1. Delete the original contents of the file and add the following lines:
deb https://<mirror_url> <distribution> main restricted universe multiverse
deb https://<mirror_url> <distribution>-updates main restricted universe multiverse
deb https://<mirror_url> <distribution>-backports main restricted universe multiverse
deb https://<mirror_url> <distribution>-security main restricted universe multiverse

Replace <mirror_url> with the URL of the mirror you want to use, and <distribution> with the codename of the Ubuntu release you are using (such as xenial, bionic, focal, etc.).

  1. Save the file and exit the editor.
  2. Run the following commands to update the package list and upgrade your system:
sudo apt-get update
sudo apt-get upgrade

Your Ubuntu system will now use the third-party mirror you specified for package downloads and updates.

Please note that different mirrors may require different configurations and authentication methods. Please refer to the documentation of the mirror you are using for more information.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。