{"id":52018,"date":"2023-06-04T06:00:45","date_gmt":"2023-06-03T22:00:45","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=52018"},"modified":"2023-06-04T06:00:45","modified_gmt":"2023-06-03T22:00:45","slug":"yum-history","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/yum-history.html","title":{"rendered":"\u4f7f\u7528Yum \u67e5\u627e\u8f6f\u4ef6\u7684\u5b89\u88c5\u6216\u8005\u5220\u9664\u8bb0\u5f55"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nYum \u662f RHEL\/CentOS \u7684\u4e00\u4e2a\u57fa\u4e8e rpm \u7684\u4ea4\u4e92\u5f0f\u9ad8\u7ea7\u5305\u7ba1\u7406\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u7528\u5b83\u6765\u5b89\u88c5\u65b0\u7684\u8f6f\u4ef6\u5305\u3001\u5378\u8f7d\u6216\u6e05\u9664\u65e7\u7684\/\u4e0d\u9700\u8981\u7684\u8f6f\u4ef6\u5305\u3002\u5b83\u53ef\u4ee5\u81ea\u52a8\u8fd0\u884c\u7cfb\u7edf\u66f4\u65b0\uff0c\u5e76\u6267\u884c\u4f9d\u8d56\u5206\u6790\uff0c\u5bf9\u5df2\u5b89\u88c5\u7684\u6216\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u8fdb\u884c\u67e5\u8be2\u7b49\u7b49\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u89e3\u91ca\u5982\u4f55\u67e5\u770b Yum \u4e8b\u52a1\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u4ee5\u4fbf\u4e8e\u4e86\u89e3\u6709\u5173\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u4ee5\u53ca\u4ece\u7cfb\u7edf\u4e2d\u6240\u5378\u8f7d\/\u6e05\u9664\u8f6f\u4ef6\u5305\u7684\u4fe1\u606f\u3002<\/p>\n

\"\"<\/a><\/p>\n

\u63a8\u8350\u9605\u8bfb\uff1a<\/strong>\u00a020 \u6761\u5173\u4e8e Linux \u8f6f\u4ef6\u5305\u7ba1\u7406\u7684 Yum \u547d\u4ee4<\/p>\n

\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5982\u4f55\u4f7f\u7528 Yum \u5386\u53f2\u547d\u4ee4\u7684\u793a\u4f8b\u3002<\/p>\n

\u67e5\u770b\u5b8c\u6574\u7684 Yum \u5386\u53f2<\/strong><\/div>\n

\u8981\u67e5\u770b Yum \u4e8b\u52a1\u5b8c\u6574\u7684\u5386\u53f2\u8bb0\u5f55\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u7136\u540e\u5c06\u663e\u793a\uff1a\u4e8b\u52a1 ID\u3001\u6267\u884c\u7279\u5b9a\u64cd\u4f5c\u7684\u7528\u6237\u3001\u64cd\u4f5c\u53d1\u751f\u7684\u65e5\u671f\u548c\u65f6\u95f4\u3001\u5b9e\u9645\u64cd\u4f5c\u4ee5\u53ca\u4efb\u4f55\u9519\u8bef\u7684\u9644\u52a0\u4fe1\u606f\u4e0e\u64cd\u4f5c\uff1a<\/p>\n

# yum history \r\n<\/pre>\n

\"\"<\/p>\n

\u4f7f\u7528 Yum \u67e5\u627e\u8f6f\u4ef6\u5305\u4fe1\u606f\/strong><\/strong><\/div>\n

history<\/span> \u7684\u5b50\u547d\u4ee4\uff1ainfo<\/span>\/list<\/span>\/summary<\/span>\u53ef\u4ee5\u5c06\u4e8b\u52a1 ID \u6216\u5305\u540d\u4f5c\u4e3a\u53c2\u6570\u3002\u6b64\u5916\uff0clist<\/span> \u5b50\u547d\u4ee4\u53ef\u4ee5\u52a0\u4e0a\u7279\u6b8a\u7684\u53c2\u6570\uff0call<\/span> \u8868\u793a\u6240\u6709\u7684\u4e8b\u52a1\u3002<\/p>\n

\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u5148\u524d\u7684\u5386\u53f2\uff1a<\/p>\n

# yum history list all\r\n<\/pre>\n

\u5e76\u4e14\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684 info<\/span> \u547d\u4ee4\u67e5\u770b\u6d89\u53ca\u6307\u5b9a\u8f6f\u4ef6\u5305\u7684\u4e8b\u52a1\u8be6\u60c5\uff0c\u4f8b\u5982 httpd<\/span>\uff1a<\/p>\n

# yum history info httpd\r\n<\/pre>\n

\"\"<\/p>\n

\u53d1\u51fa\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u83b7\u5f97\u5305\u542b httpd<\/span> \u8f6f\u4ef6\u5305\u7684\u4e8b\u52a1\u7684\u6458\u8981\uff1a<\/p>\n

# yum history summary httpd\r\n<\/pre>\n

\"\"<\/p>\n

\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4e8b\u52a1\u7684 ID \u6765\u67e5\u627e\uff0c\u4ee5\u4e0b\u547d\u4ee4\u4f1a\u663e\u793a ID \u4e3a 15<\/span> \u7684\u4e8b\u52a1\u7684\u8be6\u60c5\u3002<\/p>\n

# yum history info 15\r\n<\/pre>\n

\"\"<\/p>\n

\u4f7f\u7528 yum history \u67e5\u627e\u8f6f\u4ef6\u5305\u4e8b\u52a1\u4fe1\u606f<\/strong><\/div>\n

\u6709\u4e00\u4e9b\u7528\u4e8e\u6253\u5370\u67d0\u4e2a\u6216\u591a\u4e2a\u8f6f\u4ef6\u5305\u4e8b\u52a1\u8be6\u60c5\u7684\u5b50\u547d\u4ee4\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528 package-list<\/span> \u6216\u00a0package_info<\/span> \u67e5\u770b\u5173\u4e8e httpd<\/span> \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u4f8b\u5982\uff1a<\/p>\n

# yum history package-list httpd\r\n\u6216\r\n# yum history package-info httpd\r\n<\/pre>\n

\"\"<\/p>\n

\u8981\u5f97\u5230\u591a\u4e2a\u8f6f\u4ef6\u5305\u7684\u8bb0\u5f55\uff0c\u6211\u4eec\u53ef\u4ee5\u8fd0\u884c\uff1a<\/p>\n

# yum history package-list httpd epel-release\r\n\u6216\r\n# yum history packages-list httpd epel-release\r\n<\/pre>\n

\"\"<\/p>\n

\u4f7f\u7528 Yum \u56de\u6eda\u8f6f\u4ef6\u5305<\/strong><\/div>\n

\u6b64\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b history<\/span> \u7684\u5b50\u547d\u4ee4\u53ef\u4ee5\u8ba9\u6211\u4eec\u64a4\u9500\/\u91cd\u505a\/\u56de\u6eda\u4e8b\u52a1\u3002<\/p>\n

    \n
  1. undo<\/span> - \u4f1a\u64a4\u9500\u4e00\u4e2a\u6307\u5b9a\u7684\u4e8b\u52a1\u3002<\/li>\n
  2. redo<\/span> - \u91cd\u590d\u4e00\u6b21\u6307\u5b9a\u7684\u4e8b\u52a1\u3002<\/li>\n
  3. rollback<\/span> - \u64a4\u9500\u6307\u5b9a\u4e8b\u52a1\u4e4b\u540e\u7684\u6240\u6709\u4e8b\u52a1\u3002<\/li>\n<\/ol>\n

    \u5b83\u4eec\u91c7\u7528\u5355\u4e2a\u4e8b\u52a1 id \u6216\u5173\u952e\u5b57 last<\/span> \u548c\u4ece\u6700\u540e\u4e00\u4e2a\u4e8b\u52a1\u5f00\u59cb\u7684\u504f\u79fb\u91cf\u3002<\/p>\n

    \u4f8b\u5982\uff0c\u5047\u8bbe\u6211\u4eec\u5df2\u7ecf\u505a\u4e86 60 \u4e2a\u4e8b\u52a1\uff0clast<\/span> \u662f\u6307\u4e8b\u52a1 60\uff0clast-4<\/span> \u6307\u5411\u4e8b\u52a1 56\u3002<\/p>\n

    \u63a8\u8350\u9605\u8bfb\uff1a<\/strong>\u00a0\u600e\u6837\u4f7f\u7528 yum-utils<\/span> \u6765\u7ef4\u62a4\u4ee5\u53ca\u52a0\u901f Yum<\/p>\n

    \u4ee5\u4e0a\u5b50\u547d\u4ee4\u662f\u5982\u4e0b\u5de5\u4f5c\u7684\uff1a\u5982\u679c\u6211\u4eec\u6709 5 \u4e2a\u4e8b\u52a1\u2014\u2014V\uff0cW\uff0cX\uff0cY \u548c Z\uff0c\u5176\u4e2d\u5206\u522b\u662f\u5b89\u88c5\u5404\u4e2a\u8f6f\u4ef6\u5305\u7684\u3002<\/p>\n

    # yum history undo 2    #\u5c06\u5220\u9664\u8f6f\u4ef6\u5305 W\r\n# yum history redo 2    #\u5c06\u91cd\u65b0\u5b89\u88c5\u8f6f\u4ef6\u5305 W\r\n# yum history rollback 2    #\u5c06\u5220\u9664\u8f6f\u4ef6\u5305 X\u3001 Y \u548c Z\r\n<\/pre>\n

    \u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u4e8b\u52a1 2 \u662f\u4e00\u4e2a\u66f4\u65b0\u64cd\u4f5c\uff0c\u5982\u4e0b\u6240\u793a\uff0c\u4ee5\u4e0b redo<\/span> \u547d\u4ee4\u5c06\u91cd\u590d\u4e8b\u52a1 2 \u76f4\u5230\u6240\u6709\u8f6f\u4ef6\u5305\u5230\u66f4\u65b0\u5230\u5f53\u524d\u65f6\u95f4\u7684\u6700\u65b0\u7248\u672c\uff1a<\/p>\n

    # yum history | grep -w \"2\"\r\n<\/pre>\n

    \"\"<\/p>\n

    # yum history redo 2\r\n<\/pre>\n

    \"\"<\/p>\n

    \u5185\u8054\u4ee3\u7801\u5757<\/span>redo<\/code> \u5b50\u547d\u4ee4\u540c\u6837\u53ef\u4ee5\u5728\u6211\u4eec\u6307\u5b9a\u4e8b\u52a1\u4e4b\u524d\u52a0\u4e0a\u4e00\u4e9b\u53ef\u9009\u7684\u53c2\u6570\uff1a<\/p>\n

      \n
    1. force-reinstall<\/span> - \u91cd\u65b0\u5b89\u88c5\u6240\u6709\u5728\u6b64\u4e8b\u52a1\u4e2d\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\uff08\u901a\u8fc7 yum install<\/span>\u3001upgrade<\/span>\u6216downgrade<\/span> \uff09\u3002<\/li>\n
    2. force-remove<\/span> - \u79fb\u9664\u6240\u6709\u5df2\u7ecf\u66f4\u65b0\u6216\u56de\u6eda\u7684\u8f6f\u4ef6\u5305\u3002<\/li>\n<\/ol>\n
      # yum history redo force-reinstall 16\r\n<\/pre>\n

      \"\"<\/p>\n

      \u67e5\u627e Yum \u5386\u53f2\u6570\u636e\u5e93\u548c\u6765\u6e90\u4fe1\u606f<\/strong><\/div>\n

      \u8fd9\u4e9b\u5b50\u547d\u4ee4\u4e3a\u6211\u4eec\u63d0\u4f9b\u6709\u5173\u5386\u53f2\u8bb0\u5f55\u6570\u636e\u5e93\u548c\u5176\u5b83\u4fe1\u606f\u6765\u6e90\u7684\u4fe1\u606f\uff1a<\/p>\n

        \n
      1. addon-info<\/span> - \u63d0\u4f9b\u66f4\u591a\u7684\u4fe1\u606f\u6765\u6e90\u3002<\/li>\n
      2. stats<\/span> - \u663e\u793a\u5f53\u524d\u5386\u53f2\u6570\u636e\u5e93\u7684\u7edf\u8ba1\u4fe1\u606f\u3002<\/li>\n
      3. sync<\/span> - \u4f7f\u6211\u4eec\u80fd\u591f\u66f4\u6539\u4e3a\u6240\u6709\u5df2\u5b89\u88c5\u8f6f\u4ef6\u5305\u5b58\u50a8\u7684rpmdb<\/span>\/yumdb<\/span> \u6570\u636e\u3002<\/li>\n<\/ol>\n

        \u770b\u4e00\u4e0b\u4ee5\u4e0b\u7684\u547d\u4ee4\u7684\u5b50\u547d\u4ee4\u5b9e\u9645\u4e0a\u662f\u600e\u6837\u5de5\u4f5c\u7684\uff1a<\/p>\n

        # yum history addon-info\r\n# yum history stats\r\n# yum history sync\r\n<\/pre>\n

        \u4f7f\u7528new<\/span> \u5b50\u547d\u4ee4\u8bbe\u7f6e\u65b0\u7684\u5386\u53f2\u6587\u4ef6\uff1a<\/p>\n

        # yum history new\r\n<\/pre>\n

        \u6211\u4eec\u53ef\u4ee5\u5728 yum \u624b\u518c\u9875\u627e\u5230\u5173\u4e8e Yumhistory<\/span> \u547d\u4ee4\u548c\u5176\u5b83\u51e0\u4e2a\u547d\u4ee4\u7684\u5b8c\u6574\u4fe1\u606f\uff1a<\/p>\n

        # man yum\r\n<\/pre>\n

        \u63a8\u8350\u9605\u8bfb\uff1a<\/strong>\u00a04 \u4e2a\u4f7f\u7528 Yum <\/span>\u7981\u7528\/\u9501\u5b9a\u67d0\u4e9b\u8f6f\u4ef6\u5305\u66f4\u65b0\u7684\u65b9\u6cd5
        \n\u5c31\u662f\u8fd9\u4e48\u591a\u4e86\u3002\u5728\u672c\u7bc7\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u4ecb\u7ecd\u4e86\u5404\u79cd Yum history<\/span> \u547d\u4ee4\uff0c\u4ee5\u67e5\u770b Yum <\/span>\u4e8b\u52a1\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n


        \n

        \u4f5c\u8005\u7b80\u4ecb\uff1a<\/p>\n

        Aaron Kili \u662f Linux \u548c F.O.S.S \u7684\u7231\u597d\u8005\uff0c\u76ee\u524d\u4efb TecMint \u7684\u4f5c\u8005\uff0c\u5fd7\u5411\u662f\u4e00\u540d Linux \u7cfb\u7edf\u7ba1\u7406\u5458\u3001web \u5f00\u53d1\u8005\u3002\u4ed6\u559c\u6b22\u7528\u7535\u8111\u5de5\u4f5c\uff0c\u5e76\u70ed\u8877\u4e8e\u5206\u4eab\u77e5\u8bc6\u3002<\/p>\n


        \n

        via: http:\/\/www.tecmint.com\/view-yum-history-to-find-packages-info\/<\/p>\n

        \u4f5c\u8005\uff1aAaron Kili \u8bd1\u8005\uff1aOneNewLife \u6821\u5bf9\uff1awxy<\/p>\n

        \u672c\u6587\u7531 LCTT \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd \u8363\u8a89\u63a8\u51fa<\/p>\n

        \n

        \u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8<\/a>236-1.html<\/a><\/p>\n

        \u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/yum-history.html<\/a>\u7f16\u8f91\u5458\uff1a\u5f20\u96c4 \uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

        Yum \u662f RHEL\/CentOS \u7684\u4e00\u4e2a\u57fa\u4e8e rpm \u7684\u4ea4\u4e92\u5f0f\u9ad8\u7ea7\u5305\u7ba1\u7406\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u7528\u5b83\u6765\u5b89\u88c5\u65b0\u7684\u8f6f\u4ef6\u5305\u3001\u5378\u8f7d\u6216\u6e05\u9664\u65e7\u7684\/\u4e0d\u9700\u8981\u7684\u8f6f\u4ef6\u5305\u3002\u5b83\u53ef\u4ee5\u81ea\u52a8\u8fd0\u884c\u7cfb\u7edf\u66f4\u65b0\uff0c\u5e76\u6267\u884c\u4f9d\u8d56\u5206\u6790\uff0c\u5bf9\u5df2\u5b89\u88c5\u7684\u6216\u53ef\u7528\u7684\u8f6f\u4ef6\u5305\u8fdb\u884c\u67e5\u8be2\u7b49\u7b49\u3002<\/p>\n","protected":false},"author":643,"featured_media":52847,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-52018","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\/52018","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\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=52018"}],"version-history":[{"count":15,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/52018\/revisions"}],"predecessor-version":[{"id":274102,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/52018\/revisions\/274102"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/52847"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=52018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=52018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=52018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}