CentOS7 Local yum的一次報錯信息

說明:今天在火車上測試一個CentOS7下的一個服務,要用到yum配置,但是本機沒有聯網,所以考慮到配置本地yum,按照之前CentOS6下的常規方法,居然發現有報錯。

操作如下:

1)虛擬機下將CentOS7光盤加載到系統里面,然后掛載到本地的/localyum上

[root@localhost yum.repos.d]# mount /dev/cdrom /localyum

2)添加一個repo文件

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim CentOS7-local.repo 
[localyum]
name=localyum
baseurl=file:///localyum/
gpgcheck=0
enabled=1

3)測試安裝下vsftpd軟件

[root@localhost yum.repos.d]# yum -y install vsftpd
已加載插件:fastestmirror, langpacks
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的錯誤"
 One of the configured repositories failed (未知),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:
     1. Contact the upstream for the repository and get them to fix the problem.
     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).
     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:
            yum-config-manager --disable <repoid>
     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:
            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64

4)由于是在局域網內,無法正常連上外網,所有重新調整了下repo文件

[root@localhost yum.repos.d]# vim CentOS7-local.repo 
[localyum]
name=localyum
baseurl=file:///localyum/
gpgcheck=0
enabled=1
yum --disablerepo=\* --enablerepo=localyum clean all#清除緩存
yum --disablerepo=\* --enablerepo=localyum makecache#緩存本地yum源包信息

5)重新安裝下vsftpd軟件

[root@localhost yum.repos.d]# yum -y install vsftpd
已加載插件:fastestmirror, langpacks
base                                                                                                                         | 3.6 kB  00:00:00     
extras                                                                                                                       | 3.4 kB  00:00:00     
localyum                                                                                                                     | 3.6 kB  00:00:00     
updates                                                                                                                      | 3.4 kB  00:00:00     
(1/6): localyum/group_gz                                                                                                     | 154 kB  00:00:00     
(2/6): localyum/primary_db                                                                                                   | 2.7 MB  00:00:00     
(3/6): extras/7/x86_64/primary_db                                                                                            | 149 kB  00:00:00     
(4/6): updates/7/x86_64/primary_db                                                                                           | 5.7 MB  00:00:18     
(5/6): base/7/x86_64/group_gz                                                                                                | 155 kB  00:00:21     
(6/6): base/7/x86_64/primary_db                                                                                              | 5.3 MB  00:00:29     
Determining fastest mirrors
 * base: mirrors.163.com
 * extras: mirrors.cqu.edu.cn
 * updates: mirrors.cqu.edu.cn
正在解決依賴關系
--> 正在檢查事務
---> 軟件包 vsftpd.x86_64.0.3.0.2-11.el7_2 將被 安裝
--> 解決依賴關系完成
依賴關系解決
====================================================================================================================================================
 Package                          架構                             版本                                     源                                 大小
====================================================================================================================================================
正在安裝:
 vsftpd                           x86_64                           3.0.2-11.el7_2                           updates                           167 k
事務概要
====================================================================================================================================================
安裝  1 軟件包
總下載量:167 k
安裝大?。?47 k
Downloading packages:
vsftpd-3.0.2-11.el7_2.x86_64.rpm                                                                                             | 167 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安裝    : vsftpd-3.0.2-11.el7_2.x86_64                                                                                                    1/1 
  驗證中      : vsftpd-3.0.2-11.el7_2.x86_64                                                                                                    1/1 
已安裝:
  vsftpd.x86_64 0:3.0.2-11.el7_2                                                                                                                    
完畢!

6)配置光盤開機自動掛載

[root@localhost ~]# echo "/dev/cdrom /localyum iso9660 defaults  0 0">>/etc/fstab
[root@localhost ~]# mount -a

原創文章,作者:Net21-冰凍vs西瓜,如若轉載,請注明出處:http://www.www58058.com/24291

(3)
Net21-冰凍vs西瓜Net21-冰凍vs西瓜
上一篇 2016-07-16 22:28
下一篇 2016-07-16 22:28

相關推薦

  • 基于kubernetes構建Docker集群管理詳解

    一、前言        Kubernetes 是Google開源的容器集群管理系統,基于Docker構建一個容器的調度服務,提供資源調度、均衡容災、服務注冊、動態擴縮容等功能套件,目前最新版本為0.6.2。本文介紹如何基于Centos7.0構建Kubernetes平臺,在正式介紹…

    2015-03-10
  • 軟件包管理工具—rpm命令總結

    描述:    RPM是RedHatPackageManager的縮寫,是由RedHat公司開發的軟件包安裝和管理程序,同Windows平臺上的Uninstaller比較類似。使用RPM,用戶可以自行安裝和管理Linux上的應用程序和系統工具。RPM可以讓用戶直接以binary方式安裝軟件包,并且可替用戶查詢是否已經安裝了有關的庫文件;在用…

    Linux干貨 2016-08-29
  • 推薦-NFS共享MySQL使用DNS輪詢實現Web負載均衡

    NFS共享MySQL使用DNS輪詢實現Web負載均衡 NFS共享MySQL使用DNS輪詢實現Web負載均衡 前言: 實驗拓撲圖 實驗環境 實驗步驟 搭建NFS 搭建dns,MySQL環境 DNS配置 MySQL配置 WEB配置 第一臺主機安裝 第二臺主機安裝 測試 web1測試 web2測試 回到web1測試 總結 前言: 今天學習了NFS,遂結合前面學習的…

    Linux干貨 2016-03-29
  • awk的基本原理

    awk的工作原理 一次讀取一行文本,按輸入分隔符進行切片,切成多個組成部分,將每片直接保存在內建的變量中,$1,$2,$3….,引用指定的變量,可以顯示指定斷,或者多個斷。如果需要顯示全部的,需要使用$0來引用??梢詫蝹€片斷進行判斷,也可以對所有斷進行循環判斷。其默認分隔符為空格 awk的基本用法格式awk [options…

    Linux干貨 2017-07-11
  • shell腳本4——特殊循環和函數

    循環的特殊用法: 1、while循環的特殊用法之遍歷文件的每一行 while read line; do     循環體 done < /PATH/FROM/SOMEFILE 依次讀取/PATH/FROM/SOMEFILE文件中的每一行,將每一行賦值給變量line…

    Linux干貨 2016-08-21
  • 馬哥教育網絡班22期+第四周課程練習

    1、復制/etc/skel目錄為/home/tuser1,要求/home/tuser1及其內部文件的屬組和其它用戶均沒有任何訪問權限。 ~]# cp -r /etc/skel/ /home/tuser1/ ~]# chmod 700 /home/tuser1/ -R 2、編輯/e…

    Linux干貨 2016-09-06
欧美性久久久久