Score:0

Error dpkg python

pl flag

Without thinking much about what I was doing, I deleted the bin / python3 folder.

Now I have problems with all.

I cannot install anything. I tried too many different thing from here trying too find a solution, but nothing.

For example when I try to do sudo apt install software-properties-common, I get:

....
E: py3compile:243: Requested versions are not installed
dpkg: error processing package python3-dbus (--configure):
 installed python3-dbus package post-installation script subprocess returned error exit sta
tus 3
Setting up python3-apt (2.0.0ubuntu0.20.04.6) ...
E: py3compile:243: Requested versions are not installed

....
dpkg: error processing package python3-distro-info (--configure):
 installed python3-distro-info package post-installation script subprocess returned error e
xit status 3
dpkg: dependency problems prevent configuration of python3-requests-unixsocket:
 python3-requests-unixsocket depends on python3-requests; however:
  Package python3-requests is not configured yet.
 python3-requests-unixsocket depends on python3-urllib3; however:
  Package python3-urllib3 is not configured yet.

dpkg: error processing package python3-requests-unixsocket (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3-dbus
 python3-apt
 software-properties-common
 python3-six
unattended-upgrades
 python3-chardet
 python3-software-properties
 python3-certifi
 python3-gi
 python3-requests
 python3-idna
 python-setuptools
 python3-pip
 python3-urllib3
 python3-minimal
 python-dnspython
 python3-distro-info
 python3-requests-unixsocket

When I try to do

sudo apt download python3* unattended-upgrades && sudo dpkg -i --force-all ./*.deb

I get the only output:

E: Unable to locate package python3-minimal_3.8.2-0ubuntu2_amd64.deb

I have Ubuntu 20.04

Apart from removing the python from bin I also touched the .bashrc fil.

My terminal and desktop works

sudo apt -f install

...
E: py3compile:243: Requested versions are not installed
dpkg: error processing package python3-dbus (--configure):
 installed python3-dbus package post-installation script subprocess returned err
or exit status 3
Setting up python3-apt (2.0.0ubuntu0.20.04.6) ...
E: py3compile:243: Requested versions are not installed
dpkg: error processing package python3-apt (--configure):
 installed python3-apt package post-installation script subprocess returned erro
r exit status 3
dpkg: dependency problems prevent configuration of software-properties-common:
 software-properties-common depends on python3-dbus; however:
  Package python3-dbus is not configured yet.

dpkg: error processing package software-properties-common (--configure):
 dependency problems - leaving unconfigured
Setting up python3-six (1.14.0-2) ...
E: py3compile:243: Requested versions are not installed
dpkg: error processing package python3-six (--configure):
 installed python3-six package post-installation script subprocess returned erro
r exit status 3
dpkg: dependency problems prevent configuration of unattended-upgrades:
 unattended-upgrades depends on python3-apt (>= 1.9.6~); however:
  Package python3-apt is not configured yet.
 unattended-upgrades depends on python3-dbus; however:
  Package python3-dbus is not configured yet.
...
dpkg: error processing package python3-requests-unixsocket (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3-dbus
 python3-apt
 software-properties-common
 python3-six
 unattended-upgrades
 python3-chardet
 python3-software-properties
 python3-certifi
 python3-gi
 python3-requests
 python3-idna
 python-setuptools
 python3-pip
 python3-urllib3
 python3-minimal
 python-dnspython
 python3-distro-info
 python3-requests-unixsocket
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I try to install python I get:

Setting up python3-minimal (3.8.2-0ubuntu2) ...
E: py3compile:243: Requested versions are not installed
dpkg: error processing package python3-minimal (--configure):
 installed python3-minimal package post-installation script subprocess returned error exit status 3
Errors were encountered while processing:
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

Sudo apt update

Hit:1 http://es.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease                   
Hit:3 http://es.archive.ubuntu.com/ubuntu focal-updates InRelease              
Hit:4 http://es.archive.ubuntu.com/ubuntu focal-backports InRelease            
Hit:5 http://ppa.launchpad.net/blaze/rtbth-dkms/ubuntu focal InRelease         
Hit:6 http://security.ubuntu.com/ubuntu focal-security InRelease           
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

At the start of the session I get:

bash: pyenv: command not found
Anastasia Oxenyuk avatar
pl flag
Question, you are speaking about /var/backups/ ? If yes, how I can restore?
karel avatar
sa flag
Does this answer your question? [Package dbus is not configured yet](https://askubuntu.com/questions/202321/package-dbus-is-not-configured-yet)
Someone avatar
my flag
@karel How is that relevant?
karel avatar
sa flag
Does this answer your question? [Can't upgrade/update ubuntu 18.04 as apt/dpkg error is showing up](https://askubuntu.com/q/1056780/)
karel avatar
sa flag
Does this answer your question? [Dependency errors prevent all APT commands from running, "Package libappstream-glib8:amd64 is not configured yet"](https://askubuntu.com/q/855359/)
karel avatar
sa flag
@someone I'd like to build a canonical question by merging the three questions that I linked to into one question, but I haven't managed to do it yet.
karel avatar
sa flag
@someone I certainly do need your help eventually, but I need about three months more to study the edge cases and the corner cases before I'll be ready to start trying to merge questions. What I particularly need help with is that in case there any empty holes in the canonical question where an answer should go, then I need someone to write and post that answer.
Yan King Yin avatar
cn flag
In my case I tried to get at least one python version in working condition, by creating a sym link such as: `sudo ln -sf /usr/bin/python3.6 /usr/bin/python3`. Then I reinstalled using `sudo apt install --reinstall python3 python python3-minimal --fix-broken`. If you don't even have python, you may need to try other means, good luck :)
Score:2
my flag

From the comments and other answers,

First OP restored their .bashrc file by using this question.

First back up the old file:

cp ~/.bashrc ~/.bashrc.bak

Copy the skeleton version of the file

cp /etc/skel/.bashrc ~/

Load the new file:

source ~/.bashrc

After that OP ran:

mkdir xyz && sudo mv /var/lib/dpkg/info/python3* ~/xyz
sudo mv /var/lib/dpkg/info/unattended-upgrades* ~/xyz && sudo mv /var/lib/dpkg/info/software-properties-common* ~/xyz 

Then they ran:

sudo cp -r /var/lib/dpkg/status $HOME
echo > /var/lib/dpkg/status

Then at the end, they ran:

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -f
Yan King Yin avatar
cn flag
It's fine. I misunderstood.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.