首页 > Linux操作系统 > Linux操作系统 > linux yum源配置方法
yum简介
yum = Yellow dog Updater, Modified
主要功能是更方便的添加/删除/更新RPM包.
它能自动解决包的倚赖性问题.
它能便于管理大量系统的更新问题
当前linux版本 rhel7.0
前提
mount DVD光盘到/mnt 因为配置时候路径名里面不能有空格,否则不能识别
[root@LiuZhen mnt]# mount /dev/sr0 /mnt
在目录/etc/yum.repos.d/创建文件 文件名.repo
也可以VI直接编辑
[root@LiuZhen mnt]# cat> /etc/yum.repos.d/dvd.repo<< EOF
> [testyum]
> name=dvd
> baseurl=file:///mnt
> enable=1
> EOF
编辑完成,查看一下
[root@LiuZhen mnt]# cat /etc/yum.repos.d/dvd.repo
[testyum]
name=dvd
baseurl=file:///mnt
enable=1
导入release相关文件
[root@LiuZhen mnt]# rpm --import RPM-GPG-KEY-redhat-release
以上已经配置完成,安装dovecot进行测试
安装dovecot包文件
[root@LiuZhen mnt]# yum -y install dovecot
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package dovecot.x86_64 1:2.2.10-4.el7 will be installed
--> Processing Dependency: libclucene-core.so.1()(64bit) for package: 1:dovecot-2.2.10-4.el7.x86_64
--> Processing Dependency: libclucene-shared.so.1()(64bit) for package: 1:dovecot-2.2.10-4.el7.x86_64
--> Running transaction check
---> Package clucene-core.x86_64 0:2.3.3.4-11.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Installing:
dovecot x86_64 1:2.2.10-4.el7 testyum 3.2 M
Installing for dependencies:
clucene-core x86_64 2.3.3.4-11.el7 testyum 528 k
Transaction Summary
==================================================================================================================
Install 1 Package (+1 Dependent package)
Total download size: 3.7 M
Installed size: 12 M
Downloading packages:
------------------------------------------------------------------------------------------------------------------
Total 59 MB/s | 3.7 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Installing : clucene-core-2.3.3.4-11.el7.x86_64 1/2
Installing : 1:dovecot-2.2.10-4.el7.x86_64 2/2
testyum/productid | 1.6 kB 00:00:00
Verifying : 1:dovecot-2.2.10-4.el7.x86_64 1/2
Verifying : clucene-core-2.3.3.4-11.el7.x86_64 2/2
Installed:
dovecot.x86_64 1:2.2.10-4.el7
Dependency Installed:
clucene-core.x86_64 0:2.3.3.4-11.el7
Complete!
Public key for dovecot-2.2.10-4.el7.x86_64.rpm is not installed
查看包安装结果
[root@LiuZhen ~]# rpm -qa dovecot
dovecot-2.2.10-4.el7.x86_64
删除包操作
[root@LiuZhen mnt]# yum -y remove dovecot
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package dovecot.x86_64 1:2.2.10-4.el7 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
==================================================================================================================
Package Arch Version Repository Size
==================================================================================================================
Removing:
dovecot x86_64 1:2.2.10-4.el7 @testyum 9.7 M
Transaction Summary
==================================================================================================================
Remove 1 Package
Installed size: 9.7 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 1:dovecot-2.2.10-4.el7.x86_64 1/1
Verifying : 1:dovecot-2.2.10-4.el7.x86_64 1/1
Removed:
dovecot.x86_64 1:2.2.10-4.el7
Complete!
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9431396/viewspace-2057873/ ,如需转载,请注明出处,否则将追究法律责任。