- 备份原有源文件:
powershell
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2、编辑源文件: 使用文本编辑器打开源文件:
powershell
sudo nano /etc/apt/sources.list
3、替换源: 将文件内容替换为新的源,例如使用官方国内源:
powershell
deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
保存。