Como faço para me livrar de entradas desatualizadas do dpkg?

4

Eu vejo pacotes obsoletos anteriormente desinstalados no dpkg:

$ sudo dpkg -l *boost*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                      Version           Architecture      
+++-=========================-=================-=================
un  libboost1.42-dev          <none>            <none>

No entanto, não consigo remover a entrada.

$ sudo apt --purge remove libboost1.42-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libboost1.42-dev' is not installed, so not removed

$ sudo dpkg --purge libboost1.42-dev
dpkg: warning: ignoring request to remove libboost1.42-dev which isn't installed

Execução do apt-cache mostra:

$ sudo apt-cache policy libboost1.42-dev
libboost1.42-dev:
  Installed: (none)
  Candidate: (none)
  Version table:
    
por wsw 30.10.2015 / 05:14

1 resposta

2

O un na primeira coluna significa unknown e not installed .

Em seu caso especial , significa:

Package libboost1.42-dev is not available, but is referred to by another package

Por quê? Por isso:

$ sudo apt-get install libboost1.42-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libboost1.42-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

A solução? Não há solução, é por design ...

Iniciar um teste

$ sudo grep -r 'libboost1.42-dev' /var/lib/apt/*
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-i386_Packages:Conflicts: bjam, boost-build, libboost1.42-dev, libboost1.46-dev, libboost1.48-dev, libboost1.49-dev, libboost1.50-dev, libboost1.52-dev, libboost1.53-dev, libboost1.54-dev, libboost1.55-dev, libboost1.57-dev
/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages:Conflicts: bjam, boost-build, libboost1.42-dev, libboost1.46-dev, libboost1.48-dev, libboost1.49-dev, libboost1.50-dev, libboost1.52-dev, libboost1.53-dev, libboost1.54-dev, libboost1.55-dev, libboost1.57-dev

O "problema" está nos dois arquivos /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages e /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages

Vamos verificar um deles: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_wily_main_binary-amd64_Packages

Uma pesquisa por libboost1.42-dev nos fornece um novo pacote libboost1.58-dev . Observe a lista de pacotes conflitantes:

Package: libboost1.58-dev
Priority: optional
Section: libdevel
Installed-Size: 102966
Maintainer: Ubuntu Developers 
Original-Maintainer: Debian Boost Team 
Architecture: amd64
Source: boost1.58
Version: 1.58.0+dfsg-3.1ubuntu1
Depends: libstdc++-4.8-dev | libstdc++-dev
Suggests: libboost1.58-doc, libboost-atomic1.58-dev, libboost-chrono1.58-dev, libboost-context1.58-dev, libboost-coroutine1.58-dev, libboost-date-time1.58-dev, libboost-exception1.58-dev, libboost-filesystem1.58-dev, libboost-graph1
.58-dev, libboost-graph-parallel1.58-dev, libboost-iostreams1.58-dev, libboost-locale1.58-dev, libboost-log1.58-dev, libboost-math1.58-dev, libboost-mpi1.58-dev, libboost-mpi-python1.58-dev, libboost-program-options1.58-dev, libboos
t-python1.58-dev, libboost-random1.58-dev, libboost-regex1.58-dev, libboost-serialization1.58-dev, libboost-signals1.58-dev, libboost-system1.58-dev, libboost-test1.58-dev, libboost-thread1.58-dev, libboost-timer1.58-dev, libboost-w
ave1.58-dev, libboost1.58-tools-dev, libmpfrc++-dev, libntl-dev
Conflicts: bjam, boost-build, libboost1.42-dev, libboost1.46-dev, libboost1.48-dev, libboost1.49-dev, libboost1.50-dev, libboost1.52-dev, libboost1.53-dev, libboost1.54-dev, libboost1.55-dev, libboost1.57-dev
Filename: pool/main/b/boost1.58/libboost1.58-dev_1.58.0+dfsg-3.1ubuntu1_amd64.deb
Size: 6233784
MD5sum: 867f4210133469ec03d6cf882a9b6ad3
SHA1: 39647540966b1eea834dd86e47158e67cf0b2ed6
SHA256: bc427831ec16348cf81f0dd44c889d23d4e70c9fa0f1aadefff0fa77119875cf
Description: Boost C++ Libraries development files
Multi-Arch: same
Homepage: http://www.boost.org/
Description-md5: afccffe6a3ce49022d7832b028860029
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
Supported: 9m
Task: ubuntu-sdk-libs-dev

E esta é a solução ou uma explicação

O pacote libboost1.42-dev não está disponível, verifique a saída de apt-cache policy libboost1.42-dev , mas é referido por outro pacote, libboost1.58-dev , na lista de pacotes conflitantes e é por isso que você tem esse item na saída de sudo dpkg -l *boost* .

O pacote libboost1.58-dev está nos repositórios principais do Ubuntu e você pode remover este repositório para se livrar da saída do comando dpkg … . Mas isso é realmente uma má ideia.

    
por A.B. 30.10.2015 / 08:17

Tags