0

I recently deleted my all python files from dpkg info to solve this but that didn't work, even damaged. Then after installing ubuntu-desktop, again facing with same issue.

[root@nar-ubuntu ~]$ apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: dmsetup libdevmapper1.02.1 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 3 not fully installed or removed. Need to get 202 kB/326 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://am.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libdevmapper1.02.1 amd64 2:1.02.145-4.1ubuntu3.18.04.2 [127 kB] 75% [Working] Get:2 http://am.archive.ubuntu.com/ubuntu bionic-updates/main amd64 dmsetup amd64 2:1.02.145-4.1ubuntu3.18.04.2 [74.5 kB] Fetched 202 kB in 0s (903 kB/s) dpkg: warning: files list file for package 'python-apt-common' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-cryptography' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python-pip-whl' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-yaml' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-speechd' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-distro-info' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-pil:amd64' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-cups' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3.6' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-apt' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-dbus' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-rfc3339' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-pyatspi' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-cffi-backend' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-olefile' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-keyring' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-brlapi' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-mako' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-crypto' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-requests-unixsocket' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-simplejson' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-idna' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-xdg' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-update-manager' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-keyrings.alt' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-six' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-oauth' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3.6-minimal' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-pymacaroons' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-certifi' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-wadllib' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-aptdaemon.gtk3widgets' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-zope.interface' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-gi-cairo' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-pkg-resources' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-gi' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-apport' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-markupsafe' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-lazr.restfulclient' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-defer' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-problem-report' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-asn1crypto' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-reportlab' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-macaroonbakery' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-protobuf' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-debconf' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-pexpect' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-chardet' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-aptdaemon' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-systemd' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-minimal' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-httplib2' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-requests' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-nacl' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-cupshelpers' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-software-properties' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-urllib3' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-reportlab-accel:amd64' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-cairo:amd64' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3.6-dev' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-launchpadlib' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-secretstorage' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-ptyprocess' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-tz' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-debian' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-louis' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-distupgrade' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python2.7-minimal' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-dateutil' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-xkit' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python-talloc' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'python3-lazr.uri' missing; assuming package has no files currently installed (Reading database ... 250868 files and directories currently installed.) Preparing to unpack .../libdevmapper1.02.1_2%3a1.02.145-4.1ubuntu3.18.04.2_amd64.deb ... Unpacking libdevmapper1.02.1:amd64 (2:1.02.145-4.1ubuntu3.18.04.2) over (2:1.02.145-4.1ubuntu3.18.04.1) ... Preparing to unpack .../dmsetup_2%3a1.02.145-4.1ubuntu3.18.04.2_amd64.deb ... Unpacking dmsetup (2:1.02.145-4.1ubuntu3.18.04.2) over (2:1.02.145-4.1ubuntu3.18.04.1) ... Setting up python2.7 (2.7.15-4ubuntu4~18.04.2) ... Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] /usr/bin/python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] No such file or directory dpkg: error processing package python2.7 (--configure): installed python2.7 package post-installation script subprocess returned error exit status 2 Setting up libdevmapper1.02.1:amd64 (2:1.02.145-4.1ubuntu3.18.04.2) ... Setting up python-minimal (2.7.15~rc1-1) ... Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] ImportError: No module named site dpkg: error processing package python-minimal (--configure): installed python-minimal package post-installation script subprocess returned error exit status 1 dpkg: error processing package apport (--configure): package is in a very bad inconsistent state; you should reinstall it before attempting configuration Setting up dmsetup (2:1.02.145-4.1ubuntu3.18.04.2) ... update-initramfs: deferring update (trigger activated) Processing triggers for libc-bin (2.27-3ubuntu1) ... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Processing triggers for initramfs-tools (0.130ubuntu3.9) ... update-initramfs: Generating /boot/initrd.img-5.0.0-37-generic Errors were encountered while processing: python2.7 python-minimal apport E: Sub-process /usr/bin/dpkg returned an error code (1) 
3
  • @A.B I've tried it so many times and does'nt help me. I'll give it a shot one more time, thanks though. Commented Dec 12, 2019 at 16:35
  • Your issue is that python is missing so you deleted all python files to solve that issue? Commented Dec 12, 2019 at 16:50
  • @A.B E: Internal Error, No file name for python-minimal:amd64 how can I reinstall python-minimal? Commented Dec 12, 2019 at 16:54

1 Answer 1

1

Simply put, if you delete the files that dpkg was suppose to handle, it will report an error. Generally you shouldn't delete files meant to be handled by the package manager.

Reinstall the packages and then uninstall them properly using apt, dpkg or you're favorite front-end and you will be good.

Worst case, do a clean reinstall of your system. Yes, you can keep user data across reinstalls.

As a note, if you can't uninstall something because of dependencies, that means you likely need it and shouldn't uninstall it. Don't manually uninstall things in the future. The most you should do is add a few missing links or edit a few config files.

2
  • E: Internal Error, No file name for python-minimal:amd64 how can I reinstall python-minimal? Commented Dec 12, 2019 at 16:57
  • Use apt to install from repositories not dpkg. Dpkg is individual packages, not repositories. There is a way to install from repository using dpkg, but it's not pretty. Use apt or a front end. Commented Dec 12, 2019 at 17:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.