Как возобновить или отменить apt-get dist-upgrade после сброса соединения?

Как возобновить или отменить apt-get dist-upgrade после сброса соединения?

В середине "sudo apt-get dist-upgrade" на моем Raspberry Pi, во время ожидания ввода данных пользователем, мое ssh-соединение было сброшено. Я не работал в screen. Последние несколько строк выглядели так:

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

У меня 1,1 ГБ в /var/cache/apt/archives, и я не могу успешно попробовать выполнить новую команду 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.

Связанный контент