ubuntu-advantage-tools_27.6~16.04.1 and error code (1)

Asked by gagandeep singh

Dear Ubuntu Team and Users,
I am using Ubuntu 16.04 and facing the following error while installing software-properties-common package which was required to install another tool and updating my system:

$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
software-properties-common is already the newest version (0.96.20.10).
The following packages will be upgraded:
  ubuntu-advantage-tools
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/704 kB of archives.
After this operation, 1,024 B disk space will be freed.
Preconfiguring packages ...
(Reading database ... 230242 files and directories currently installed.)
Preparing to unpack .../ubuntu-advantage-tools_27.6~16.04.1_amd64.deb ...
/var/lib/dpkg/info/ubuntu-advantage-tools.prerm: 48: /var/lib/dpkg/info/ubuntu-advantage-tools.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: 48: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/ubuntu-advantage-tools_27.6~16.04.1_amd64.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/ubuntu-advantage-tools.postinst: 451: /var/lib/dpkg/info/ubuntu-advantage-tools.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-advantage-tools_27.6~16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then i tried to uninstall/ purge ubuntu-advantage-tools using all the six suggestions at https://phoenixnap.com/kb/fix-sub-process-usr-bin-dpkg-returned-error-code-1 but none of them worked.

I tried to delete ubuntu-advantage-tools_27.6~16.04.1_amd64.deb in the /var/lib/dpkg/info/ directory and reinstall it but it again showed the error code1.
Now when i am trying to run sudo apt-get upgrade, it gives the following error :

 sudo apt-get upgrade
[sudo] password for gsk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done

*The following packages could receive security updates with UA Infra: ESM service enabled:
  libpam0g libpolkit-gobject-1-0 libdjvulibre-text bluez libwebp5 libdns-export162 libqpdf21 dbus-x11 gstreamer1.0-alsa libisccfg140 intel-microcode libdbus-1-3 libsasl2-modules-db linux-libc-dev xserver-common vim-common libx11-xcb-dev libnss3-nssdb libcurl3 libgrilo-0.2-1 gstreamer1.0-plugins-base-apps libpam-modules openssl bluez-cups imagemagick ntfs-3g libwbclient0 git-man libsystemd0 linux-image-generic-hwe-16.04 libexpat1-dev libgd3 libavahi-glib1 libgs9 dbus snapd libicu55 binutils libmagickwand-6.q16-2 squashfs-tools bind9-host linux-generic-hwe-16.04 libavahi-common-data dnsutils libavahi-common3 python3-pil libpython3.5 python3.5 git python3.5-minimal libpolkit-agent-1-0 libisc160 udev gstreamer1.0-plugins-base passwd libsasl2-2 libpam-runtime isc-dhcp-common python3.5-dev libx11-6 libexpat1 libudev1 libwebpdemux1 libavahi-ui-gtk3-0 libaspell15 samba-libs apport gdisk imagemagick-6.q16 libmagickcore-6.q16-2-extra libisc-export160 libsasl2-modules libcaca0 python3-apport avahi-daemon systemd-sysv libspeex1 libavahi-core7 libgcrypt20 libxml2-dev liblwres141 libglib2.0-bin liblz4-1 ubuntu-core-launcher libpam-systemd libgstreamer-plugins-base1.0-0 distro-info-data libsndfile1 gstreamer1.0-x ghostscript systemd libpython3.5-dev login gir1.2-gst-plugins-base-1.0 libssl-dev libssl-doc libpolkit-backend-1-0 libwebpmux1 libpam-modules-bin libx11-data ghostscript-x aspell libopenexr22 libsmbclient libspeexdsp1 openssh-client libmagickcore-6.q16-2 libgs9-common avahi-autoipd libdns162 libx11-dev qpdf libx11-doc libglib2.0-data bluez-obexd policykit-1 libdjvulibre21 apport-gtk libxml2 cpio libnss3 ca-certificates libicu-dev vim-tiny imagemagick-common libisccc140 avahi-utils linux-headers-generic-hwe-16.04 cron libpython3.5-stdlib libbind9-140 icu-devtools libbluetooth3 libexiv2-14 python3-lxml libpython3.5-minimal libavahi-client3 curl isc-dhcp-client python3-problem-report libglib2.0-0 libcurl3-gnutls libx11-xcb1 libssl1.0.0 tzdata
Learn more about UA Infra: ESM service for Ubuntu 16.04 at https://ubuntu.com/16-04

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ubuntu-advantage-tools (27.6~16.04.1) ...
/var/lib/dpkg/info/ubuntu-advantage-tools.postinst: 59: /var/lib/dpkg/info/ubuntu-advantage-tools.postinst: /usr/bin/python3: not found
dpkg: error processing package ubuntu-advantage-tools (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Kindly help me to resolve this issue.

Thanks in advance.
Regards
Gagandeep

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ubuntu-advantage-tools Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

"py3clean: not found
py3compile: not found
/usr/bin/python3: not found"

Try

sudo apt install python3-minimal -f

Revision history for this message
gagandeep singh (gagan94) said :
#2

Dear Manfred,
Thank you for your response, however i still see the same error:

(base) gsk@gsk:~$ sudo apt install python3-minimal -f
[sudo] password for gsk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-minimal is already the newest version (3.5.1-3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ubuntu-advantage-tools (27.6~16.04.1) ...
/var/lib/dpkg/info/ubuntu-advantage-tools.postinst: 59: /var/lib/dpkg/info/ubuntu-advantage-tools.postinst: /usr/bin/python3: not found
dpkg: error processing package ubuntu-advantage-tools (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 ubuntu-advantage-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#3

Try again with

sudo apt install --reinstall python3-minimal -f

Revision history for this message
gagandeep singh (gagan94) said :
#4

It worked. Thanks a lot.