[root@aminglinux02 ~]# mount /dev/cdrom /mnt
mount: /dev/sr0 写保护,将以只读方式挂载
[root@aminglinux02 ~]# cd /mnt/
[root@aminglinux02 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@aminglinux02 mnt]# cd Packages/
[root@aminglinux02 Packages]# ls
zenity-3.8.0-5.el7.x86_64.rpm
zip-3.0-11.el7.x86_64.rpm
zlib-1.2.7-17.el7.x86_64.rpm
zlib-devel-1.2.7-17.el7.x86_64.rpm
zsh-5.0.2-25.el7.x86_64.rpm
zziplib-0.13.62-5.el7.x86_64.rpm
[root@aminglinux02 Packages]# rpm -ivh zsh-5.0.2-28.el7.x86_64.rpm
准备中... ################################# [100%]
正在升级/安装...
1:zsh-5.0.2-28.el7 ################################# [100%]
[root@aminglinux02 Packages]# rpm -Uvh zsh-5.0.2-28.el7.x86_64.rpm
准备中... ################################# [100%]
软件包 zsh-5.0.2-28.el7.x86_64 已经安装
[root@aminglinux02 Packages]# rpm -e zsh
没有提示就是卸载成功
[root@aminglinux02 ~]# rpm -qf /usr/bin/xxd
vim-common-7.4.160-2.el7.x86_64
[root@aminglinux-02 Packages]# rpm -qf `which cd` (反引号包含命令)
bash-4.2.46-20.el7_2.x86_64
[root@aminglinux-02 Packages]# which cd
/usr/bin/cd
[root@aminglinux-02 Packages]#
yum的配置文件
[root@aminglinux-02 ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@aminglinux-02 ~]#
[root@aminglinux02 ~]# yum list |grep ‘vim‘
vim-common.x86_64 2:7.4.160-2.el7 @base
vim-enhanced.x86_64 2:7.4.160-2.el7 @base
vim-filesystem.x86_64 2:7.4.160-2.el7 @base
vim-minimal.x86_64 2:7.4.160-2.el7 @anaconda
protobuf-vim.x86_64 2.5.0-8.el7 base
vim-X11.x86_64 2:7.4.160-2.el7 base
[dvd]
name=install dvd 自定义名称
baseurl=file:///mnt 光驱路径
enable=1 是否可用,0时不可用
gpgcheck=0 是否检测,0不检测
NetworkManager.x86_64 1:1.8.0-9.el7 @anaconda
NetworkManager-libnm.x86_64 1:1.8.0-9.el7 @anaconda
NetworkManager-team.x86_64 1:1.8.0-9.el7 @anaconda
NetworkManager-tui.x86_64 1:1.8.0-9.el7 @anaconda
原文地址:http://blog.51cto.com/akui2521/2104582