Como posso remover à força um pacote do Ubuntu manualmente?

2

Eu postei isso no ServerFault e recebi algumas perguntas úteis, mas nenhuma resposta em termos do que posso fazer. O que, em um nível baixo, posso fazer para exorcizar completamente um pacote que está sobrecarregando as atualizações do aptitude?

-

Eu tenho um pacote libssl-dev instalado, possivelmente porque não tenho certeza se ignorei o gerenciador de pacotes e ele é visível no gerenciador de pacotes, mas não desaparece.

root@li393-189:/home/jonathan/python-amazon-product-api-0.2.5# aptitude purge l
ibssl-dev
The following packages will be REMOVED:  
  libssl-dev{p} 
The following partially installed packages will be configured:
  apt 
0 packages upgraded, 0 newly installed, 1 to remove and 84 not upgraded.
Need to get 0 B of archives. After unpacking 4,929 kB will be freed.
Do you want to continue? [Y/n/?] Y
Setting up apt (0.8.16~exp12ubuntu10.10) ...
gpg: Invalid option "--primary-keyring"
gpg: [don't know]: invalid packet (ctb=03)
gpg: read_keyblock: read error: invalid packet
gpg: enum_keyblocks(read) failed: invalid keyring
gpg: WARNING: nothing exported
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up apt (0.8.16~exp12ubuntu10.10) ...
gpg: Invalid option "--primary-keyring"
gpg: [don't know]: invalid packet (ctb=03)
gpg: read_keyblock: read error: invalid packet
gpg: enum_keyblocks(read) failed: invalid keyring
gpg: WARNING: nothing exported
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 apt

Eu quero que o libssl-dev instalado atualmente seja substituído por uma nova instalação de pacote. Nenhuma configuração de aptidão que eu já tenha visto irá removê-lo.

Como posso remover o pacote existente para poder reinstalá-lo do zero?

- EDITAR

@Brigo, eu tentei com o aptitude em vez de apenas o apt-get, mas o apt-get dá o que me parece um equivalente aparente:

root@li393-189:/home/jonathan/python-amazon-product-api-0.2.5# apt-get remove lI want the presently installed libssl-dev to be replaced with a fresh package installation. No configuration of aptitude I've seen yet will remove it.

How can I remove the existing package to be able to reinstall it from scratch?

--EDIT--

@Brigo, I had tried with aptitude rather than just apt-get, but apt-get gives what looks to me like an apparent equivalent:

root@li393-189:/home/jonathan/python-amazon-product-api-0.2.5# apt-get remove l
ibssl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libssl-dev
0 upgraded, 0 newly installed, 1 to remove and 84 not upgraded.
1 not fully installed or removed.
After this operation, 4,929 kB disk space will be freed.
Do you want to continue [Y/n]? Y
Setting up apt (0.8.16~exp12ubuntu10.10) ...
gpg: gpg: Invalid option "--primary-keyring"
[don't know]: invalid packet (ctb=03)
gpg: read_keyblock: read error: invalid packet
gpg: enum_keyblocks(read) failed: invalid keyring
gpg: WARNING: nothing exported
dpkg: error processing apt (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@li393-189:/home/jonathan/python-amazon-product-api-0.2.5# 

- EDITAR

Aqui está a saída para o sh -x /usr/bin/apt-key update sugerido.

root @ li393-189: ~ # sh -x / usr / bin / atualização do apt-key + set -e + não configurado GREP_OPTIONS + mktemp + SECRETKEYRING = / tmp / tmp.yKRn2OqlH3 + armadilha rm -f '/tmp/tmp.yKRn2OqlH3' 0 HUP INT SAIR ILL ABRT FPE SEGV TUBO PRAZO + GPG_CMD = gpg --ignore-time-conflict --no-options --no-chaveiro-padrão --secret-keyring /tmp/tmp.yKRn2OqlH3 + id -u + [0-eq 0] + GPG_CMD = gpg --ignore-time-conflict --no-options --no-chaveiro-padrão --secret-keyring /tmp/tmp.yKRn2OqlH3 --trustdb-name /etc/apt/trustdb.gpg + GPG = gpg --ignore-time-conflict --no-options --no-chave-padrão -secret-keyring /tmp/tmp.yKRn2OqlH3 --trustdb-name /etc/apt/trustdb.gpg + MASTER_KEYRING = / usr / share / keyrings / ubuntu-master-keyring.gpg + ARCHIVE_KEYRING = / usr / share / keyrings / ubuntu-archive-keyring.gpg + REMOVED_KEYS = / usr / share / keyrings / ubuntu-archive-removed-keys.gpg + ARCHIVE_KEYRING_URI = http: //archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg + TMP_KEYRING = / var / lib / apt / keyrings / talvez-import-keyring.gpg + [update = --keyring] + TRUSTEDFILE = / etc / apt / trusted.gpg + shell apt-config TRUSTEDFILE Apt :: GPGV :: TrustedKeyring + eval + shell do apt-config TRUSTEDFILE Dir :: Etc :: Trusted / f + eval TRUSTEDFILE = '/ etc / apt / trusted.gpg' + TRUSTEDFILE = / etc / apt / trusted.gpg + [-r /etc/apt/trusted.gpg] + GPG = gpg --ignore-time-conflict --no-options --no-chave-de-chave-padrão --secret-keyring /tmp/tmp.yKRn2OqlH3 --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg + GPG = gpg --ignore-time-conflict --no-options --no-chave-de-chave-padrão --secret-keyring /tmp/tmp.yKRn2OqlH3 --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg - chaveiro principal /etc/apt/trusted.gpg + TRUSTEDPARTS = / etc / apt / trusted.gpg.d + shell apt-config TRUSTEDPARTS Dir :: Etc :: TrustedParts / d + eval TRUSTEDPARTS = '/ etc / apt / trusted.gpg.d /' + TRUSTEDPARTS = / etc / apt / trusted.gpg.d / + [-d /etc/apt/trusted.gpg.d/] + run-parts --list /etc/apt/trusted.gpg.d/ --regex ^. * \. gpg $ + comando = atualização + [-z update] + shift + [atualização! = ajuda] + qual gpg + atualização + [! -f /usr/share/keyrings/ubuntu-archive-keyring.gpg] + requires_root + id -u + [0 -ne 0] + gpg --ignore-time-conflict --no-options + --no-chave-padrão-chave -secret-keyring /tmp/tmp.yKRn2OqlH3gpg --trustdb-name /etc/apt/trustdb.gpg --ignore-time -conflict --no-options --no-keyring padrão --quiet --batch --secret-keyring /tmp/tmp.yKRn2OqlH3 --keyring --trustdb-name /etc/apt/trustdb.gpg / usr / compartilhar / chaveiros / ubuntu-archive-keyring.gpg --keyring /etc/apt/trusted.gpg --export - chaveiroprincipal /etc/apt/trusted.gpg  --importar gpg: opção inválida "- chaveiro principal" gpg: [não sabe]: pacote inválido (ctb = 03) gpg: read_keyblock: erro de leitura: pacote inválido gpg: enum_keyblocks (read) falhou: chaveiro inválido gpg: AVISO: nada exportado + rm -f /tmp/tmp.yKRn2OqlH3
    
por JonathanHayward 23.04.2013 / 12:42

1 resposta

6

Encontrado este método no SuperUser:

 sudo dpkg --remove --force-remove-reinstreq libssl-dev
    
por 23.04.2013 / 13:33