1

I'm running ubuntu 14.04, and I've recently started having issues with apt-get. I can't install or remove any package (error below). I tried reinstalling these packages, I tried deleting the deb files and I still get the same error.

    The following extra packages will be installed:
    python3-software-properties software-properties-common
    software-properties-gtk
    The following packages will be upgraded:
    python3-software-properties software-properties-common
    software-properties-gtk
    3 upgraded, 0 newly installed, 0 to remove and 412 not upgraded.
    108 not fully installed or removed.
    Need to get 0 B/126 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    WARNING: The following packages cannot be authenticated!
    dh-python software-properties-common software-properties-gtk
    python3-software-properties
    Install these packages without verification? [y/N] y
    (Reading database ... 305261 files and directories currently         installed.)
    Preparing to unpack .../software-properties-common_0.92.37.7_all.deb ...
    /var/lib/dpkg/info/software-properties-common.prerm: 6: /var/lib/dpkg/info/software-properties-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: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
    dpkg: error processing archive /var/cache/apt/archives/software-properties-common_0.92.37.7_all.deb (--unpack):
    subprocess new pre-removal script returned error exit status 127
    /var/lib/dpkg/info/software-properties-common.postinst: 6: /var/lib/dpkg/info/software-properties-common.postinst: py3compile: not found
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 127
    Preparing to unpack .../software-properties-gtk_0.92.37.7_all.deb ...
    /var/lib/dpkg/info/software-properties-gtk.prerm: 6: /var/lib/dpkg/info/software-properties-gtk.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/software-properties-gtk_0.92.37.7_all.deb (--unpack):
    subprocess new pre-removal script returned error exit status 127
    /var/lib/dpkg/info/software-properties-gtk.postinst: 6: /var/lib/dpkg/info/software-properties-gtk.postinst: py3compile: not found
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 127
    Preparing to unpack .../python3-software-properties_0.92.37.7_all.deb ...
    /var/lib/dpkg/info/python3-software-properties.prerm: 6: /var/lib/dpkg/info/python3-software-properties.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-software-properties_0.92.37.7_all.deb (--unpack):
    subprocess new pre-removal script returned error exit status 127
    /var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.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/software-properties-common_0.92.37.7_all.deb
    /var/cache/apt/archives/software-properties-gtk_0.92.37.7_all.deb
    /var/cache/apt/archives/python3-software-properties_0.92.37.7_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)
  • 1
    I'd start debugging with "The following packages cannot be authenticated!". You shouldn't get that. Do you get that with all packages, or just some? Can you post the output of apt-cache policy into your question, please? – Faheem Mitha May 9 '17 at 17:22
  • Add to question what you typed to get error. – ctrl-alt-delor May 9 '17 at 17:59
  • Not enough info in question to know for sure, but do an apt-get update; apt-get upgrade, then try again. – ctrl-alt-delor May 9 '17 at 18:00
  • @FaheemMitha When ever I get "The following packages cannot be authenticated!", in debian, an apt-get update, fixes it. – ctrl-alt-delor May 9 '17 at 18:03
  • Hi @richard. Sure, I'm assuming the poster knows enough to run an apt-get update, but I'm thinking it might be the sign of third-party packages. In any case, Alan, please do run apt-get update and see if it makes those messages go away. – Faheem Mitha May 9 '17 at 18:15
0

py3compile: not found

The py3compile command is part of python3-minimal package which seems to be broken.

To fix the issue, try the following:

  • Correct a system with broken dependencies in place by:

    sudo apt-get  -f install
    
  • Reconfigure all unpacked, but unconfigured packages by:

    sudo dpkg --configure -a
    
  • If above won't help, try reinstalling python3-minimal package by:

    sudo apt install -f --reinstall python3-minimal
    

    Alternatively run:

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

    Or download the .pkg file from kernel.org and install from the file by:

    sudo dpkg -i python3-minimal_*.deb
    

Then make sure that py3compile and py3clean commands are runnable and are accessible from your PATH variable.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.