linux本地關盤做yum源
Linux下可以用本地光碟做yum源,這在有些網路環境無法連線網際網路的伺服器下很有幫助,特別是對於安裝oracle資料庫那些繁瑣的依賴包,不過如果是oel的那就另當別論了。
新建一個目錄,掛載光碟映象,需要以只讀方式掛載。
[root@localhost ~]# mkdir /media/mnt
[root@localhost ~]# mount /dev/cdrom /media/mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost ~]# mount -o r /dev/cdrom /media/mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
mount: /dev/cdrom already mounted or /media/mnt busy
mount: according to mtab, /dev/hdc is already mounted on /media/mnt
此時已經掛載關盤了
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 12G 5.1G 6.1G 46% /
/dev/sda2 1.9G 36M 1.8G 2% /home
tmpfs 385M 0 385M 0% /dev/shm
/dev/hdc 3.7G 3.7G 0 100% /media/mnt
修改/etc/yum.repos.d下的檔案,不啟用網路的yum源,linux預設使用的網路的yum源
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
total 12
-rw-r--r-- 1 root root 2323 Mar 16 2009 CentOS-Base.repo
-rw-r--r-- 1 root root 562 Aug 20 04:31 CentOS-Media.repo
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repobak
[root@localhost yum.repos.d]# vi CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-5. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c5-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=* --enablerepo=c5-media [command]
[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/mnt –這個改成你mount光碟的目錄
gpgcheck=1
enabled=1—原來的enable=0,改為enable=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
~
~
"CentOS-Media.repo" 19L, 559C written
檢視是否能正常使用yum源,可能會遇到如下的錯誤,找到相應的程式kill掉即可。
[root@localhost yum.repos.d]# yum list
Loaded plugins: fastestmirror
Existing lock /var/run/yum.pid: another copy is running as pid 8101.
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
[root@localhost yum.repos.d]# ps -ef|grep yum
root 8101
2778 0 04:35 pts/2 00:00:00 /usr/bin/python /usr/bin/yum list
root 8120 2778 0 04:38 pts/2 00:00:00 grep yum
[root@localhost yum.repos.d]# kill -9 8101
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25362835/viewspace-1059220/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux yum 本地源Linux
- Linux 本地yum源配置Linux
- Linux下配置本地yum源Linux
- Linux系統配置本地yum源Linux
- linux配置本地ISO的yum源Linux
- RedHat Linux 本地Yum源安裝RedhatLinux
- 本地yum源搭建
- 本地搭建yum源
- 【轉】linux上建立本地yum源Linux
- centos同步yum源到本地,建立本地網路yum源CentOS
- oracle linux使用安裝盤製作本地yumOracleLinux
- linux配置本地yum源 centos7.9為例LinuxCentOS
- Linux學習-通過光碟配置本地yum源Linux
- Linux本地yum配置Linux
- yum本地源及網路源配置
- linux配置本地yum安裝--FTP yumLinuxFTP
- Linux系統本地yum源環境配置記錄Linux
- RedHat8 配置本地yum源Redhat
- Centos-Stream 配置本地yum源和配置阿里雲yum源CentOS阿里
- rhel 7.6使用映象做本地yum倉庫
- ▲▲▲▲▲▲▲▲▲▲▲yum源的配置(本地和ftp)▲▲▲▲▲▲▲▲▲▲▲▲▲vFTP
- Linux伺服器---本地yumLinux伺服器
- Linux系統下本地yum映象源環境部署-完整記錄Linux
- linux 配置yum 源Linux
- linux yum 源部署Linux
- 建立本地yum軟體源,為本地Package安裝Cloudera Manager、Cloudera Hadoop及Impala做準備PackageCloudHadoop
- 搭建本地yum源,使用安裝光碟的rpm作為yum源的檔案
- linux yum源配置方法Linux
- Linux yum源配置以及yum命令講解Linux
- 不需上網,本地光碟yum源的搭建
- centos7.5利用yum快取搭建本地源CentOS快取
- 小凡帶你搭建本地的光碟yum源
- 配置本地yum源及安裝必要的包
- CentOS使用iso映象檔案配置本地yum源CentOS
- 12C安裝及本地YUM源配置
- linux 5&6&7 本地yum配置Linux
- Linux CentOS 7 更新yum源LinuxCentOS
- Linux 網路yum源配置Linux