如何修复损坏的包管理器?

时间:2017-02-11 02:28:13

标签: python-3.x debian

操作系统:debian8。

debian8@hwy:~$ sudo apt-get install python3
Reading package lists... Done
Building dependency tree   
Reading state information... Done
python3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

包管理器告诉python3已安装。

debian8@hwy:~$ python3
bash: python3: command not found
debian8@hwy:~$ sudo find /  -name  'python3*'

没有输出,如何修复损坏的包管理器?

enter image description here

2 个答案:

答案 0 :(得分:0)

第一个命令将显示是否已安装软件包

~$ dpkg -l python3
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   Description
+++-===================-==============-==============-============================================
ii  python3             3.5.1-3        amd64          interactive high-level object-oriented langu

此命令将显示python3程序的位置(如果已安装)。

~$ which python3
/usr/bin/python3

重新安装您删除的软件包,检查我有' ii'你有' ri'

apt install --reinstall python3

答案 1 :(得分:0)

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
tar -xf Python-3.6.0.tar.xz
cd ./Python-3.6.0
sudo ./configure --prefix=/usr/local/python3.6 --with-ensurepip=install
sudo make
sudo make install
sudo ln -s /usr/local/python3.6/bin/python3.6 /usr/bin/python3.6
sudo ln -s /usr/local/python3.6/bin/pip3.6 /usr/bin/pip3.6

所有问题都已解决。