linux yum源怎么添加源,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=

> 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

==================================================================================================================

PackageArchVersionRepositorySize

==================================================================================================================

Installing:

dovecotx86_641:2.2.10-4.el7testyum3.2 M

Installing for

dependencies:

clucene-corex86_642.3.3.4-11.el7testyum528 k

Transaction Summary

==================================================================================================================

Install1 Package (+1 Dependent package)

Total download size:

3.7 M

Installed size: 12 M

Downloading packages:

------------------------------------------------------------------------------------------------------------------

Total59 MB/s | 3.7 MB00: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_641/2

Installing :

1:dovecot-2.2.10-4.el7.x86_642/2

testyum/productid| 1.6 kB00:00:00

Verifying: 1:dovecot-2.2.10-4.el7.x86_641/2

Verifying: clucene-core-2.3.3.4-11.el7.x86_642/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

==================================================================================================================

PackageArchVersionRepositorySize

==================================================================================================================

Removing:

dovecotx86_641:2.2.10-4.el7@testyum9.7 M

Transaction Summary

==================================================================================================================

Remove1 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_641/1

Verifying: 1:dovecot-2.2.10-4.el7.x86_641/1

Removed:

dovecot.x86_64 1:2.2.10-4.el7

Complete!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值