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
復(fù)制代碼
2.更新軟件列表
運(yùn)行如下命令:
這個(gè)命令,會(huì)訪問(wèn)源列表里的每個(gè)網(wǎng)址,并讀取軟件列表,然后保存在本地電腦。軟件包管理器里看到的軟件列表,都是通過(guò)update命令更新的。
3.更新本地軟件包
運(yùn)行如下命令:
這個(gè)命令,會(huì)把本地已安裝的軟件,與剛下載的軟件列表里對(duì)應(yīng)軟件進(jìn)行對(duì)比,如果發(fā)現(xiàn)已安裝的軟件版本太低,就會(huì)提示你更新。
在執(zhí)行這個(gè)命令的時(shí)候我收到以下錯(cuò)誤提示,沒(méi)有請(qǐng)忽略
- 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?
復(fù)制代碼 刪除鎖定文件就可以sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
輸入Yes開始更新本地列表,注意如果沒(méi)出現(xiàn) 0added,0 remove,done. 升級(jí)了 0 個(gè)軟件包,新安裝了 0 個(gè)軟件包,要卸載 0 個(gè)軟件包,有 0 個(gè)軟件包未被升級(jí)。 那就再執(zhí)行一次 sudo apt-get upgrade |