Unmet dependencies python3.9
You have unnecessary PPA repository added. To remove it use commands below:
# sudo apt-get install ppa-purge
cd ~/Downloads
apt-get download ppa-purge
dpkg -x ppa-purge_0.2.8+bzr63_all.deb ppap
sudo cp ppap/usr/sbin/ppa-purge /usr/local/bin/
sudo ppa-purge ppa:deadsnakes/ppa # first for bionic
sudo ppa-purge ppa:deadsnakes/ppa # second for focal
and then reinstall normal python versions from official 20.04 LTS repositories:
sudo apt-get install python3.9=3.9.5-3~20.04.1 libpython3.9-stdlib=3.9.5-3~20.04.1 \
libpython3.9-minimal=3.9.5-3~20.04.1 python3.9-minimal=3.9.5-3~20.04.1 --reinstall
Then install Aptitude with
sudo apt-get install aptitude
and resume package installation by
sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted
sudo apt-get update
sudo apt-get install -f
sudo dpkg -i --force-all /var/cache/apt/archives/libpython3.9-stdlib_3.9.5-3~20.04.1_amd64.deb /var/cache/apt/archives/libpython3.9-minimal_3.9.5-3~20.04.1_amd64.deb
sudo dpkg --configure -a
sudo aptitude install python3.9=3.9.5-3~20.04.1 libpython3.9-stdlib=3.9.5-3~20.04.1 \
libpython3.9-minimal=3.9.5-3~20.04.1 python3.9-minimal=3.9.5-3~20.04.1
sudo aptitude dist-upgrade
This article helped me dpkg error code 1
sudo dpkg --configure -a
sudo apt remove --purge python3.9-minimal python3.9
sudo apt autoremove
sudo apt upgrade