2

ı was upgrading my distribution . But while it was upgrading i got package failed error like this. I tried eveything but i could not find any solutions. Do you have any suggestions?

$ sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 blueman : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
           Depends: gir1.2-ayatanaappindicator3-0.1 but it is not installed
 dbus-user-session : Depends: dbus (>= 1.12.20-1ubuntu3)
 dbus-x11 : Depends: libdbus-1-3 (= 1.12.20-1ubuntu3) but 1.12.16-2ubuntu2.1 is installed
 gir1.2-gtk-3.0 : Depends: libgtk-3-0 (>= 3.24.24) but 3.24.20-0ubuntu1 is installed
 gnupg : Depends: gpgv (>= 2.2.20-1ubuntu3)
 gpgsm : Depends: libksba8 (>= 1.5.0) but 1.3.5-2 is installed
 libpython3-dev : Depends: libpython3.9-dev (>= 3.9.4-0~) but it is not installed
 lz4 : Depends: liblz4-1 (= 1.9.2-2) but 1.9.3-1build1 is installed
 onboard : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
           Recommends: gir1.2-ayatanaappindicator3-0.1 but it is not installed
 python3-apt : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but 3.9.4-1 is installed
 python3-gi : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-gi-cairo : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-markupsafe : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-netifaces : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-pil : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-protobuf : Depends: libprotobuf23 (>= 3.12.4) but it is not installed
                    Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-psutil : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-renderpm : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-reportlab-accel : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-simplejson : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-systemd : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 python3-talloc : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                  Depends: libpython3.9 (>= 3.9.1) but it is not installed
 python3-uno : Depends: libreoffice-common (>= 1:7.0.0~alpha~) but 1:6.4.7-0ubuntu0.20.04.1 is installed
               Depends: libreoffice-core (= 1:7.1.3-0ubuntu0.21.04.1) but 1:6.4.7-0ubuntu0.20.04.1 is installed or
                        libreoffice-core-nogui (= 1:7.1.3-0ubuntu0.21.04.1) but it is not installed
               Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
               Depends: python3.9 but it is not installed
               Depends: libpython3.9 (>= 3.9.1) but it is not installed
 python3-venv : Depends: python3.9-venv (>= 3.9.4-0~) but it is not installed
                Depends: python3 (= 3.9.4-1) but 3.8.2-0ubuntu2 is installed
                Depends: python3-distutils (>= 3.9.4-0~) but 3.8.5-1~20.04.1 is installed
 python3-yaml : Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
 rhythmbox-plugins : Depends: libimobiledevice6 (>= 1.3.0) but 1.2.1~git20191129.9f79242-1build1 is installed
                     Depends: librhythmbox-core10 (= 3.4.4-1ubuntu4) but 3.4.4-1ubuntu2 is installed
                     Depends: python3 (>= 3.9~) but 3.8.2-0ubuntu2 is installed
                     Depends: python3.9 but it is not installed
                     Depends: rhythmbox (= 3.4.4-1ubuntu4) but 3.4.4-1ubuntu2 is installed
                     Depends: gir1.2-rb-3.0 (= 3.4.4-1ubuntu4) but 3.4.4-1ubuntu2 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).enter code here
N0rbert
  • 99,918
  • Please share the output from apt-cache policy blueman python3 dbus libreoffice . If long - use pastebin. – N0rbert May 23 '21 at 12:42
  • Output of the command- https://www.paste.tc/basliksiz-809 – dsDjango May 23 '21 at 12:50
  • You have mixed repositories of focal (20.04 LTS) and groovy (20.10). Is it was planned? Please share full output of grep "^deb\ " -r /etc/apt/ --include=*.list ; cat /etc/os-release . Which version do you really plan to use? – N0rbert May 23 '21 at 12:51
  • actually ı do not have any plan ı just used first this: sudo su sed 's/focal/hirsute/g' /etc/apt/sources.list > /etc/apt/sources.list.d/hirsute.list apt update apt dist-upgrade

    then i got error while it was updating then i used this:

    rm -f /etc/apt/sources.list.d/hirsute.list sed 's/focal/groovy/g' /etc/apt/sources.list > /etc/apt/sources.list.d/groovy.list apt update apt dist-upgrade

    – dsDjango May 23 '21 at 12:53
  • 3

