Yum and Rpm Daily Work Summary
This article used to walk you through some commonly ################################################################ Yum command cheat sheet 01/19/2019Remove or erase a installed package with its dependencies: rpm -ev <package name> yum erase <package name> if it is needed,remove fail,or you can use rpm -ev containerd.io error: Failed dependencies: containerd.io >= 1.2.2-3 is needed by (installed) docker-ce-3:18.09.2-3.el7.x86_64 Remove or erase a installed package without checking for dependencies rpm -ev --nodeps <package name> For example: rpm -ev --nodpes containerd.io Preparing packages... containerd.io-1.2.2-3.3.el7.x86_64 02/24/2019This command will install a single rpm file if it meets all dependencies,otherwise install will fail and the output will give you the lower level rpms missed. rpm -ivh <rpm name> For example: rpm -ivh 416b2856f8dbb6f07a50a46018fee8596479ebc0eaeec069c26bedfa29033315-kubeadm-1.13.2-0.x86_64.rpm warning: 416b2856f8dbb6f07a50a46018fee8596479ebc0eaeec069c26bedfa29033315-kubeadm-1.13.2-0.x86_64.rpm: Header V4 RSA/SHA512 Signature,key ID 3e1ba8d5: NOKEY error: Failed dependencies: cri-tools >= 1.11.0 is needed by kubeadm-1.13.2-0.x86_64 kubectl >= 1.6.0 is needed by kubeadm-1.13.2-0.x86_64 kubelet >= 1.6.0 is needed by kubeadm-1.13.2-0.x86_64 kubernetes-cni >= 0.6.0 is needed by kubeadm-1.13.2-0.x86_64 02/25/2019These two both work: rpm -qa | grep <package name> yum list installed | grep <package name> For example: rpm -qa | grep docker docker-ce-18.06.1.ce-3.el7.x86_64 yum list installed | grep docker docker-ce.x86_64 18.06.1.ce-3.el7 installed 02/27/2019Find packages that provide the queried file,for example: yum provides host 32:bind-utils-9.9.4-14.el7.x86_64 : Utilities for querying DNS name servers Repo : Local-Base Matched from: Filename : /usr/bin/host ... 03/01/2019If you have a local rpm file,you can list its dependencies by running: rpm -qpR <rpm name> For example: rpm -qpR 416b2856f8dbb6f07a50a46018fee8596479ebc0eaeec069c26bedfa29033315-kubeadm-1.13.2-0.x86_64.rpm warning: 416b2856f8dbb6f07a50a46018fee8596479ebc0eaeec069c26bedfa29033315-kubeadm-1.13.2-0.x86_64.rpm: Header V4 RSA/SHA512 Signature,key ID 3e1ba8d5: NOKEY cri-tools >= 1.11.0 kubectl >= 1.6.0 kubelet >= 1.6.0 kubernetes-cni >= 0.6.0 rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 03/02/2019If you see The general form of an rpm upgrade command is rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... This upgrades or installs the package currently installed to a newer version. This is the same as install,except all other version(s) of the package are removed after the new package is installed. rpm {-F|--freshen} [install-options] PACKAGE_FILE ... This will upgrade packages,but only ones for which an earlier version is installed. Both But for upgrading the previously installed package you can use any of
For example,upgrade rpm -Fvh ansible-2.7.8-1.el7.ans.noarch.rpm warning: ansible-2.7.8-1.el7.ans.noarch.rpm: Header V4 RSA/SHA1 Signature,key ID 442667a9: NOKEY Preparing... ################################# [100%] Updating / installing... 1:ansible-2.7.8-1.el7.ans ################################# [ 50%] Cleaning up / removing... 2:ansible-2.4.6.0-1.el7.ans ################################# [100%] (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |