Centos 6.4使用本地yum源
????每次用rpm包安裝軟件是總有依賴包的出現,今天我搭建了本地yum倉庫,使用yum從光盤安裝軟件可以解決包的依賴關系,具體操作如下:
?
1.掛載光盤鏡像
[root@centos ~]# mkdir /mnt/cdrom
[root@centos ~]# mount /dev/cdrom? /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@centos ~]# vim /etc/yum.repos.d/CentOS-Media.repo
[c6-media]
name=CentOS-$releasever - Media???? --倉庫名
baseurl=file:///mnt/cdrom??????? --軟件包路徑
gpgcheck=1???????? --啟用包檢查
enabled=1????????? --啟用這個倉庫
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-CentOS-6
???
2.測試倉庫
[root@centos ~]# yum clean all???? --清除所有包
Loaded plugins: fastestmirror, refresh-packagekit
Cleaning repos: c6-media
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@centos ~]# yum repolist????? --查找有幾個倉庫
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
c6-media????????????????????????????????? | 4.0 kB???? 00:00 ...
c6-media/primary_db?????????????????????? | 3.5 MB???? 00:00 ...
repo id???????????????????? repo name???????????????????? status
c6-media??????????????????? CentOS-6 - Media????????????? 4,802
repolist: 4,802
[root@centos ~]#
?
3.安裝軟件
[root@centos ~]# yum install gpm??? --安裝軟件
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gpm.i686 0:1.20.6-12.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================
Package???????????????????????? Arch???????????????????????????? Version??????????????????????????????????? Repository??????????????????????????? Size
========================================================================================================================================================
Installing:
gpm???????????????????????????? i686???????????????????????????? 1.20.6-12.el6????????????????????????????? c6-media???????????????????????????? 175 k
Transaction Summary
========================================================================================================================================================
Install?????? 1 Package(s)
Total download size: 175 k
Installed size: 373 k
Is this ok [y/N]:y?????????? --確定安裝
?
4.常用yum基本命令
yum?--help?????????????????--幫助信息
yum?list?????????--列出軟件包
yum?repolist????????--查看有多少倉庫
yum?info?軟件包????????--軟件包的信息
yum?install??軟件包?????????--安裝軟件包
yum?update?軟件包??????--更新軟件包
yum?provides?命令???????--用命令查找要安裝的軟件包
yum?reinstall?軟件包????????--覆蓋安裝軟件包
yum?remove?軟件包??????--刪除軟件
yum?clean?軟件包????--清除軟件包
yum?grouplist??????????--查看軟件組
yum?groupinstall?"軟件組"?????--安裝軟件組
yum?install?info?"軟件組"????--查看軟件組的信息
yum?remove?“組件組"?????--刪除軟件組
yum???search???軟件包????--檢測是否有軟件包?????
yum install?* --nogpgcheck???? --跳過KEY安裝軟件包?
????????????
注:搭建Linux本地源:http://tongcheng.blog.51cto.com/6214144/1338949
轉載于:https://blog.51cto.com/tongcheng/1338876
總結
以上是生活随笔為你收集整理的Centos 6.4使用本地yum源的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 有关web接受管理邮件
- 下一篇: Centos(6、7) —— yum源的