{"id":257918,"date":"2022-12-17T08:41:16","date_gmt":"2022-12-17T00:41:16","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=257918"},"modified":"2022-11-25T22:41:46","modified_gmt":"2022-11-25T14:41:46","slug":"rhel-yum-dnf","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rhel-yum-dnf.html","title":{"rendered":"\u5982\u4f55\u5728 RHEL 9 \u4e0a\u521b\u5efa\u672c\u5730 Yum\/DNF \u4ed3\u5e93"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f60\u597d\uff0c\u6280\u672f\u5144\u5f1f,\u6700\u8fd1\u7ea2\u5e3d\u53d1\u5e03\u4e86\u6700\u65b0\u7684\u64cd\u4f5c\u7cfb\u7edf RHEL 9\uff0cRHEL 9 \u6ee1\u8db3\u4e86\u6df7\u5408\u4e91\u7684\u6240\u6709\u8981\u6c42\u3002\u5b83\u53ef\u4ee5\u5b89\u88c5\u5728\u7269\u7406\u670d\u52a1\u5668\u3001\u865a\u62df\u673a\u548c\u5bb9\u5668\u955c\u50cf\u4e2d\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5f53\u6211\u4eec\u6ca1\u6709\u8ba2\u9605\u7684\u65f6\u5019\uff0c\u60f3\u5b89\u88c5\u8f6f\u4ef6\u5305\u6765\u505a\u5b9e\u9a8c\uff0c\u90a3\u4e48\u8bbe\u7f6e\u672c\u5730\u7684 Yum \u6216 DNF \u4ed3\u5e93\u5c06\u662f\u5f88\u65b9\u4fbf\u7684\u3002<\/p>\n

\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728 RHEL 9 \u4e0a\u4f7f\u7528 DVD \u6216 ISO \u6587\u4ef6\u4e00\u6b65\u4e00\u6b65\u5730\u521b\u5efa\u672c\u5730 Yum\/DNF \u8d44\u6e90\u5e93\u3002<\/p>\n

\u521b\u5efa\u672c\u5730 Yum\/DNF \u8d44\u6e90\u5e93\u7684\u5148\u51b3\u6761\u4ef6:<\/p>\n

  • \u6700\u5c0f\u5316\u5b89\u88c5 RHEL 9 \u7cfb\u7edf<\/li>\n
  • \u5177\u6709\u7ba1\u7406\u6743\u9650\u7684 sudo \u7528\u6237<\/li>\n
  • RHEL 9 DVD \u6216 ISO \u6587\u4ef6<\/li>\n
    \u6302\u8f7d RHEL 9 ISO \u6587\u4ef6\u6216 DVD<\/strong><\/div>\n

    \u6211\u4eec\u5047\u8bbe RHEL 9 iso \u6587\u4ef6\u5df2\u7ecf\u88ab\u590d\u5236\u5230\u7cfb\u7edf\u4e2d\u3002\u8fd0\u884c\u4e0b\u9762\u7684\u6302\u8f7d\u547d\u4ee4\uff0c\u5c06 ISO \u6587\u4ef6\u6302\u8f7d\u5230 \/opt\/repo \u6587\u4ef6\u5939\u3002<\/p>\n

    $ sudo mkdir \/var\/repo<\/pre>\n
    $ sudo mount -o loop rhel-baseos-9.0-x86_64-dvd.iso \/var\/repo\/\r\n<\/pre>\n

    \"\"<\/p>\n

    \u5982\u679c\u662f DVD \u5149\u76d8\uff0c\u8fd0\u884c\uff1a<\/p>\n

    $ sudo mount \/dev\/sr0 \/var\/repo\/<\/pre>\n
    \u5728 \/etc\/yum.repos.d\/ \u76ee\u5f55\u4e2d\u521b\u5efa\u4ed3\u5e93\u6587\u4ef6<\/strong><\/div>\n

    \u5728 \/etc\/yum.repos.d\/ \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a \u201crhel9-local.repo` \u7684\u4ed3\u5e93\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

    \r\n$ sudo vi \/etc\/yum.repos.d\/rhel9-local.repo\r\n[Local-BaseOS]\r\nname=Red Hat Enterprise Linux 9 - BaseOS\r\nmetadata_expire=-1\r\ngpgcheck=1\r\nenabled=1\r\nbaseurl=file:\/\/\/var\/repo\/\/BaseOS\/\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-redhat-release\r\n[Local-AppStream]\r\nname=Red Hat Enterprise Linux 9 - AppStream\r\nmetadata_expire=-1\r\ngpgcheck=1\r\nenabled=1\r\nbaseurl=file:\/\/\/var\/repo\/\/AppStream\/\r\ngpgkey=file:\/\/\/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-redhat-release<\/pre>\n

    \u4fdd\u5b58\u5e76\u5173\u95ed\u8be5\u6587\u4ef6\u3002
    \n\"\"<\/p>\n

    \u5237\u65b0 Yum\/DNF \u548c\u8ba2\u9605\u7ba1\u7406\u5668\u7684\u7f13\u5b58<\/strong><\/div>\n

    \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6e05\u7406 Yum \u6216 DNF \u548c\u8ba2\u9605\u7ba1\u7406\u5668\u7684\u7f13\u5b58\u3002<\/p>\n

    \r\n$ sudo dnf clean all<\/pre>\n
    \r\n$ sudo subscription-manager clean<\/pre>\n

    \"\"<\/p>\n

    \u5728\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\uff0c\u6211\u4eec\u5f97\u5230\u4e00\u4e2a\u8b66\u544a\u4fe1\u606f This system is not registered with an entitlement\uff08\u7cfb\u7edf\u6ca1\u6709\u6ce8\u518c\u6743\u9650\uff09\u3002\u6240\u4ee5\uff0c\u4e3a\u4e86\u6291\u5236\u8fd9\u4e2a\u8b66\u544a\u4fe1\u606f\uff0c\u7f16\u8f91\u6587\u4ef6 \/etc\/yum\/pluginconf.d\/subscription-manager.conf\uff0c\u5c06\u53c2\u6570 enabled=1 \u6539\u4e3a enabled=0\u3002<\/p>\n

    $ sudo vi \/etc\/yum\/pluginconf.d\/subscription-manager.conf<\/pre>\n

    \"\"<\/p>\n

    \u4fdd\u5b58\u5e76\u9000\u51fa\u8be5\u6587\u4ef6\u3002<\/p>\n

    \u4f7f\u7528\u672c\u5730\u4ed3\u5e93\u5b89\u88c5\u8f6f\u4ef6\u5305<\/strong><\/div>\n

    \u73b0\u5728\u6211\u4eec\u90fd\u51c6\u5907\u597d\u6d4b\u8bd5\u6211\u4eec\u7684\u672c\u5730\u4ed3\u5e93\u4e86\u3002\u8fd0\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6765\u67e5\u770b\u914d\u7f6e\u4ed3\u5e93\u3002<\/p>\n

    $ sudo dnf repolist<\/pre>\n

    \u8f93\u51fa\uff1a<\/p>\n

    \"\"<\/p>\n

    \u73b0\u5728\uff0c\u8bd5\u8bd5\u7528 dnf \u547d\u4ee4\u901a\u8fc7\u4e0a\u9762\u914d\u7f6e\u7684\u672c\u5730\u4ed3\u5e93\u5b89\u88c5\u8f6f\u4ef6\u5305\u3002<\/p>\n

    $ sudo dnf install nfs-utils<\/pre>\n

    \u8f93\u51fa\uff1a
    \n\"\"<\/p>\n

    \"\"<\/p>\n

    \u5b8c\u7f8e\uff0c\u4e0a\u8ff0\u8f93\u51fa\u8bc1\u5b9e\u4e86 nfs-utils \u5305\u53ca\u5176\u4f9d\u8d56\u9879\u5df2\u7ecf\u901a\u8fc7\u672c\u5730\u914d\u7f6e\u7684 Yum \u6216 DNF \u4ed3\u5e93\u6210\u529f\u5b89\u88c5\u3002<\/p>\n

    \u8fd9\u5c31\u662f\u672c\u6307\u5357\u7684\u5168\u90e8\u5185\u5bb9\u3002\u6211\u5e0c\u671b\u4f60\u89c9\u5f97\u5b83\u6709\u53c2\u8003\u4ef7\u503c\u3002\u8bf7\u5728\u4e0b\u9762\u7684\u8bc4\u8bba\u533a\u53d1\u8868\u4f60\u7684\u7591\u95ee\u548c\u53cd\u9988\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    \u5f53\u6211\u4eec\u6ca1\u6709\u8ba2\u9605\u7684\u65f6\u5019\uff0c\u60f3\u5b89\u88c5\u8f6f\u4ef6\u5305\u6765\u505a\u5b9e\u9a8c\uff0c\u90a3\u4e48\u8bbe\u7f6e\u672c\u5730\u7684 Yum \u6216 DNF \u4ed3\u5e93\u5c06\u662f\u5f88\u65b9\u4fbf\u7684\u3002 \u5728\u672c\u6307\u5357\u4e2d […]<\/p>\n","protected":false},"author":1469,"featured_media":257930,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-257918","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\/257918","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\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=257918"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257918\/revisions"}],"predecessor-version":[{"id":257932,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/257918\/revisions\/257932"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/257930"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=257918"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=257918"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=257918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}