{"id":42960,"date":"2023-03-10T17:44:38","date_gmt":"2023-03-10T09:44:38","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=42960"},"modified":"2023-03-10T17:44:38","modified_gmt":"2023-03-10T09:44:38","slug":"centos-rhel-update","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/centos-rhel-update.html","title":{"rendered":"CentOS \/RHEL \u7cfb\u7edf\u66f4\u65b0\u5b89\u5168\u8865\u4e01\u7684\u65b9\u6cd5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u5176\u4e2d\u4e00\u4e2a\u6700\u91cd\u8981\u7684\u9700\u6c42\u5c31\u662f\u4fdd\u6301\u5b9a\u671f\u66f4\u65b0\u6700\u65b0\u7684\u5b89\u5168\u8865\u4e01\uff0c\u6216\u8005\u4e3a\u76f8\u5e94\u7684 Linux \u7248\u672c\u66f4\u65b0\u53ef\u7528\u7684\u5b89\u5168\u8865\u4e01\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u5206\u4eab\u5982\u4f55\u5728 CentOS\/RHEL 7\/6 \u7248\u672c\u4e2d\u8bbe\u7f6e\u5728\u9700\u8981\u65f6\u81ea\u52a8\u66f4\u65b0\u91cd\u8981\u7684\u5b89\u5168\u8865\u4e01\u3002\u548c\u5b83\u540c\u4e00\u5bb6\u65cf\u7684\u5176\u5b83 Linux \u7248\u672c\uff08Fedora \u6216 Scientific Linux\uff09\u4e2d\u53ef\u4ee5\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\u8fdb\u884c\u914d\u7f6e\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u5728 CentOS\/RHEL7 \u7cfb\u7edf\u4e0a\u914d\u7f6e\u81ea\u52a8\u5b89\u5168\u66f4\u65b0<\/strong><\/div>\n

\u5728 CentOS\/RHEL 7\/6 \u7cfb\u7edf\u4e0a\uff0c\u4f60\u9700\u8981\u5b89\u88c5\u4e0b\u9762\u7684\u5b89\u88c5\u5305\uff1a<\/p>\n

# yum update -y ; yum install yum-cron -y<\/pre>\n

\u5b89\u88c5\u5b8c\u6210\u4ee5\u540e\uff0c\u6253\u5f00\/etc\/yum\/yum-cron.conf<\/span>\uff0c\u7136\u540e\u627e\u5230\u4e0b\u9762\u8fd9\u4e9b\u884c\u5185\u5bb9\uff0c\u4f60\u5fc5\u987b\u786e\u4fdd\u5b83\u4eec\u7684\u503c\u548c\u4e0b\u9762\u5c55\u793a\u7684\u4e00\u6837<\/p>\n

update_messages = yes\r\ndownload_updates = yes\r\napply_updates = yes\r\n<\/pre>\n

\u7b2c\u4e00\u884c\u8868\u660e\u81ea\u52a8\u66f4\u65b0\u547d\u4ee4\u884c\u5e94\u8be5\u50cf\u8fd9\u6837\uff1a<\/p>\n

# yum --security upgrade<\/pre>\n

\u800c\u5176\u5b83\u7684\u884c\u4fdd\u8bc1\u4e86\u80fd\u591f\u901a\u77e5\u5e76\u81ea\u52a8\u4e0b\u8f7d\u3001\u5b89\u88c5\u5b89\u5168\u5347\u7ea7\u3002
\n\u4e3a\u4e86\u4f7f\u6765\u81ea root@localhost \u7684\u901a\u77e5\u80fd\u591f\u901a\u8fc7\u90ae\u4ef6\u53d1\u9001\u7ed9\u540c\u4e00\u8d26\u6237\uff08\u518d\u6b21\u8bf4\u660e\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u5176\u4ed6\u8d26\u6237\uff0c\u5982\u679c\u4f60\u60f3\u8fd9\u6837\u7684\u8bdd\uff09\uff0c\u4e0b\u9762\u8fd9\u4e9b\u884c\u4e5f\u662f\u5fc5\u987b\u7684\u3002<\/p>\n

emit_via = email\r\nemail_from = root@localhost\r\nemail_to = root\r\n<\/pre>\n
\u5728 CentOS\/RHEL 6 \u4e0a\u542f\u7528\u81ea\u52a8\u5b89\u5168\u66f4\u65b0<\/strong><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c cron \u4efb\u52a1\u88ab\u914d\u7f6e\u6210\u4e86\u7acb\u5373\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6240\u6709\u66f4\u65b0\uff0c\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5728 \/etc\/sysconfig\/yum-cron<\/span> \u914d\u7f6e\u6587\u4ef6\u4e2d\u628a\u4e0b\u9762\u4e24\u4e2a\u53c2\u6570\u6539\u4e3ayes<\/span>\uff0c\u4ece\u800c\u6539\u53d8\u8fd9\u79cd\u884c\u4e3a\u3002<\/p>\n

# \u4e0d\u8981\u5b89\u88c5\uff0c\u53ea\u505a\u68c0\u67e5\uff08\u6709\u6548\u503c\uff1a yes|no\uff09\r\nCHECK_ONLY=yes\r\n# \u4e0d\u8981\u5b89\u88c5\uff0c\u53ea\u505a\u68c0\u67e5\u548c\u4e0b\u8f7d\uff08\u6709\u6548\u503c\uff1a yes|no\uff09\r\n# \u8981\u6c42 CHECK_ONLY=yes\uff08\u5148\u8981\u68c0\u67e5\u540e\u624d\u53ef\u4ee5\u77e5\u9053\u8981\u4e0b\u8f7d\u4ec0\u4e48\uff09\r\nDOWNLOAD_ONLY=yes\r\n<\/pre>\n

\u4e3a\u4e86\u542f\u7528\u5173\u4e8e\u5b89\u88c5\u5305\u66f4\u65b0\u7684\u90ae\u4ef6\u901a\u77e5\uff0c\u4f60\u9700\u8981\u628aMAILTO<\/span> \u53c2\u6570\u8bbe\u7f6e\u4e3a\u4e00\u4e2a\u6709\u6548\u7684\u90ae\u4ef6\u5730\u5740\u3002<\/p>\n

# \u9ed8\u8ba4\u60c5\u51b5\u4e0b MAILTO \u662f\u6ca1\u6709\u8bbe\u7f6e\u7684\uff0ccrond \u4f1a\u5c06\u8f93\u51fa\u53d1\u9001\u90ae\u4ef6\u7ed9\u81ea\u5df1\r\n# \uff08\u6267\u884c cron \u7684\u7528\u6237\uff0c\u8fd9\u91cc\u662f root\uff09\r\n# \u4f8b\u5b50\uff1a MAILTO=root\r\nMAILTO=admin@tecmint.com\r\n<\/pre>\n

\u6700\u540e\uff0c\u6253\u5f00\u5e76\u542f\u7528yum-cron<\/span> \u670d\u52a1\uff1a<\/p>\n

------------- On CentOS\/RHEL 7 -------------\r\nsystemctl start yum-cron\r\nsystemctl enable yum-cron\r\n------------- On CentOS\/RHEL 6 -------------\r\n# service yum-cron start\r\n# chkconfig --level 35 yum-cron on<\/pre>\n

\u606d\u559c\u4f60\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u7684\u5728 CentOS\/RHEL 7\/6 \u7cfb\u7edf\u4e0a\u8bbe\u7f6e\u4e86\u81ea\u52a8\u5347\u7ea7\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u8ba8\u8bba\u4e86\u5982\u4f55\u4fdd\u6301\u4f60\u7684\u670d\u52a1\u5668\u5b9a\u671f\u66f4\u65b0\u6216\u5347\u7ea7\u6700\u65b0\u7684\u5b89\u5168\u8865\u4e01\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u5f53\u65b0\u7684\u8865\u4e01\u88ab\u5e94\u7528\u65f6\u4f60\u81ea\u5df1\u80fd\u591f\u77e5\u9053\uff0c\u4f60\u4e5f\u5b66\u4e60\u4e86\u5982\u4f55\u914d\u7f6e\u90ae\u4ef6\u901a\u77e5\u3002<\/p>\n

\n

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

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/centos-rhel-update.html<\/a>\u7f16\u8f91\u5458\uff1a\u5218\u5cf0\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u5176\u4e2d\u4e00\u4e2a\u6700\u91cd\u8981\u7684\u9700\u6c42\u5c31\u662f\u4fdd\u6301\u5b9a\u671f\u66f4\u65b0\u6700\u65b0\u7684\u5b89\u5168\u8865\u4e01\uff0c\u6216\u8005\u4e3a\u76f8\u5e94\u7684 Linux \u7248\u672c\u66f4\u65b0\u53ef\u7528\u7684\u5b89\u5168\u8865\u4e01\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u5206\u4eab\u5982\u4f55\u5728 CentOS\/RHEL 7\/6 \u7248\u672c\u4e2d\u8bbe\u7f6e\u5728\u9700\u8981\u65f6\u81ea\u52a8\u66f4\u65b0\u91cd\u8981\u7684\u5b89\u5168\u8865\u4e01\u3002\u548c\u5b83\u540c\u4e00\u5bb6\u65cf\u7684\u5176\u5b83 Linux \u7248\u672c\uff08Fedora \u6216 Scientific Linux\uff09\u4e2d\u53ef\u4ee5\u7528\u7c7b\u4f3c\u7684\u65b9\u6cd5\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n","protected":false},"author":116,"featured_media":8829,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[109],"class_list":["post-42960","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-linux"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/42960","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\/116"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=42960"}],"version-history":[{"count":30,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/42960\/revisions"}],"predecessor-version":[{"id":266807,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/42960\/revisions\/266807"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/8829"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=42960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=42960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=42960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}