Linux鏡像本地掛載,使用iso作yum源安裝

1.將iso掛載到路徑/mnt/cdiso/:c++

mount -o loop /home/software/rhel-server-6.0-x86_64-dvd.iso /mnt/cdiso/sql

yum clean all緩存

2.編輯yum配置文件指向掛載路徑:curl

vi  /etc/yum.repos.d/redhat.repooop

[Server]
name=Red Hat Enterprise Linux $releasever -$basearch - Server
baseurl=file:///mnt/cdiso
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release~url

以後就可使用yum install XXXX快捷安裝了spa

 

拓展:Yum編譯安裝Error Downloading Packages報錯server

在編譯安裝FS環境的時候發現如何報錯:sqlite

yum編譯執行命令以下:ssl

yum install ntpdate wget autoconf automakelibtool gcc-c++ zlib-devel libjpeg-devel sqlite-devel libcurl-devel pcre-develspeex-devel libedit-devel openssl-devel libogg-devel libvorbis-devel

wKioL1O2burxslLrAABYYkXFkF8180.jpg

報錯信息以下:

Error Downloading Packages:

openssl-devel-1.0.1e-16.el6_5.14.i686:failure: Packages/openssl-devel-1.0.1e-16.el6_5.14.i686.rpm  base: [Errno 256] No more mirrors to try.

openssl-devel-1.0.1e-16.el6_5.14.i686:failure: Packages/openssl-devel-1.0.1e-16.el6_5.14.i686.rpm  base: [Errno 256] No more mirrors to try.

openssl-devel-1.0.1e-16.el6_5.14.i686:failure: Packages/openssl-devel-1.0.1e-16.el6_5.14.i686.rpm  base: [Errno 256] No more mirrors to try.

openssl-devel-1.0.1e-16.el6_5.14.i686:failure: Packages/openssl-devel-1.0.1e-16.el6_5.14.i686.rpm  from base: [Errno 256] No more mirrors to try.

解決思路:

1:執行yum clean all 清除緩存目錄下的軟件包及舊的headers;

2:接着執行 yum list 從新列出全部已經安裝和能夠安裝的軟件包;

3:從新執行上述命令,發現yum編譯成功;

注意:若是執行 yum list 報錯,那就檢查一下yum倉庫是否有問題;並清除/etc/yum.repos.d/下多餘.repo文件!

相關文章
相關標籤/搜索