LInux YUM 倉庫配置

2021-10-04 18:36:05 字數 1952 閱讀 3367

本次配置

系統:centos 7

上傳ios檔案,此處略

掛載ios檔案

[root@centossystem ~]# mkdir -p /mnt/centos7

[root@centossystem ~]# mount -t iso9660 -o loop /home/vision/ios/centos-7-x86_64-***-1908.iso /mnt/centos7/

[root@centossystem ~]# df -h /mnt/centos7/

檔案系統 容量 已用 可用 已用% 掛載點

/dev/loop0 4.4g 4.4g 0 100% /mnt/centos7

配置yun倉庫檔案

[root@centossystem ~]# yum-config-manager --add-repo=ftp:///mnt/centos7/  --enable 0 

已載入外掛程式:fastestmirror, langpacks

adding repo from: ftp:///mnt/centos7/

[mnt_centos7_]

name=added from: ftp:///mnt/centos7/

baseurl=file:///mnt/centos7/

enabled=1

#enabled 表示是否啟用yum庫(1表示啟用,0表示禁用)

#gpgcheck 表示是否檢查yum庫

[root@centossystem ~]# echo "gpgcheck=1" >> /etc/yum.repos.d//mnt_centos7_.repo

清除yum倉庫快取重新生成

[root@centossystem yum.repos.d]# yum clean all 

已載入外掛程式:fastestmirror, langpacks

正在清理軟體源: mnt_centos7_

cleaning up list of fastest mirrors

[root@centossystem yum.repos.d]#

[root@centossystem yum.repos.d]#

[root@centossystem yum.repos.d]# yum makecache

......

測試yum倉庫

#這裡安裝乙個httpd包 httpd

已載入外掛程式:fastestmirror, langpacks

loading mirror speeds from cached hostfile

正在解決依賴關係

--> 正在檢查事務

......

複製配置檔案,將內容複製到 /etc/yum.repos.d/net_centos.repo 下,這個名稱可以自己定義,只要 .repo 結尾即可

配置好後 yum clean all && yum makecache 就好了

[root@centossystem yum.repos.d]# yum clean all 

已載入外掛程式:fastestmirror, langpacks

正在清理軟體源: base extras mnt_centos7_ updates

cleaning up list of fastest mirrors

[root@centossystem yum.repos.d]# yum makecache

已載入外掛程式:fastestmirror, langpacks

.........

Linux Yum倉庫源配置

yum概念 yum軟體倉庫的作用是為了進一步簡化rpm管理軟體的難度以及自動分析所需軟體包及其依賴關係的技術 yum配置倉庫源放置位置 etc yum.repo.d 配置檔案需以 repo 結尾 可通過 man yum.conf 檢視yum倉庫的全部配置資訊 配置名稱 作用 repositoryid...

Linux yum 配置簡介

概述 yum 配置 背景繼續看 yum 這次簡單看看配置 老實說,能配置的東西其實不少 我只能說先看這麼點.環境os centos 7.6 core 4.1 yumrpm 4.11.3 yum 3.4.3 型別總結類 概述yum 在 centos 的配置檔案 配置yum 的配置 等下這幾個挨個說 e...

Linux yum配置軟體源

寫在前面 先介紹一下yum工作機制,方便後續知識理解.mount dev cdrom mnt 掛載光碟 mount dev sr0寫保護,將以唯讀方式掛載 root svr7 mkdir p repo cos7 建倉庫目錄 root svr7 cp rf mnt repo cos7 拷貝全部光碟文件...