DNF and SSH Command Guide
1. Command: dnf update -y
- Purpose: Updates all installed packages to the latest versions.
- Breakdown:
- dnf: Package manager for RHEL-based distros
- update: Command to update packages
- -y: Automatically confirms prompts
2. Command: dnf check-update
- Purpose: Lists all available package updates without installing them.
- Use this to preview pending updates.
3. SSH Command in Image:
ssh -i .ssh/workernode.key opc@10.250.133.199
- Meaning:
- -i .ssh/workernode.key: Use this private key for authentication
- opc@10.250.133.199: Login as user "opc" to host 10.250.133.199
4. Invalid Command: dnf yum clean
- Correct usage:
- dnf clean all
- Purpose: Cleans metadata, packages, and cache
- yum clean all is for older systems using yum
5. Command: dnf update -y --nobest
- Purpose: Updates packages but allows installing not-the-best-but-compatible versions
- Use Case: Helps resolve version conflicts or dependency issues
6. Command: dnf info kubelet
- Purpose: Shows detailed information about the kubelet package
Example Output:
Available Packages
Name : kubelet
Version : 1.29.2
Release :0
Architecture : x86_64
Size : 23 M
Repository : kubernetes
URL : https://kubernetes.io
Summary : Kubernetes Node Agent
Description : The kubelet is the primary "node agent" that runs on each node. It registers the node
with the Kubernetes cluster, monitors pods, and communicates with the control plane.
7. If 'dnf info kubelet' gives 'No Match Found':
Add Kubernetes repo:
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
Then run:
sudo dnf clean all
sudo dnf makecache
sudo dnf info kubelet
Use cases:
- To install kubelet
- Pin specific version
- Setup Kubernetes node