Score:0

not being able to install/remove new packages - apt --fix-broken install

fr flag

I am lost here. I am trying to install openssh-server on my ubuntu laptop but there some conflicts I can't fix.

$ sudo apt install openssh-server
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:
 kubeadm : Depends: kubernetes-cni (>= 0.8.7)
 kubelet : Depends: kubernetes-cni (>= 0.8.7)
 openssh-server : Depends: openssh-sftp-server
                  Recommends: ncurses-term but it is not going to be installed
                  Recommends: ssh-import-id but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).


$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  kubernetes-cni
The following NEW packages will be installed:
  kubernetes-cni
0 upgraded, 1 newly installed, 0 to remove and 76 not upgraded.
7 not fully installed or removed.
Need to get 0 B/25.0 MB of archives.
After this operation, 72.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
dpkg: regarding .../kubernetes-cni_0.8.7-00_amd64.deb containing kubernetes-cni:
 containernetworking-plugins conflicts with kubernetes-cni
  kubernetes-cni (version 0.8.7-00) is to be installed.

dpkg: error processing archive /var/cache/apt/archives/kubernetes-cni_0.8.7-00_amd64.deb (--unpack):
 conflicting packages - not installing kubernetes-cni
Errors were encountered while processing:
 /var/cache/apt/archives/kubernetes-cni_0.8.7-00_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Also tried the following:

$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/kubernetes-cni_0.8.7-00_amd64.deb
dpkg: regarding .../kubernetes-cni_0.8.7-00_amd64.deb containing kubernetes-cni:
 containernetworking-plugins conflicts with kubernetes-cni
  kubernetes-cni (version 0.8.7-00) is to be installed.

dpkg: error processing archive /var/cache/apt/archives/kubernetes-cni_0.8.7-00_amd64.deb (--install):
 conflicting packages - not installing kubernetes-cni
Errors were encountered while processing:
 /var/cache/apt/archives/kubernetes-cni_0.8.7-00_amd64.deb

I tried uninstalling/reinstalling containernetworking-plugins, kubelet and kubeadm but I get same error all the time.

$ sudo apt purge containernetworking-plugins
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:
 kubeadm : Depends: kubernetes-cni (>= 0.8.7)
 kubelet : Depends: kubernetes-cni (>= 0.8.7)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ sudo apt purge kubeadm
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:
 kubelet : Depends: kubernetes-cni (>= 0.8.7)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ sudo apt purge kubelet
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:
 kubeadm : Depends: kubelet (>= 1.13.0) but it is not going to be installed
           Depends: kubernetes-cni (>= 0.8.7)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Any idea how to fix this?

Score:0
fr flag

ok... got it working dealing with dpkg directly.

$ sudo dpkg -r kubeadm
(Reading database ... 204269 files and directories currently installed.)
Removing kubeadm (1.22.2-00) ...

$ sudo dpkg -r kubelet
(Reading database ... 204268 files and directories currently installed.)
Removing kubelet (1.22.2-00) ...

$ sudo dpkg -r podman
(Reading database ... 204266 files and directories currently installed.)
Removing podman (100:3.3.1-1) ...
Processing triggers for man-db (2.9.1-1) ...

and now I can install anything I need :)

Someone avatar
my flag
I don't know how this answer is gonna work (as you cannot use Dpkg because of Dpkg error 1) this seems to be a misunderstanding , I cannot even know the meaning of those commands :(
Raffa avatar
jp flag
@Algnis Those commands are simply removing / uninstalling the problematic packages so the right versions will be installed later on from the repositories as dependencies and the conflicting versions will be sorted out.
Someone avatar
my flag
@Raffa Ohk .....
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.