配置鏡像源的主要作用是優化軟件下載速度、提升系統更新穩定性,并確保軟件包獲取的可靠性
我這里配置阿里云鏡像源
鏡像的具體內容參考此文:
文章鏈接
以防萬一,先備份一下
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
然后開始修改
sudo nano /etc/apt/sources.list
將里面原有的加#全部注釋掉
并復制黏貼參考博文里的鏡像內容,我的ubuntu是18.04,對應的鏡像是
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后退出保存
測試一下有無生效
#更新軟件列表:
sudo apt update
#檢查軟件源:
apt policy curl
配置成功