0

I've been messing with Python installation and I messed it up completely. Now when I'm doing apt upgrade I always get following error.

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package python-incremental needs to be reinstalled, but I can't find an archive for it.

I've been trying many things that I found around but no luck so far.

$ sudo dpkg --remove python-incremental
dpkg: dependency problems prevent removal of python-incremental:
 python-twisted-core depends on python-incremental.

dpkg: error processing package python-incremental (--remove): dependency problems - not removing Errors were encountered while processing: python-incremental

$ sudo dpkg --remove python-twisted-core dpkg: dependency problems prevent removal of python-twisted-core: deluge-common depends on python-twisted-core; however: Package python-twisted-core is to be removed.

dpkg: error processing package python-twisted-core (--remove): dependency problems - not removing Errors were encountered while processing: python-twisted-core

$ sudo apt-get install --reinstall python-minimal python-lockfile Reading package lists... Done Building dependency tree
Reading state information... Done E: The package python-incremental needs to be reinstalled, but I can't find an archive for it.

$ sudo apt-get -f install Reading package lists... Done Building dependency tree
Reading state information... Done E: The package python-incremental needs to be reinstalled, but I can't find an archive for it.

And many more...

Seems like APT is stuck by this issue and I have no idea how to continue. I'm on Ubuntu 20.04.3 LTS. Any ideas? Thanks.

piktor
  • 61
  • 1
    Never attempt to change the default python version - it is an essential part of the core system. Did you add PPA's? Try ppa-purging these (may also not work). A system reinstall may be the quickest option - you can do so without formatting the disk. Then your user configuration is preserved. – vanadium Aug 30 '21 at 10:39
  • A quick query on python-incremental shows it's available only for bionic, so I'd be checking why you need/installed it, and whether or not you need anything else associated with it (ie. depends rules) – guiverc Aug 30 '21 at 10:41
  • @vanadium Unfortunately these packages were not added from any PPA, I did dpkg -i on files downloaded from internet. Big mistake. So I suppose ppa-purge won't help there. I know how to do system reinstall but I was hoping there will be easier solution. – piktor Aug 30 '21 at 13:41
  • 1
    Technically the easiest will be reinstall, most likely. A broken package system may require hand work to repair, and each case is unique. – vanadium Aug 30 '21 at 15:40
  • An easier solution may be to uninstall whatever packages you downloaded from the internet. One imagines the package names are in your terminal history. – user535733 Aug 30 '21 at 15:45

0 Answers0