Why I can't install anything in Ubuntu 18.04 LTS?

7,971

A simple reconfigure of the Package Database might work:

sudo dpkg --configure -a

sudo apt-get install -f

If you still have problems provide the contents of "/var/lib/dpkg/status"

Share:
7,971

Related videos on Youtube

J-Mello
Author by

J-Mello

Updated on September 18, 2022

Comments

  • J-Mello
    J-Mello over 1 year

    Suddenly,Ubuntu had been getting an error:

    E: Sub-process dpkg --set-selections returned an error code (2)
    E: couldn't clean the currently selected dpkg state
    

    I can't fix this issue with sudo apt --fix-broken install cause the system get the same issue.Someone can help me please? I need to upgrade and install some softwares!

    Here is the complete output:

    > ****@****:~$ sudo apt --fix-broken install
    Lendo listas de pacotes... Pronto
    Construindo árvore de dependências       
    Lendo informação de estado... Pronto
    Corrigindo dependências... Pronto
    Os seguintes pacotes foram instalados automaticamente e já não são necessários:
      libnvidia-cfg1-390 libnvidia-common-390 libnvidia-compute-390:i386
      libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390
      libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386
      libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390
      libnvidia-ifr1-390:i386 linux-image-4.15.0-39-generic
      linux-modules-4.15.0-39-generic xserver-xorg-video-nvidia-390
    Utilize 'sudo apt autoremove' para os remover.
    The following additional packages will be installed:
      libnvidia-cfg1-390 libnvidia-compute-390 libnvidia-compute-390:i386
      libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390
      libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386
      libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390
      libnvidia-ifr1-390:i386 xserver-xorg-video-nvidia-390
    Os pacotes a seguir serão REMOVIDOS:
      nvidia-390 nvidia-driver-390
    Os pacotes a seguir serão atualizados:
      libnvidia-cfg1-390 libnvidia-compute-390 libnvidia-compute-390:i386
      libnvidia-decode-390 libnvidia-decode-390:i386 libnvidia-encode-390
      libnvidia-encode-390:i386 libnvidia-fbc1-390 libnvidia-fbc1-390:i386
      libnvidia-gl-390 libnvidia-gl-390:i386 libnvidia-ifr1-390
      libnvidia-ifr1-390:i386 xserver-xorg-video-nvidia-390
    14 pacotes atualizados, 0 pacotes novos instalados, 2 a serem removidos e 329 não atualizados.
    É preciso baixar 0 B/75,1 MB de arquivos.
    Depois desta operação, 1.102 kB de espaço em disco serão liberados.
    Você quer continuar? [S/n] S
    dpkg: erro: a interpretar o ficheiro '/var/lib/dpkg/status' perto da linha 49469 pacote 'bc':
     valor duplicado para o campo 'Status'
    E: Sub-processo dpkg --set-selections retornou um código de erro (2)
    E: Couldn't clean the currently selected dpkg states
    
  • J-Mello
    J-Mello about 5 years
    Hi @Sarriman ! Thanks for your tips but these commands didn't works. dpkg gives me an error about /var/lib/dpkg/status duplicated status in bc package.How to fix this?
  • Sarriman
    Sarriman about 5 years
    Try removing bc package
  • J-Mello
    J-Mello about 5 years
    It has a lot of "bc" in status.It is really insane to find the issue.Maybe if I replace status might be solve, but I don't know yet what am I doing...
  • Sarriman
    Sarriman about 5 years
    Can you provide us the info in /var/lib/dpkg/status?
  • J-Mello
    J-Mello about 5 years
    Thank you very much! This works! After erase package bc that contains NVIDIA and then applying the commands that you suggested it works!Now I'm able to install softwares and updates! I just don't know why I can't upvote your answer in stack exchange's app...
  • Sarriman
    Sarriman about 5 years
    @J-Mello Great! Be sure to approve the answer, so others can know!
  • J-Mello
    J-Mello about 5 years
    Answer approved!