Erro ao tentar reinstalar o pacote

0

Eu primeiro corri sudo dpkg --remove jenkins e obtive uma resposta:

dpkg: error processing package jenkins (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
    jenkins

Então, eu tento com sudo apt-get --reinstall install jenkins e o resultado é:

    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
The following packages will be upgraded:
  jenkins
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/68.9 MB of archives.
After this operation, 895 kB of additional disk space will be used.
Selecting previously unselected package jenkins.
(Reading database ... 346826 files and directories currently installed.)
Preparing to unpack .../jenkins_2.19.1_all.deb ...
Not configured to run standalone
invoke-rc.d: initscript jenkins, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Not configured to run standalone
invoke-rc.d: initscript jenkins, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/jenkins_2.19.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Not configured to run standalone
invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/jenkins_2.19.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Alguém pode saber o que devo fazer para corrigir e atualizar o pacote?

    
por mt0s 30.10.2016 / 09:37

1 resposta

0

Você precisa adicionar --force-overwrite suffix no comando dpkg , isso substituirá o arquivo que causou o erro.

sudo dpkg -r --force-overwrite (file)

No seu caso, seria

sudo dpkg -r --force-overwrite /var/cache/apt/archives/jenkins_2.19.1_all.deb

Certifique-se de que tudo está corrigido executando:

sudo apt-get -f install
    
por Liso 30.10.2016 / 10:30