1 Answers1

6

Fix packages on currently installed system

sudo apt --fix-broken install

sudo apt-get update sudo apt-get install aptitude

sudo aptitude safe-upgrade sudo aptitude upgrade sudo aptitude dist-upgrade

sudo apt-get upgrade sudo apt-get dist-upgrade

sudo apt --fix-broken install sudo dpkg --configure -a

If you really want to upgrade to non-LTS 9-months supported-version (say to have many unnecessary upgrades to next LTS like: 20.04 LTS → 20.10 → 21.04 → 21.1022.04 LTS), then allow such upgrade process and run it with supported correct method

sudo rm /etc/apt/preferences.d/pin-focal

sudo sed -i "s/^Prompt=lts/Prompt=normal/" /etc/update-manager/release-upgrades sudo sed -i "s/^Prompt=never/Prompt=normal/" /etc/update-manager/release-upgrades

update-manager -c # in GUI or

sudo do-release-upgrade # in terminal

Note: the last command should be run twice - first for 20.04 LTS → 20.10 and second for 20.10 → 21.04 . For the latter you may need to provide extra -d option.

N0rbert
  • 99,918
  • When i was doing first two step, at the step 2 i got this error again. https://www.paste.tc/basliksiz-810 should i pass step 3? – dsDjango May 23 '21 at 13:06
  • You still have not provided the output of grep "^deb\ " -r /etc/apt/ --include=*.list ; cat /etc/os-release . Please do this. – N0rbert May 23 '21 at 13:07
  • I applied grep "^deb\ " -r /etc/apt/ --include=*.list ; cat /etc/os-release this and turn back step two i got same error. paste.tc/basliksiz-810 – dsDjango May 23 '21 at 13:10
  • 1
    Again, I need the full output of grep "^deb\ " -r /etc/apt/ --include=*.list ; cat /etc/os-release to understand next steps! – N0rbert May 23 '21 at 13:11
  • @N0rbert when higher versions are installed the in focal available like form groovy is not apt-pinning also needed to revert it to lower version? – nobody May 23 '21 at 13:15
  • @N0rbert output of the command. https://www.paste.tc/basliksiz-811 – dsDjango May 23 '21 at 13:16
  • @nobody thanks. The system is now in very bad state, so we need to pin current release. Step is updated, please test it, – N0rbert May 23 '21 at 13:23
  • I did updated steps i got this error: https://www.paste.tc/basliksiz-813

    Before this step i did not get any error.

    – dsDjango May 23 '21 at 13:33
  • So we are now stuck. Then please backup your system first and prepare for more experiments. You have chosen this way, not us. – N0rbert May 23 '21 at 13:42
  • @N0rbert okey, we can try other ways. – dsDjango May 23 '21 at 13:44
  • At first try what apt-get recommends to you - run sudo apt --fix-broken install . – N0rbert May 23 '21 at 13:56
  • @N0rbert i again tried step 2 from begining of sudo apt-get install aptitude then everything works i did not get any error. What should we check it is done or not? – dsDjango May 23 '21 at 14:08
  • some sources are double. Please move file /etc/apt/sources.list.d/groovy.list to another location like a folder in your $HOME. – nobody May 23 '21 at 14:12
  • I applied mv /etc/apt/sources.list.d/groovy.list $Home then what should i do? – dsDjango May 23 '21 at 14:15
  • Answer updated. Use standard mechanism without sed . – N0rbert May 23 '21 at 14:21
  • @N0rbert thanks a lot i applied everything and did not get any error. It seems fine. – dsDjango May 23 '21 at 14:27
  • Great, so you can accept my answer using checkmark in the left of answer. – N0rbert May 23 '21 at 14:41