{"id":4352,"date":"2021-06-04T13:20:19","date_gmt":"2021-06-04T04:20:19","guid":{"rendered":"\/blog\/?p=4352"},"modified":"2023-11-16T13:52:29","modified_gmt":"2023-11-16T04:52:29","slug":"yum-repository-%eb%a7%8c%eb%93%a4%ea%b8%b0-%eb%b0%8f-%ec%84%a4%ec%a0%95","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=4352","title":{"rendered":"yum repository \ub9cc\ub4e4\uae30 \ubc0f \uc124\uc815"},"content":{"rendered":"\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n############################################################\n#\n# CentOS\/Rocky Linux\n# yum repository \uc0ac\uc774\ud2b8 \ub3d9\uae30\ud654 \uc2a4\ud06c\ub9bd\ud2b8\n#\n############################################################\nLOCAL_BASE_DIR=\"\/mnt\/usbdisk\/repo\"\n\n############################################################\n# \ubd88\ud544\uc694\ud55c \ud30c\uc77c \uc81c\ud55c\n############################################################\n#EXCLUDE_LIST=\"\\\n#--exclude HEADER.images\/ \\\n#--exclude Source\/ \\\n#--exclude atomic\/ \\\n#--exclude centosplus\/ \\\n#--exclude cloud\/ \\\n#--exclude configmanagement\/ \\\n#--exclude contrib\/ \\\n#--exclude cr\/ \\\n#--exclude debug\/ \\\n#--exclude dotnet\/ \\\n#--exclude extras\/ \\\n#--exclude fasttrack\/ \\\n#--exclude i386\/ \\\n#--exclude infra\/ \\\n#--exclude isos\/ \\\n#--exclude messaging\/ \\\n#--exclude nfv\/ \\\n#--exclude opstools\/ \\\n#--exclude paas\/ \\\n#--exclude rt\/ \\\n#--exclude sclo\/ \\\n#--exclude storage\/ \\\n#--exclude virt\"\n\nEXCLUDE_LIST=\"\\\n--exclude Source\/ \\\n--exclude debug\/ \\\n--exclude dotnet\/ \\\n--exclude extras\/ \\\n--exclude fasttrack\/ \\\n--exclude i386\/ \\\n--exclude isos\/ \\\n--exclude opstools\/ \\\n--exclude storage\/ \\\n--exclude virt\/\"\n\nif [ ! -d ${LOCAL_BASE_DIR} ]\nthen\n  echo \"${LOCAL_BASE_DIR} not found !\"\n  exit\nfi\n\n# CentOS 6.10\n#MIRROR_SITE=\"https:\/\/vault.centos.org\"\n#REMOTE_DIR=\"\/6.10\"\n#LOCAL_DIR=\"${LOCAL_BASE_DIR}\/centos\/6.10\"\n#mkdir -p ${LOCAL_DIR} > \/dev\/null\n#if ! pgrep -x \"lftp\" > \/dev\/null\n#then\n#  lftp  -e \"cache off; set file:charset utf-8; set net:timeout 60; set net:reconnect-interval-base 5; set net:max-retries 10; mirror ${EXCLUDE_LIST} -e -v ${REMOTE_DIR} ${LOCAL_DIR}; exit\" ${MIRROR_SITE}\n#fi\n\n# CentOS 7.5.1804\n#MIRROR_SITE=\"https:\/\/vault.centos.org\"\n#REMOTE_DIR=\"\/7.5.1804\"\n#LOCAL_DIR=\"${LOCAL_BASE_DIR}\/centos\/7.5.1804\"\n#mkdir -p ${LOCAL_DIR} > \/dev\/null\n#if ! pgrep -x \"lftp\" > \/dev\/null\n#then\n#  lftp  -e \"cache off; set file:charset utf-8; set net:timeout 60; set net:reconnect-interval-base 5; set net:max-retries 10; mirror ${EXCLUDE_LIST} -e -v ${REMOTE_DIR} ${LOCAL_DIR}; exit\" ${MIRROR_SITE}\n#fi\n\n# CentOS 7.9.2009\n#MIRROR_SITE=\"http:\/\/mirror.kakao.com\"\n#REMOTE_DIR=\"\/centos\/7.9.2009\"\n#LOCAL_DIR=\"${LOCAL_BASE_DIR}\/centos\/7.9.2009\"\n#mkdir -p ${LOCAL_DIR} > \/dev\/null\n#if ! pgrep -x \"lftp\" > \/dev\/null\n#then\n#  lftp  -e \"cache off; set file:charset utf-8; set net:timeout 60; set net:reconnect-interval-base 5; set net:max-retries 10; mirror ${EXCLUDE_LIST} -e -v ${REMOTE_DIR} ${LOCAL_DIR}; exit\" ${MIRROR_SITE}\n#fi\n\n# Rocky Linux 8.8\nMIRROR_SITE=\"http:\/\/mirror.navercorp.com\"\nREMOTE_DIR=\"\/rocky\/8.8\"\nLOCAL_DIR=\"${LOCAL_BASE_DIR}\/rocky\/8.8\"\nmkdir -p ${LOCAL_DIR} > \/dev\/null\nif ! pgrep -x \"lftp\" > \/dev\/null\nthen\n  lftp  -e \"cache off; set file:charset utf-8; set net:timeout 60; set net:reconnect-interval-base 5; set net:max-retries 10; mirror ${EXCLUDE_LIST} -e -v ${REMOTE_DIR} ${LOCAL_DIR}; exit\" ${MIRROR_SITE}\nfi\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/bin\/bash\n############################################################\n#\n# CentOS yum repository \uc14b\ud305 \uc2a4\ud06c\ub9bd\ud2b8\n#\n############################################################\nCURRENT_TIME=`date \"+%Y%m%d_%H%M%S\"`\n\n# \ub85c\uceec repository \uc11c\ubc84\uc758 IP\uc8fc\uc18c\nREMOTE_REPO_ADDR=\"10.10.10.111\"\nREMOTE_PATH=\"https:\/\/${REMOTE_REPO_ADDR}\/centos\/7.9.2009\"\n\n# \uae30\uc874 yum repository \uc815\ubcf4\ub97c \ubaa8\ub450 \ubc31\uc5c5 \ud55c\ub2e4.\ncp -Rfv \/etc\/yum.repos.d \/etc\/yum.repos.d.${CURRENT_TIME}\n\n# \uae30\uc874 yum repository \uc815\ubcf4\ub97c \ubaa8\ub450 \uc0ad\uc81c \ud55c\ub2e4.\nrm -rf \/etc\/yum.repos.d\/*\n\n# \uc0c8\ub85c\uc6b4 yum repository \uc815\ubcf4\ub97c \uc791\uc131\ud55c\ub2e4.\necho \"[base]\" > \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"name=localrepo - base\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"baseurl=${REMOTE_PATH}\/os\/\\$basearch\/\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"enabled=1\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"gpgcheck=0\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"sslverify=0\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"[updates]\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"name=localrepo - updates\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"baseurl=${REMOTE_PATH}\/updates\/\\$basearch\/\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"enabled=1\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"gpgcheck=0\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\necho \"sslverify=0\" >> \/etc\/yum.repos.d\/${REMOTE_REPO_ADDR}.repo\n\n# \uc815\uc0c1\uc801\uc73c\ub85c \uc791\ub3d9\ud558\ub294\uc9c0 \ud14c\uc2a4\ud2b8 \ud55c\ub2e4.\nclear\nyum repolist<\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[39],"tags":[],"class_list":["post-4352","post","type-post","status-publish","format-standard","hentry","category-os_linux_unix_macos"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4352"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4352\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}