2015-06-21 29 views
1
sudo apt-get remove --purge mysql-server mysql-client mysql-common 

我收到以下錯誤,我嘗試使用上面的命令來刪除MySQL的:dpkg的錯誤:pycompile:找不到

Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Package 'mysql-client' is not installed, so not removed 
The following package was automatically installed and is no longer required: 

    php5-mysqlnd 

Use 'apt-get autoremove' to remove it. 

The following extra packages will be installed: 

    mysql-server-core-5.5 php5-mysqlnd python-aptdaemon 

python-aptdaemon.gtk3widgets python3-aptdaemon python3-aptdaemon.gtk3widgets 

    python3-aptdaemon.pkcompat python3-uno python3-update-manager 
    ubuntu-drivers-common update-manager 

The following packages will be REMOVED: 
    libdbd-mysql-perl* libmysqlclient18* mysql-client-5.5* mysql-common* 
    mysql-server* mysql-server-5.5* php5-mysql* phpmyadmin* 

The following NEW packages will be installed: 
    php5-mysqlnd 

The following packages will be upgraded: 

    mysql-server-core-5.5 python-aptdaemon python-aptdaemon.gtk3widgets 

    python3-aptdaemon python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat 

    python3-uno python3-update-manager ubuntu-drivers-common update-manager 
10 upgraded, 1 newly installed, 8 to remove and 115 not upgraded. 
170 not fully installed or removed. 
Need to get 0 B/4,388 kB of archives. 
After this operation, 89.9 MB disk space will be freed. 
Do you want to continue? [Y/n] Y 
Preconfiguring packages ... 
(Reading database ... 354910 files and directories currently installed.) 
Preparing to unpack .../ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb ... 
/var/lib/dpkg/info/ubuntu-drivers-common.prerm: 12: /var/lib/dpkg/info/ubuntu-drivers-common.prerm: py3clean: not found 
dpkg: warning: subprocess old pre-removal script returned error exit status 127 
dpkg: trying script from the new package instead ... 
/var/lib/dpkg/tmp.ci/prerm: 12: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

/var/lib/dpkg/info/ubuntu-drivers-common.postinst: 6: 

/var/lib/dpkg/info/ubuntu-drivers-common.postinst: py3compile: not found 
dpkg: error while cleaning up: 

subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../python3-update-manager_1%3a0.196.13_all.deb ... 

/var/lib/dpkg/info/python3-update-manager.prerm: 6: 

/var/lib/dpkg/info/python3-update-manager.prerm: py3clean: not found 
dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/python3-update-manager_1%3a0.196.13_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

/var/lib/dpkg/info/python3-update-manager.postinst: 6: 

/var/lib/dpkg/info/python3-update-manager.postinst: py3compile: not found 

dpkg: error while cleaning up: 
subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../python3-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb ... 

/var/lib/dpkg/info/python3-aptdaemon.pkcompat.prerm: 6: 

/var/lib/dpkg/info/python3-aptdaemon.pkcompat.prerm: py3clean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/python3-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb (--unpack): 
subprocess new pre-removal script returned error exit status 127 

/var/lib/dpkg/info/python3-aptdaemon.pkcompat.postinst: 6: 

/var/lib/dpkg/info/python3-aptdaemon.pkcompat.postinst: py3compile: not found 

dpkg: error while cleaning up: 
subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../python3-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb ... 

/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.prerm: 6: 

/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.prerm: py3clean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/python3-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.postinst: 6: 

/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.postinst: py3compile: not found 

dpkg: error while cleaning up: 
subprocess installed post-installation script returned error exit status 127 
Preparing to unpack .../python3-aptdaemon_1.1.1-1ubuntu5.2_all.deb ... 

/var/lib/dpkg/info/python3-aptdaemon.prerm: 6: /var/lib/dpkg/info/python3-aptdaemon.prerm: py3clean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/python3-aptdaemon_1.1.1-1ubuntu5.2_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/python3-aptdaemon.postinst: 6: 

/var/lib/dpkg/info/python3-aptdaemon.postinst: py3compile: not found 

dpkg: error while cleaning up: 

subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../update-manager_1%3a0.196.13_all.deb ... 

/var/lib/dpkg/info/update-manager.prerm: 6: /var/lib/dpkg/info/update-manager.prerm: py3clean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/update-manager_1%3a0.196.13_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/update-manager.postinst: 6: /var/lib/dpkg/info/update-manager.postinst: py3compile: not found 

dpkg: error while cleaning up: 
subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb ... 

/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.prerm: 6: 

/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.prerm: pyclean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found 

dpkg: error processing archive /var/cache/apt/archives/python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 

No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/python-aptdaemon.gtk3widgets.postinst: 6: 

/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.postinst: pycompile: not found 

dpkg: error while cleaning up: 
subprocess installed post-installation script returned error exit status 127 
Preparing to unpack .../python-aptdaemon_1.1.1-1ubuntu5.2_all.deb ... 

