1.使用命令 sudo vim /etc/apt/sources.list 編輯源列表中的源地址信息,將其中的地址全部刪除或者注釋,換成以下下格式
- deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
- deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
- deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multivers
復制代碼
2.更新軟件列表
運行如下命令:
這個命令,會訪問源列表里的每個網址,并讀取軟件列表,然后保存在本地電腦。軟件包管理器里看到的軟件列表,都是通過update命令更新的。
3.更新本地軟件包
運行如下命令:
這個命令,會把本地已安裝的軟件,與剛下載的軟件列表里對應軟件進行對比,如果發現已安裝的軟件版本太低,就會提示你更新。
在執行這個命令的時候我收到以下錯誤提示,沒有請忽略
- E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unavailable)
- E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is an other process using it?
復制代碼 刪除鎖定文件就可以sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
輸入Yes開始更新本地列表,注意如果沒出現 0added,0 remove,done. 升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 0 個軟件包,有 0 個軟件包未被升級。 那就再執行一次 sudo apt-get upgrade |