{"id":160296,"date":"2019-10-15T11:00:08","date_gmt":"2019-10-15T03:00:08","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=160296"},"modified":"2019-09-27T17:53:33","modified_gmt":"2019-09-27T09:53:33","slug":"linux-yum-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-yum-command.html","title":{"rendered":"\u6559\u4f60\u73a9\u8f6cLinux\u2014yum \u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nyum\uff08 Yellow dog Updater, Modified\uff09\u662f\u4e00\u4e2a\u5728Fedora\u548cRedHat\u4ee5\u53caSUSE\u4e2d\u7684Shell\u524d\u7aef\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u3002
\n\u57fa\u65bcRPM\u5305\u7ba1\u7406\uff0c\u80fd\u591f\u4ece\u6307\u5b9a\u7684\u670d\u52a1\u5668\u81ea\u52a8\u4e0b\u8f7dRPM\u5305\u5e76\u4e14\u5b89\u88c5\uff0c\u53ef\u4ee5\u81ea\u52a8\u5904\u7406\u4f9d\u8d56\u6027\u5173\u7cfb\uff0c\u5e76\u4e14\u4e00\u6b21\u5b89\u88c5\u6240\u6709\u4f9d\u8d56\u7684\u8f6f\u4f53\u5305\uff0c\u65e0\u987b\u7e41\u7410\u5730\u4e00\u6b21\u6b21\u4e0b\u8f7d\u3001\u5b89\u88c5\u3002
\nyum\u63d0\u4f9b\u4e86\u67e5\u627e\u3001\u5b89\u88c5\u3001\u5220\u9664\u67d0\u4e00\u4e2a\u3001\u4e00\u7ec4\u751a\u81f3\u5168\u90e8\u8f6f\u4ef6\u5305\u7684\u547d\u4ee4\uff0c\u800c\u4e14\u547d\u4ee4\u7b80\u6d01\u800c\u53c8\u597d\u8bb0\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

yum \u8bed\u6cd5<\/strong><\/div>\n
yum [options] [command] [package ...]<\/pre>\n

options\uff1a\u53ef\u9009\uff0c\u9009\u9879\u5305\u62ec-h\uff08\u5e2e\u52a9\uff09\uff0c-y\uff08\u5f53\u5b89\u88c5\u8fc7\u7a0b\u63d0\u793a\u9009\u62e9\u5168\u90e8\u4e3a\"yes\"\uff09\uff0c-q\uff08\u4e0d\u663e\u793a\u5b89\u88c5\u7684\u8fc7\u7a0b\uff09\u7b49\u7b49\u3002
\ncommand\uff1a\u8981\u8fdb\u884c\u7684\u64cd\u4f5c\u3002
\npackage\uff1a\u64cd\u4f5c\u7684\u5bf9\u8c61\u3002<\/p>\n

yum\u5e38\u7528\u547d\u4ee4<\/strong><\/div>\n

1.\u5217\u51fa\u6240\u6709\u53ef\u66f4\u65b0\u7684\u8f6f\u4ef6\u6e05\u5355\u547d\u4ee4\uff1ayum check-update
\n2.\u66f4\u65b0\u6240\u6709\u8f6f\u4ef6\u547d\u4ee4\uff1ayum update
\n3.\u4ec5\u5b89\u88c5\u6307\u5b9a\u7684\u8f6f\u4ef6\u547d\u4ee4\uff1ayum install \n4.\u4ec5\u66f4\u65b0\u6307\u5b9a\u7684\u8f6f\u4ef6\u547d\u4ee4\uff1ayum update <\/package_name>\n5.\u5217\u51fa\u6240\u6709\u53ef\u5b89\u88dd\u7684\u8f6f\u4ef6\u6e05\u5355\u547d\u4ee4\uff1ayum list
\n6.\u5220\u9664\u8f6f\u4ef6\u5305\u547d\u4ee4\uff1ayum remove <\/package_name>\n7.\u67e5\u627e\u8f6f\u4ef6\u5305 \u547d\u4ee4\uff1ayum search
\n8.\u6e05\u9664\u7f13\u5b58\u547d\u4ee4:<\/p>\n

    \n
  • yum clean packages: \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684\u8f6f\u4ef6\u5305<\/li>\n
  • yum clean headers: \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684 headers<\/li>\n
  • yum clean oldheaders: \u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u65e7\u7684 headers<\/li>\n
  • yum clean, yum clean all (= yum clean packages; yum clean oldheaders) :\u6e05\u9664\u7f13\u5b58\u76ee\u5f55\u4e0b\u7684\u8f6f\u4ef6\u5305\u53ca\u65e7\u7684headers<\/li>\n<\/ul>\n
    \u5b9e\u4f8b 1<\/strong><\/span><\/div>\n

    \u5b89\u88c5 pam-devel<\/p>\n

    [root@www ~]# yum install pam-devel\r\nSetting up Install Process\r\nParsing package install arguments\r\nResolving Dependencies  < ==\u5148\u68c0\u67e5\u8f6f\u4ef6\u7684\u5c5e\u6027\u76f8\u4f9d\u95ee\u9898\r\n--> Running transaction check\r\n---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be updated\r\n--> Processing Dependency: pam = 0.99.6.2-4.el5 for package: pam-devel\r\n--> Running transaction check\r\n---> Package pam.i386 0:0.99.6.2-4.el5 set to be updated\r\nfilelists.xml.gz          100% |=========================| 1.6 MB    00:05\r\nfilelists.xml.gz          100% |=========================| 138 kB    00:00\r\n-> Finished Dependency Resolution\r\n\u2026\u2026(\u7701\u7565)<\/pre>\n
    \u5b9e\u4f8b 2<\/strong><\/span><\/div>\n

    \u79fb\u9664 pam-devel<\/p>\n

    [root@www ~]# yum remove pam-devel\r\nSetting up Remove Process\r\nResolving Dependencies  < ==\u540c\u6837\u7684\uff0c\u5148\u89e3\u51b3\u5c5e\u6027\u76f8\u4f9d\u7684\u95ee\u9898\r\n--> Running transaction check\r\n---> Package pam-devel.i386 0:0.99.6.2-4.el5 set to be erased\r\n--> Finished Dependency Resolution\r\n\r\nDependencies Resolved\r\n\r\n=============================================================================\r\n Package                 Arch       Version          Repository        Size\r\n=============================================================================\r\nRemoving:\r\n pam-devel               i386       0.99.6.2-4.el5   installed         495 k\r\n\r\nTransaction Summary\r\n=============================================================================\r\nInstall      0 Package(s)\r\nUpdate       0 Package(s)\r\nRemove       1 Package(s)  < ==\u8fd8\u597d\uff0c\u5e76\u6ca1\u6709\u5c5e\u6027\u76f8\u4f9d\u7684\u95ee\u9898\uff0c\u5355\u7eaf\u79fb\u9664\u4e00\u4e2a\u8f6f\u4ef6\r\n\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\nRunning rpm_check_debug\r\nRunning Transaction Test\r\nFinished Transaction Test\r\nTransaction Test Succeeded\r\nRunning Transaction\r\n  Erasing   : pam-devel                    ######################### [1\/1]\r\n\r\nRemoved: pam-devel.i386 0:0.99.6.2-4.el5\r\nComplete!<\/pre>\n
    \u5b9e\u4f8b 3<\/strong><\/span><\/div>\n

    \u5229\u7528 yum \u7684\u529f\u80fd\uff0c\u627e\u51fa\u4ee5 pam \u4e3a\u5f00\u5934\u7684\u8f6f\u4ef6\u540d\u79f0\u6709\u54ea\u4e9b\uff1f<\/p>\n

    [root@www ~]# yum list pam*\r\nInstalled Packages\r\npam.i386                  0.99.6.2-3.27.el5      installed\r\npam_ccreds.i386           3-5                    installed\r\npam_krb5.i386             2.2.14-1               installed\r\npam_passwdqc.i386         1.0.2-1.2.2            installed\r\npam_pkcs11.i386           0.5.3-23               installed\r\npam_smb.i386              1.1.7-7.2.1            installed\r\nAvailable Packages < ==\u5e95\u4e0b\u5219\u662f\u300e\u53ef\u5347\u7ea7\u300f\u7684\u6216\u300e\u672a\u5b89\u88c5\u300f\u7684\r\npam.i386                  0.99.6.2-4.el5         base\r\npam-devel.i386            0.99.6.2-4.el5         base\r\npam_krb5.i386             2.2.14-10              base<\/pre>\n

    <\/keyword><\/package_name>\n","protected":false},"excerpt":{"rendered":"

    yum [options] [command] [package …] options\uff1a\u53ef\u9009\uff0c\u9009\u9879\u5305\u62ec-h […]<\/p>\n","protected":false},"author":1470,"featured_media":160300,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-160296","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1470"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=160296"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160296\/revisions"}],"predecessor-version":[{"id":160328,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/160296\/revisions\/160328"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/160300"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=160296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=160296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=160296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}