/var/lib/dpkg/info/python-aptdaemon.prerm: 6: /var/lib/dpkg/info/python-aptdaemon.prerm: pyclean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found 

dpkg: error processing archive /var/cache/apt/archives/python-aptdaemon_1.1.1-1ubuntu5.2_all.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 
No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/python-aptdaemon.postinst: 6: 

/var/lib/dpkg/info/python-aptdaemon.postinst: pycompile: not found 

dpkg: error while cleaning up: 

subprocess installed post-installation script returned error exit status 127 

Preparing to unpack .../python3-uno_1%3a4.2.8-0ubuntu2_amd64.deb ... 

/var/lib/dpkg/info/python3-uno.prerm: 6: /var/lib/dpkg/info/python3-uno.prerm: py3clean: not found 

dpkg: warning: subprocess old pre-removal script returned error exit status 127 

dpkg: trying script from the new package instead ... 

/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found 

dpkg: error processing archive /var/cache/apt/archives/python3-uno_1%3a4.2.8-0ubuntu2_amd64.deb (--unpack): 

subprocess new pre-removal script returned error exit status 127 
No apport report written because MaxReports is reached already 
                   /var/lib/dpkg/info/python3-uno.postinst: 6: /var/lib/dpkg/info/python3-uno.postinst: py3compile: not found 

dpkg: error while cleaning up: 

subprocess installed post-installation script returned error exit status 127 

Errors were encountered while processing: 

/var/cache/apt/archives/ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb 

/var/cache/apt/archives/python3-update-manager_1%3a0.196.13_all.deb 

/var/cache/apt/archives/python3-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb 

/var/cache/apt/archives/python3-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb 

/var/cache/apt/archives/python3-aptdaemon_1.1.1-1ubuntu5.2_all.deb 

/var/cache/apt/archives/update-manager_1%3a0.196.13_all.deb 

/var/cache/apt/archives/python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb 

/var/cache/apt/archives/python-aptdaemon_1.1.1-1ubuntu5.2_all.deb 

/var/cache/apt/archives/python3-uno_1%3a4.2.8-0ubuntu2_amd64.deb 

E: Sub-process /usr/bin/dpkg returned an error code (1) 

我該如何解決這個問題?

回答

0

試試這個:

首先刪除不多所需的軟件包:

sudo apt-get autoremove 

清除了檢索包文件

sudo apt-get autoclean 

刪除軟件包的本地存儲庫(MySQL的客戶端不安裝):

sudo apt-get remove mysql-server mysql-common 
+0

我試過所有提到的命令。它仍然在最後給出同樣的錯誤。 –

+0

我嘗試了所有提到的命令。它仍然在最後給出同樣的錯誤。事實上,當我嘗試在我的ubuntu中安裝或刪除任何東西(認真地說,沒有安裝或刪除任何東西)時,我會得到相同的錯誤。 –

+0

這是一個更普遍的問題,我認爲這與dpkg有關。 – teoreda

0

py3compile: not found

py3compile命令是python3-minimal程序包的一部分,它似乎被破壞。通過

  • 糾正碎依賴系統到位:

    要解決此問題,請嘗試以下

    sudo apt-get -f install 
    
  • 重新配置所有解壓,但是未配置包通過:

    sudo dpkg --configure -a 
    
  • 如果以上方法無效,請嘗試重新安裝python3-minimal包裝方式:

    sudo apt install -f --reinstall python3-minimal 
    

    或者運行:

    apt-get download python3-minimal 
    sudo dpkg -i *python3*.deb 
    sudo apt install -f 
    

    或者下載.pkg file from kernel.org並從文件安裝:

    sudo dpkg -i python3-minimal_*.deb 
    

然後確保py3compilepy3clean命令是可運行的,並可從您的訪問變量。

0

儘管py3compile和py3clean存在於/ usr/bin /中,但我的Lubunutu 16.10 shell(tcsh)一直在抱怨py3compile不在那裏。經過挫折的時間,我發現,在pycompile第一行是:

! /usr/bin/env python

或類似的東西,其中提到Python2.7我的系統上。改變這種以點到Python 3:

! /usr/local/bin/python3

突然py3compile可見訂做!

發現shell說py3compile即使在它的路徑中也不存在,或者當py3compile引用Python2.7時,它直接用「/usr/bin/py3compile」執行。 shell甚至沒有抱怨Python版本或任何東西,它只是聲稱py3compile本身並不存在!

我陷入了這個混亂,因爲我想要刪除並重新安裝Python 3.5,一旦發現仍然存在Python 3,然後我發現它來自python-minimal,我嘗試刪除並重新安裝。 python-minimal不會重新安裝,即使我嘗試了所有可以在網絡和每個軟件包管理器上找到的東西。他們都會抱怨py3compile失蹤。現在我發現了py3compile的這個修復。