
我正在使用 do-release-upgrade 從 18.04 升級到 20.04。
在此過程中,它發現了我的 ssh_config 的修改,我選擇查看差異。
它將在頁面<OK>
底部顯示此內容。但我無法退出繼續升級。終端機正在讀取我的鍵盤輸入。螢幕現在看起來像這樣:
您可以看到我恢復升級的一些嘗試(例如重新運行do-release-upgrade
、嘗試apt update
和apt upgrade
)
如何恢復升級?
更新,1小時後
深入挖掘會發現哪些進程擁有各種鎖定文件,以及一些仍在運行的有趣進程,可能正在等待我<OK>
在螢幕上回复,顯示 ssh_config 差異:
matt@ocinara:~$ sudo lsof /var/lib/dpkg/lock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1001/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dpkg 16341 root 3uW REG 259,3 0 13658619 /var/lib/dpkg/lock
matt@ocinara:~$ sudo lsof /var/lib/apt/lists/lock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1001/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
focal 14627 root 14u REG 259,3 0 13902278 /var/lib/apt/lists/lock
matt@ocinara:~$ sudo lsof /var/cache/apt/archives/lock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1001/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
focal 14627 root 66u REG 259,3 0 12328392 /var/cache/apt/archives/lock
matt@ocinara:~$ ps aux | grep -i focal
root 14627 0.2 1.7 480372 140020 pts/0 S 11:00 0:09 /usr/bin/python3 /tmp/ubuntu-release-upgrader-qzt422az/focal --mode=server --frontend=DistUpgradeViewText
matt 19736 0.0 0.0 10964 780 pts/3 S+ 12:00 0:00 grep --color=auto -i focal
matt@ocinara:~$ ps aux | grep -i dpkg
root 16341 0.0 0.1 22216 12776 pts/7 Ss+ 11:01 0:00 /usr/bin/dpkg --force-overwrite --status-fd 74 --configure --pending
root 17176 0.0 0.3 85264 24040 pts/7 S+ 11:01 0:00 /usr/bin/perl -w /usr/share/debconf/frontend /var/lib/dpkg/info/openssh-server.postinst configure 1:7.6p1-4ubuntu0.3
root 17188 0.0 0.0 2604 1684 pts/7 S+ 11:01 0:00 /bin/sh /var/lib/dpkg/info/openssh-server.postinst configure 1:7.6p1-4ubuntu0.3
matt 19741 0.0 0.0 10964 776 pts/3 S+ 12:01 0:00 grep --color=auto -i dpkg
答案1
經過更多閱讀後,我再次運行升級,如下所示:
sudo kill 14627 # focal upgrade process - see question
這也導致dpkg
進程(請參閱原始問題)終止,並且檔案鎖被釋放。然後我嘗試了
sudo apt dist-upgrade
……這告訴我首先要做到這一點:
sudo dpkg --configure -a
這立即導致回到有關 ssh_config 的問題,即回到升級停止時的位置(我懷疑我無意中按下了 Ctrl-C)。
最後(手指交叉):
sudo apt dist-upgrade
當我寫這篇文章時,我現在已經完成了 15% 的升級。我稍後會更新這個答案,希望是從 Ubuntu 20.04 開始!
更新它有效 - 我現在使用的是 Ubuntu 20.04