linux yum源配置方法

liuzhen_basis發表於2014-07-20

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=

> enable=1

> EOF

編輯完成,檢視一下

 

[root@LiuZhen mnt]# cat /etc/yum.repos.d/dvd.repo

[testyum]

name=dvd

baseurl=

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

--&gt Running transaction check

---&gt Package dovecot.x86_64 1:2.2.10-4.el7 will be installed

--&gt Processing Dependency: libclucene-core.so.1()(64bit) for package: 1:dovecot-2.2.10-4.el7.x86_64

--&gt Processing Dependency: libclucene-shared.so.1()(64bit) for package: 1:dovecot-2.2.10-4.el7.x86_64

--&gt Running transaction check

---&gt Package clucene-core.x86_64 0:2.3.3.4-11.el7 will be installed

--&gt 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

--&gt Running transaction check

---&gt Package dovecot.x86_64 1:2.2.10-4.el7 will be erased

--&gt 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部落格 ” ,連結:http://blog.itpub.net/27771627/viewspace-1223153/,如需轉載,請註明出處,否則將追究法律責任。

相關文章