0

I am updating my Python and can not get through. The systems suggest using sudo apt-get -f install, however, it does not work either. How can I solve this issue?

$sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  python3-update-manager update-manager
The following packages will be upgraded:
  python3-update-manager update-manager
2 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
11 not fully installed or removed.
Need to get 0 B/574 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 405655 files and directories currently installed.)
Preparing to unpack .../python3-update-manager_1%3a16.04.4_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%3a16.04.4_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 .../update-manager_1%3a16.04.4_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%3a16.04.4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/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
Errors were encountered while processing:
 /var/cache/apt/archives/python3-update-manager_1%3a16.04.4_all.deb
 /var/cache/apt/archives/update-manager_1%3a16.04.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
muru
  • 197,895
  • 55
  • 485
  • 740
DEu
  • 1
  • 1
  • 1
    How fresh is this install? How long have you run it since installing the OS? – L. D. James Oct 22 '16 at 18:48
  • About 2 months. I recently need Python 3 and tried to update it. Thank you James. – DEu Oct 22 '16 at 20:15
  • Try updating and upgrading your current repository and libraries. Run: sudo apt update, sudo apt upgrade, sudo apt install python3. – L. D. James Oct 22 '16 at 20:23
  • doesn't work.....sudo apt install python3 Reading package lists... Done Building dependency tree
    Reading state information... Done python3 is already the newest version (3.5.1-3). You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: update-manager : Depends: update-manager-core (= 1:16.04.3) but 1:16.04.4 is to be installed update-manager-core : Depends: python3-update-manager (= 1:16.04.4) but 1:16.04.3 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    – DEu Oct 22 '16 at 20:55

1 Answers1

1

Be sure to update your repositories, then the system files. Then perform a reinstall of python3.

(The $ represents the command prompt you see in the terminal screen. The command is what follows the $ prompt.):

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install python3-minimal
$ sudo apt install --reinstall python3

Then from there add some of the other packages you might need from the repository. You can get a list of the default repository packages with:

$ apt-cache search "^python3" | less
L. D. James
  • 25,036
  • @muru Thanks! I removed the wild card. Do you see any problem with purging the flawed install of python3 which continues prompt that it's already installed and will not take the upgrade? It's also giving errors about missing default commands line py3clean. – L. D. James Oct 27 '16 at 02:24
  • Problem is, python3 itself doesn't contain much: http://packages.ubuntu.com/xenial/amd64/python3/filelist I doubt reinstalling it will help. python3-minimal might be of more importance. – muru Oct 27 '16 at 02:26
  • Also see: http://meta.askubuntu.com/q/282/158442 – muru Oct 27 '16 at 02:26
  • Thanks. I had thought python2.7 was the default and python3 was an upgraded alternative. I'll add the python3-minimal to the answer. – L. D. James Oct 27 '16 at 02:42
  • @L.D.James Your answer says python3-minimul but I think you meant python3-minimal? – edwinksl Oct 27 '16 at 19:24
  • @edwinksl You're quiet right! Thanks for the catch and nudge. – L. D. James Oct 27 '16 at 19:26