1、mkdir /mnt/cdrom
2、mount /dev/cdrom /mnt/cdrom
3、取消挂载
umount /dev/cdrom /mnt/cdrom
3、进入目录rpm包的目录
cd cdrom
cd Packages
4、查询是否安装过git包
[root@yum-server Packages]# rpm -qa git
git-1.7.1-3.el6_4.1.x86_64 #已经安装,不需要再装,如果查不到结果,表示没有安装。
5、查看光盘中是否有应该软件包
[root@yum-server Packages]# find git*
git-1.7.1-3.el6_4.1.x86_64.rpm
6、安装该rpm包:
正常安装rpm包
[root@yum-server Packages]# rpm -ivh git*.rpm
Preparing... ########################################### [100%]
package git-1.7.1-3.el6_4.1.x86_64 is already installed
强制安装
[root@yum-server Packages]#rpm -ivhgit*.rpm--force
7、卸载rpm包:
- 卸载rpm包
rpm -e git
- 忽略依赖性删除
rpm -e git--nodeps
8、查看安装在什么位置
[root@yum-server Packages]# rpm -ql git
/etc/bash_completion.d
/etc/bash_completion.d/git
/usr/bin/git
/usr/bin/git-receive-pack
/usr/bin/git-shell
/usr/bin/git-upload-archive
/usr/bin/git-upload-pack
/usr/libexec/git-core
/usr/libexec/git-core/git
/usr/libexec/git-core/git-add
9、卸载挂载点命令
#卸载命令,卸载时记得先退出当前目录,再卸载,否则会报错。
[root@yum-server Packages]#df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 10035836 1983892 7535492 21% /
tmpfs 953456 0 953456 0% /dev/shm
/dev/sda1 194241 40534 143467 23% /boot
/dev/sr0 3803432 3803432 0 100% /root/cdrom
[root@yum-server Packages]# cd [root@yum-server ~]# umount /root/cdrom