Como recuperar um sistema ubuntu completamente bagunçado

5

Eu tenho um sistema a cerca de 3.000 km de distância, então não tenho acesso a ele. A máquina está executando o Ubuntu 13.04 (sim, é o EOL passado há muito tempo), e o módulo python está completamente confuso. Quando eu tentei usar fazer-release-upgrade para atualizá-lo para 13.10 e depois 14.04 (como explicado aqui ) Eu recebi esta mensagem de erro:

Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 8, in <module>
    from DistUpgrade.DistUpgradeVersion import VERSION
ImportError: No module named DistUpgrade.DistUpgradeVersion

Até o UFW parou de funcionar. mostrou este erro:

Traceback (most recent call last):
  File "/usr/sbin/ufw", line 26, in <module>
    import ufw.frontend
ImportError: No module named ufw.frontend

Então eu pensei que posso reinstalar o python, e a vida é boa. Tentar reinstalar python não funcionou, então achei que poderia desinstalar o python e reinstalá-lo, o que também se tornou um movimento muito estúpido! agora meu pacote python é reportado como expurgo, tentando fazer qualquer coisa com o dpkg ou o apt-get gera um milhão de erros e então sai, e quase nenhuma das ferramentas funciona!

Eu não me importo de atualizar ou instalar uma nova cópia do Ubuntu (que eu acho que tenho que fazer de qualquer maneira), mas eu não consigo encontrar qualquer pista de como eu posso fazer isso através da rede? É mesmo possível?

Editar 1:

Por exemplo, quando tento executar sudo dpkg --configure -a para corrigir os problemas do instalador, recebo uma saída como esta:

dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-gtk:
 ubuntu-release-upgrader-gtk depends on update-manager; however:
  Package update-manager is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-distupgrade (= 1:0.192.13); however:
  Package python3-distupgrade is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-dbus; however:
  Package python3-dbus is not configured yet.
 ubuntu-release-upgrader-gtk depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing ubuntu-release-upgrader-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport-gtk:
 apport-gtk depends on python3-apport (>= 2.9.2-0ubuntu8.5); however:
  Package python3-apport is not configured yet.
 apport-gtk depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing apport-gtk (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-debian:
 python3-debian depends on python3-chardet; however:
  Package python3-chardet is not configured yet.
 python3-debian depends on python3-six; however:
  Package python3-six is not configured yet.

dpkg: error processing python3-debian (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-manager-core:
 update-manager-core depends on python3-update-manager (= 1:0.186.2); however:
  Package python3-update-manager is not configured yet.

dpkg: error processing update-manager-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of update-notifier:
 update-notifier depends on update-manager-gnome | update-manager (>= 1:0.165); however:
  Package update-manager-gnome is not installed.
  Package update-manager is not configured yet.
 update-notifier depends on ubuntu-release-upgrader-gtk; however:
  Package ubuntu-release-upgrader-gtk is not configured yet.

dpkg: error processing update-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-release-upgrader-core:
 ubuntu-release-upgrader-core depends on python3-distupgrade (= 1:0.192.13); however:
  Package python3-distupgrade is not configured yet.

dpkg: error processing ubuntu-release-upgrader-core (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of aptdaemon:
 aptdaemon depends on python3-aptdaemon (= 1.0-0ubuntu9); however:
  Package python3-aptdaemon is not configured yet.
 aptdaemon depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing aptdaemon (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-gi-cairo:
 python3-gi-cairo depends on python3-gi (= 3.8.0-2); however:
  Package python3-gi is not configured yet.
 python3-gi-cairo depends on python3-cairo (>= 1.10.0+dfsg-3~exp2); however:
  Package python3-cairo is not configured yet.

dpkg: error processing python3-gi-cairo (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of friends:
 friends depends on friends-dispatcher; however:
  Package friends-dispatcher is not configured yet.

dpkg: error processing friends (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of apport:
 apport depends on python3-apport (>= 2.9.2-0ubuntu8.5); however:
  Package python3-apport is not configured yet.
 apport depends on python3-gi; however:
  Package python3-gi is not configured yet.

dpkg: error processing apport (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ubuntu-release-upgrader-gtk
 apport-gtk
 python3-debian
 update-manager-core
 update-notifier
 ubuntu-release-upgrader-core
 aptdaemon
 python3-gi-cairo
 friends
 apport

Ou tentar executar sudo apt-get install -f gera muitos erros e pára assim:

dpkg: error processing friends-twitter (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent configuration of python3-aptdaemon.pkcompat:
 python3-aptdaemon.pkcompat depends on python3-aptdaemon (= 1.0-0ubuntu9); however:
  Package python3-aptdaemon is not configured yet.

dpkg: error processing python3-aptdaemon.pkcompat (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: too many errors, stopping
Errors were encountered while processing:
 python3-dbus
 language-selector-common
 python3-gi
 python3-xkit
 ubuntu-drivers-common
 python3-commandnotfound
 ufw
 apparmor-utils
 python3-problem-report
 python3-apport
 apport
 apport-gtk
 python3-software-properties
 software-properties-common
 python3-defer

Obrigado

    
por Mohammad Hashemian 25.12.2014 / 00:30

1 resposta

2

Bem, acabei criando uma instância do AWS com base no Ubuntu 13.04 e depois movi todos os pacotes do python do EC2 para o meu servidor. Isso não corrigiu o problema com o apt-get e o dpkg, mas permitiu que eu executasse outros comandos baseados em python (por exemplo, ufw e do-release-upgrade).

Então eu usei-release-upgrade para mudar para Saucy e depois Trusty. Ocorreram alguns erros durante a atualização, mas no geral foram atualizados para 14.04 com êxito.

Após a atualização, executei apt-get install -f e dpkg --configure -a novamente, e desta vez recebi muito menos erros, embora ainda falhe. Eu corri os erros um por um, novamente pegando emprestado os pacotes quebrados de outro servidor rodando 14.04.

No final, migrou para o 14.04 e todos os pacotes foram corrigidos também.

    
por Mohammad Hashemian 27.12.2014 / 18:05