Score:0

I want to deploy k8s 1.26 on ubuntu22.04, but apt install kubelet fails

hk flag

I want to deploy k8s 1.26 on ubuntu22.04, but apt install kubelet fails

$ apt-get install kubelet kubeadm kubectl

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 kubelet : Depends: iptables (>= 1.4.21) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ apt-get install iptables

The following packages were automatically installed and are no longer required:
  libflashrom1 libftdi1-2 libip6tc2
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  iptables
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 0 B/261 kB of archives.
After this operation, 1,613 kB of additional disk space will be used.
(Reading database ... 73635 files and directories currently installed.)
Preparing to unpack .../iptables_1.4.21-1ubuntu1_amd64.deb ...
Unpacking iptables (1.4.21-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/iptables_1.4.21-1ubuntu1_amd64.deb (--unpack):
 unable to open '/usr/sbin/iptables-apply.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
           Errors were encountered while processing:
 /var/cache/apt/archives/iptables_1.4.21-1ubuntu1_amd64.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)


Score:0
mp flag

Try:

apt autoremove --purge
apt install iptables
Score:0
ao flag

i use this to install kubectl on my ubuntu server, and it worked fine.

snap install kubectl --classic

snap install kubeadm --classic

snap install kuberlet --classic

then, checkout the version

kubectl version --client

ref:

Install using other package management

using native package management

cn flag
Using snap doesn't create the services though: `systemctl enable kubelet.service` gives `Failed to enable unit: Unit file kubelet.service does not exist.`
lemoana avatar
ao flag
@DeanSchulze, kubectl is an executable file, not a service, and the system does not automatically create a related service. You can verify if kubectl has been successfully installed by running `kubectl version`
Score:0
ky flag

I suggest to try this:

sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get update

If these two execute fine thant try again

apt-get install kubelet kubeadm kubectl
cn flag
That doesn't fix the problem.
ognjen avatar
ky flag
can you do sudo apt-get clean and then start over with the previous commands?
I sit in a Tesla and translated this thread with Ai:

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.