天天看點

Linux 安裝軟體-dkpg安裝中斷問題現象原因修複步驟

現象

Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates InRelease
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security InRelease
Hit:4 http://repo.mysql.com/apt/ubuntu bionic InRelease
Reading package lists...

err:E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.           

注:mirrors.cloud.aliyuncs.com 這個域名需要阿裡雲vpc下dns才能解析。

原因

dpkg 軟體包配置不正确,安裝被中斷。

修複步驟

注:所有操作修改前,請先備份資料,

建立快照

等。

登陸伺服器

通過

vnc

或者

Workbench

連接配接登陸到伺服器

排查中斷原因

1、手動執行 sudo dpkg --configure -a ,執行成功後,嘗試更新 sudo apt-get update

2、若依舊報錯,則删除/var/lib/dpkg/updates 下所有檔案後在嘗試更新,具體操作步驟如下:

cd /var/lib/dpkg/updates
ls -al 
mv /var/lib/dpkg/updates /tmp/
sudo apt-get update
sudo apt-get upgrade           

由于安裝被中斷的原因各種各樣,可以借鑒

連結内容

排查的過程,進行分析

繼續閱讀