接続をリセットした後、apt-get dist-upgrade を再開または中止するにはどうすればよいですか?

接続をリセットした後、apt-get dist-upgrade を再開または中止するにはどうすればよいですか?

Raspberry Pi で「sudo apt-get dist-upgrade」を実行中に、ユーザー入力を待っている間に、ssh 接続がリセットされました。画面では実行されていませんでした。最後の数行は次のようになりました。

Installing new version of config file /etc/init.d/procps ...

Configuration file '/etc/sysctl.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** sysctl.conf (Y/I/N/O/D/Z) [default=N] ? Connection reset by <ip>

「ps」では、古い apt-get プロセスがまだ実行中であることが示されています...

$ ps -aux | grep apt
root      2375  0.0  0.3   6008  1636 ?        S    03:03   0:00 sudo apt-get dist-upgrade
root      2376  0.0  6.2  33428 27872 ?        S    03:03   0:18 apt-get dist-upgrade

/var/cache/apt/archives に 1.1G ありますが、apt-get dist-upgrade を新たに実行してもうまくいきません。

$ sudo apt-get dist-upgrade
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

今何をすべきでしょうか? 進行中の dist-upgrade を再開する方法はありますか? そうでない場合、元に戻して再試行する良い方法は何ですか?

答え1

killapt-get を実行し、実行後に再度実行するだけでdpkg --configure --pending、以前にインストールされたパッケージを設定できます。

システムが壊れているために続行できない場合は、apt-get を使用して修復を試みることができます。 apt-get --fix-broken install

Unix & Linuxの同様の質問を参照してください。https://unix.stackexchange.com/questions/46534/how-to-safely-resume-an-aptitude-dist-upgrade-after-ssh-timeout

関連情報