não pode remover o python 3.3.3

0

sudo apt-get install python-apt

erro de retorno:

python-apt : Depends: python (<2.8) but 3.3.3-1 is to be installed

Eu removi o python3 da máquina usando o apt-get

Quando eu corro:

dpkg-query --list

Eu recebo o seguinte para python:

ri python 3.3.3-1 python-3.3.3
ii python2.7 2.7.3-0ubuntu3

mas executando python --version

Python 2.7.3

Como posso remover qualquer uma das referências / pacotes do python 3.3.3-1 do meu sistema?

 apt-cache policy python python2 python3
python:
  Installed: 3.3.3-1
  Candidate: 3.3.3-1
  Version table:
 *** 3.3.3-1 0
        100 /var/lib/dpkg/status
     2.7.3-0ubuntu2.2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     2.7.3-0ubuntu2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
python3:
  Installed: (none)
  Candidate: 3.2.3-0ubuntu1.2
  Version table:
     3.2.3-0ubuntu1.2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
     3.2.3-0ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
N: Unable to locate package python2

Após o comentário do Byte Commander:

 apt-cache policy python
python:
  Installed: 2.7.3-0ubuntu2.2
  Candidate: 2.7.3-0ubuntu2.2
  Version table:
 *** 2.7.3-0ubuntu2.2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.7.3-0ubuntu2 0
    500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
    
por Alex 08.04.2017 / 13:02

1 resposta

1

Ok, então, por qualquer motivo, você tem um pacote python em seu cache de pacotes local que fornece o Python 3, embora deva ser o Python 2.

Se você não tiver estragado muito ainda e apt-get ainda funcionar, tente executar isto:

sudo apt-get install python=2.7.3-0ubuntu2.2 python3 

e remova seus pacotes em cache com

sudo apt-get clean

depois.

Depois que tudo foi corrigido novamente, você provavelmente também deve verificar seu /var/log/apt/history.log e ver quais pacotes foram removidos quando você desinstalou python3 anterior (o que você não deveria ter feito) e reinstalá-los novamente.

    
por Byte Commander 10.04.2017 / 16:31