Reputation: 31
I'm trying to do an apt update apt upgrade but I'm having an error.
"The following packages have unmet dependencies: dpkg : Breaks: libapt-pkg5.0 (< 1.7~b) but 1.6.14 is to be installed E: Broken packages "
I have already tried a lot of things like clean, autoclean, dpkg --configure -a... but nothing helped me.
Thanks, Regards.
Upvotes: 3
Views: 5716
Reputation: 80
When apt says dependencies have conflicting versions, you need to manually specify all dependencies in the command line. This tells apt that you want also to upgrade all dependencies. Apt doesn't by default allow downgrading packages. If any package still conflicts and it is not required by other installed packages, it will be automatically suggested for removal.
Version conflicts can be caused by either having two repositories with same package, but different version numbers, or trying to upgrade packages while a repository metadata is still being updated.
Upvotes: 1
Reputation: 31
In my organization, this error was solved with this sequence:
# apt remove ubuntu-advantage-tools
# apt install -f
# apt update
# apt upgrade
A reboot after these steps should complete the updates.
The outputs are below:
root@host:~# **apt remove ubuntu-advantage-tools**
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
distro-info
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
ubuntu-advantage-tools ubuntu-minimal ubuntu-server update-manager-core update-notifier-common
0 upgraded, 0 newly installed, 5 to remove and 9 not upgraded.
After this operation, 4812 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 94121 files and directories currently installed.)
Removing ubuntu-server (1.450.2) ...
Removing update-notifier-common (3.192.30.10) ...
Removing update-manager-core (1:20.04.10.10) ...
dpkg: warning: while removing update-manager-core, directory '/var/lib/update-manager' not empty so not removed
Removing ubuntu-minimal (1.450.2) ...
Removing ubuntu-advantage-tools (27.8~20.04.1) ...
Processing triggers for man-db (2.9.1-1) ...
root@host:~# **apt install -f**
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
distro-info
Use 'apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
root@host:~# **apt update**
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:5 https://download.docker.com/linux/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
9 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@host:~# **apt upgrade**
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
distro-info
Use 'apt autoremove' to remove it.
The following packages will be upgraded:
ca-certificates cloud-init containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin
intel-microcode snapd
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 145 MB of archives.
After this operation, 5364 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 ca-certificates all 20211016~18.04.1 [144 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.6.6-1 [28.1 MB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 snapd amd64 2.55.5+18.04 [35.6 MB]
Get:4 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-cli amd64 5:20.10.17~3-0~ubuntu-focal [40.6 MB]
Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 cloud-init all 22.2-0ubuntu1~18.04.3 [493 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 intel-microcode amd64 3.20220510.0ubuntu0.18.04.1 [4063 kB]
Get:7 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce amd64 5:20.10.17~3-0~ubuntu-focal [21.0 MB]
Get:8 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-ce-rootless-extras amd64 5:20.10.17~3-0~ubuntu-focal [8171 kB]
Get:9 https://download.docker.com/linux/ubuntu focal/stable amd64 docker-compose-plugin amd64 2.6.0~ubuntu-focal [6560 kB]
Fetched 145 MB in 4s (36.3 MB/s)
Preconfiguring packages ...
(Reading database ... 93863 files and directories currently installed.)
Preparing to unpack .../0-ca-certificates_20211016~18.04.1_all.deb ...
Unpacking ca-certificates (20211016~18.04.1) over (20210119~20.04.2) ...
Preparing to unpack .../1-containerd.io_1.6.6-1_amd64.deb ...
Unpacking containerd.io (1.6.6-1) over (1.6.4-1) ...
Preparing to unpack .../2-docker-ce-cli_5%3a20.10.17~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce-cli (5:20.10.17~3-0~ubuntu-focal) over (5:20.10.16~3-0~ubuntu-focal) ...
Preparing to unpack .../3-docker-ce_5%3a20.10.17~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce (5:20.10.17~3-0~ubuntu-focal) over (5:20.10.16~3-0~ubuntu-focal) ...
Preparing to unpack .../4-docker-ce-rootless-extras_5%3a20.10.17~3-0~ubuntu-focal_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:20.10.17~3-0~ubuntu-focal) over (5:20.10.16~3-0~ubuntu-focal) ...
Preparing to unpack .../5-docker-compose-plugin_2.6.0~ubuntu-focal_amd64.deb ...
Unpacking docker-compose-plugin (2.6.0~ubuntu-focal) over (2.5.0~ubuntu-focal) ...
Preparing to unpack .../6-snapd_2.55.5+18.04_amd64.deb ...
Unpacking snapd (2.55.5+18.04) over (2.54.3+20.04.1ubuntu0.3) ...
Preparing to unpack .../7-cloud-init_22.2-0ubuntu1~18.04.3_all.deb ...
Unpacking cloud-init (22.2-0ubuntu1~18.04.3) over (22.1-14-g2e17a0d6-0ubuntu1~20.04.3) ...
Preparing to unpack .../8-intel-microcode_3.20220510.0ubuntu0.18.04.1_amd64.deb ...
Unpacking intel-microcode (3.20220510.0ubuntu0.18.04.1) over (3.20210608.0ubuntu0.20.04.1) ...
Setting up cloud-init (22.2-0ubuntu1~18.04.3) ...
Installing new version of config file /etc/cloud/cloud.cfg ...
Setting up intel-microcode (3.20220510.0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
intel-microcode: microcode will be updated at next boot
Setting up ca-certificates (20211016~18.04.1) ...
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
7 added, 8 removed; done.
Setting up containerd.io (1.6.6-1) ...
Setting up docker-compose-plugin (2.6.0~ubuntu-focal) ...
Setting up docker-ce-cli (5:20.10.17~3-0~ubuntu-focal) ...
Setting up docker-ce-rootless-extras (5:20.10.17~3-0~ubuntu-focal) ...
Setting up snapd (2.55.5+18.04) ...
Installing new version of config file /etc/apparmor.d/usr.lib.snapd.snap-confine.real ...
snapd.failure.service is a disabled or a static unit not running, not starting it.
snapd.snap-repair.service is a disabled or a static unit not running, not starting it.
Setting up docker-ce (5:20.10.17~3-0~ubuntu-focal) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for rsyslog (8.2001.0-1ubuntu1.3) ...
Processing triggers for systemd (245.4-4ubuntu3.17) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2.2) ...
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-110-generic
Processing triggers for ca-certificates (20211016~18.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Upvotes: 3