Yum:Yellowdog Updater,Modified的简称,起初由yellow dog发行版的开发者Terra Soft研发,用Python编写,后经杜克大学的Linux@Duke开发团队进行改进,遂有此名。Yum是一个shell前端软件包管理器,基于RPM包管理,能够从指定的服务器自动下载RPM包并安装,可以自动处理依赖关系,并且一次安装所有依赖的软件包。
按照网络来分有公网仓库和私网仓库,公网仓库里又有自建仓库和官方仓库。
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@localhost ~]# cd /mnt
[root@localhost mnt]# ls
CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-7
EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL
[root@localhost mnt]# cd /etc
[root@localhost etc]# ls
abrt filesystems magic rpc
adjtime firefox mail.rc rpm
aliases firewalld makedumpfile.conf.sample rsyncd.conf
aliases.db flatpak man_db.conf rsyslog.conf
alsa fonts maven rsyslog.d
alternatives fprintd.conf mke2fs.conf rwtab
anacrontab fstab modprobe.d rwtab.d
asound.conf fuse.conf modules-load.d samba
at.deny gconf motd sane.d
audisp gcrypt mtab sasl2
audit gdbinit mtools.conf scl
autofs.conf gdbinit.d multipath securetty
autofs_ldap_auth.conf gdm my.cnf security
auto.master geoclue my.cnf.d selinux
auto.master.d GeoIP.conf nanorc services
auto.misc GeoIP.conf.default netconfig sestatus.conf
auto.net ghostscript NetworkManager setroubleshoot
auto.smb gnupg networks setuptool.d
avahi GREP_COLORS nfs.conf sgml
bash_completion.d groff nfsmount.conf shadow
bashrc group nsswitch.conf shadow-
binfmt.d group- nsswitch.conf.bak shells
bluetooth grub2.cfg ntp skel
brltty grub.d ntp.conf smartmontools
brltty.conf gshadow numad.conf sos.conf
centos-release gshadow- oddjob speech-dispatcher
centos-release-upstream gss oddjobd.conf ssh
certmonger gssproxy oddjobd.conf.d ssl
cgconfig.conf host.conf openldap sssd
cgconfig.d hostname opt statetab
cgrules.conf hosts os-release statetab.d
cgsnapshot_blacklist.conf hosts.allow PackageKit subgid
chkconfig.d hosts.deny pam.d subuid
chrony.conf hp passwd sudo.conf
chrony.keys idmapd.conf passwd- sudoers
cifs-utils init.d pbm2ppa.conf sudoers.d
cron.d inittab pinforc sudo-ldap.conf
cron.daily inputrc pkcs11 sysconfig
cron.deny ipa pki sysctl.conf
cron.hourly iproute2 plymouth sysctl.d
cron.monthly ipsec.conf pm systemd
crontab ipsec.d pnm2ppa.conf system-release
cron.weekly ipsec.secrets polkit-1 system-release-cpe
crypttab iscsi popt.d target
csh.cshrc issue postfix tcsd.conf
csh.login issue.net ppp terminfo
cups java prelink.conf.d tmpfiles.d
cupshelpers jvm printcap trusted-key.key
dbus-1 jvm-commmon profile tuned
dconf kdump.conf profile.d udev
default kernel protocols udisks2
depmod.d krb5.conf pulse updatedb.conf
dhcp krb5.conf.d purple UPower
DIR_COLORS ksmtuned.conf python usb_modeswitch.conf
DIR_COLORS.256color ld.so.cache qemu-ga vconsole.conf
DIR_COLORS.lightbgcolor ld.so.conf qemu-kvm vimrc
dleyna-server-service.conf ld.so.conf.d radvd.conf virc
dnsmasq.conf libaudit.conf rc0.d vmware-tools
dnsmasq.d libibverbs.d rc1.d wgetrc
dracut.conf libnl rc2.d wpa_supplicant
dracut.conf.d libreport rc3.d wvdial.conf
drirc libuser.conf rc4.d X11
e2fsck.conf libvirt rc5.d xdg
enscript.cfg locale.conf rc6.d xinetd.d
environment localtime rc.d xml
ethertypes login.defs rc.local yum
exports logrotate.conf rdma yum.conf
exports.d logrotate.d redhat-release yum.repos.d
favicon.png lsm request-key.conf
fcoe lvm request-key.d
festival machine-id resolv.conf
[root@localhost etc]# cd ./yum.repos.d
[root@localhost yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost yum.repos.d]# mkdir adc
[root@localhost yum.repos.d]# ls
adc CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum.repos.d]# mv CentOS-* adc
[root@localhost yum.repos.d]# ls
adc
[root@localhost yum.repos.d]# vim aaa.repo
[root@localhost yum.repos.d]# ls
aaa.repo adc
[name]:仓库id
name :仓库名字
baseurl: 为仓库的地址
enable:是否开启当前仓库
gpgcheck:是否检查密钥,一种检验软件完整性的方式
[aaa]
name=test
baseurl=file:///mnt
enable=1
gpgcheck=0
~
~
~
~
~
~
~
~
~
~
[root@localhost yum.repos.d]# rpm -q lynx
未安装软件包 lynx
[root@localhost yum.repos.d]# yum install lynx -y
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 lynx.x86_64.0.2.8.8-0.3.dev15.el7 将被 安装
--> 解决依赖关系完成
依赖关系解决
======================================================================================================
Package 架构 版本 源 大小
======================================================================================================
正在安装:
lynx x86_64 2.8.8-0.3.dev15.el7 aaa 1.4 M
事务概要
======================================================================================================
安装 1 软件包
总下载量:1.4 M
安装大小:5.4 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : lynx-2.8.8-0.3.dev15.el7.x86_64 1/1
验证中 : lynx-2.8.8-0.3.dev15.el7.x86_64 1/1
已安装:
lynx.x86_64 0:2.8.8-0.3.dev15.el7
完毕!
[root@localhost yum.repos.d]#
注:在配置yum仓库文件时,需要先使用:yum clean all 清空yum仓库的缓存。