GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Supprimé accidentellement /usr/bin/python3.5, impossible de réinstaller ?

Système d'exploitation :Ubuntu 14.04

J'ai vu une question similaire, mais aucune des méthodes qui y sont mentionnées ne fonctionne.

J'ai installé python 3.5 en exécutant :

apt-get install -y software-properties-common && \
add-apt-repository ppa:fkrull/deadsnakes && \
apt-get update
apt-get install -y python3.5 python3.5-dev

Je fais une erreur en exécutant ln -sf /usr/bin/python /usr/bin/python3.5 , donc le lien symbolique vers python3.5 devient python2.7 .

J'ai essayé :

1.

rm -f /etc/apt/sources.list.d/*
dpkg --configure -a
add-apt-repository ppa:fkrull/deadsnakes
apt-get update
apt-get install --reinstall python3.5 python3.5-dev

2.

apt-get remove --purge python3.5 python3.5-dev
apt-get install python3.5 python3.5-dev

Dans les deux cas, j'ai quelque chose comme :

/var/lib/dpkg/info/python3.5.postinst: 9: /var/lib/dpkg/info/python3.5.postinst: python3.5: not found
dpkg: error processing package python3.5 (--configure):
 subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of python3.5-dev:
 python3.5-dev depends on python3.5 (= 3.5.2-1~trusty1); however:
  Package python3.5 is not configured yet.

dpkg: error processing package python3.5-dev (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.5
 python3.5-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)

Réponse acceptée :

Je l'ai corrigé.

Trouver toutes les dépendances :

dpkg -l | grep python3.5

Supprimez-les tous :

apt-get --purge remove libpython3.5 libpython3.5-dev libpython3.5-minimal libpython3.5-stdlib python3.5 python3.5-dev python3.5-minimal

Réinstaller

apt-get install python3.5-dev

Ubuntu
  1. /usr/bin Vs /usr/local/bin Sous Linux ?

  2. /usr/bin/ls :/usr/bin/ls :impossible d'exécuter le fichier binaire ?

  3. Pourquoi /bin/sh pointe-t-il vers /bin/dash et non /bin/bash ? ?

  4. Icônes supprimées accidentellement dans /usr/share, comment les récupérer ?

  5. /usr/bin/ld :impossible de trouver -lpython2.7

Annuaire /usr accidentellement supprimé ?

Installer les binaires dans /bin, /sbin, /usr/bin et /usr/sbin, interactions avec --prefix et DESTDIR

autorisation refusée pour composer dans /usr/local/bin/

Comment faire en sorte que la commande python3 exécute Python 3.6 au lieu de 3.5 ?

Quelle est la signification de /usr/sbin, /usr/local/sbin et /usr/local/bin ?

Différence entre /bin et /usr/bin