![Como retomar ou abandonar um apt-get dist-upgrade após a redefinição da conexão?](https://rvso.com/image/1475791/Como%20retomar%20ou%20abandonar%20um%20apt-get%20dist-upgrade%20ap%C3%B3s%20a%20redefini%C3%A7%C3%A3o%20da%20conex%C3%A3o%3F.png)
No meio de um "sudo apt-get dist-upgrade" no meu Raspberry Pi, enquanto aguardava a entrada do usuário, minha conexão ssh foi redefinida. Eu não estava correndo em uma tela. As últimas linhas ficaram assim:
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" ainda mostra o antigo processo do apt-get em execução...
$ 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
Eu tenho 1.1G em /var/cache/apt/archives e não consigo tentar uma nova tentativa de 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?
O que eu deveria fazer agora? Alguma maneira de retomar o dist-upgrade em andamento? Se não, qual é uma boa maneira de voltar atrás e tentar novamente?
Responder1
Você pode kill
apt-get e simplesmente executá-lo novamente após executar dpkg --configure --pending
para configurar pacotes já instalados anteriormente.
Se você não conseguir continuar porque o sistema está quebrado, você pode tentar consertar com o apt-get:
apt-get --fix-broken install
Veja uma pergunta semelhante em Unix e Linux,https://unix.stackexchange.com/questions/46534/how-to-safely-resume-an-aptitude-dist-upgrade-after-ssh-timeout.