![接続をリセットした後、apt-get dist-upgrade を再開または中止するにはどうすればよいですか?](https://rvso.com/image/1475791/%E6%8E%A5%E7%B6%9A%E3%82%92%E3%83%AA%E3%82%BB%E3%83%83%E3%83%88%E3%81%97%E3%81%9F%E5%BE%8C%E3%80%81apt-get%20dist-upgrade%20%E3%82%92%E5%86%8D%E9%96%8B%E3%81%BE%E3%81%9F%E3%81%AF%E4%B8%AD%E6%AD%A2%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F.png)
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
kill
apt-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。