RPM安装

在进行RPM安装之前先需要配置环境,如下设置:

设置完成在/dev/目录中有cdrom链接文件

[root@localhost ~]# ll /dev/cdrom 
lrwxrwxrwx. 1 root root 3 Feb  9 08:46 /dev/cdrom -> sr0

然后,把光盘设备中的系统镜像挂载到目录(/media/cdrom)。

[root@localhost ~]# mkdir /media/cdrom
[root@localhost ~]# mount /dev/cdrom /media/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   18G  3.9G   14G  23% /
devtmpfs               905M     0  905M   0% /dev
tmpfs                  914M  148K  914M   1% /dev/shm
tmpfs                  914M  8.9M  905M   1% /run
tmpfs                  914M     0  914M   0% /sys/fs/cgroup
/dev/sda1              497M  119M  379M  24% /boot
/dev/sr0               3.5G  3.5G     0 100% /media/cdrom

这样在/media/cdrom/Packages/就能查看到很多RPM安装包

[root@localhost ~]# ls /media/cdrom/Packages/
yelp-libs-3.8.1-7.el7.x86_64.rpm
yelp-xsl-3.8.1-2.el7.noarch.rpm
ypbind-1.37.1-7.el7.x86_64.rpm
ypserv-2.31-8.el7.x86_64.rpm
yp-tools-2.14-3.el7.x86_64.rpm
.......省略.......
yum-rhn-plugin-2.0.1-4.el7.noarch.rpm
yum-utils-1.1.31-24.el7.noarch.rpm
zenity-3.8.0-4.el7.x86_64.rpm
zip-3.0-10.el7.x86_64.rpm
zlib-1.2.7-13.el7.i686.rpm
zlib-1.2.7-13.el7.x86_64.rpm
zlib-devel-1.2.7-13.el7.i686.rpm
zlib-devel-1.2.7-13.el7.x86_64.rpm
zsh-5.0.2-7.el7.x86_64.rpm
zziplib-0.13.62-5.el7.i686.rpm
zziplib-0.13.62-5.el7.x86_64.rpm
[root@localhost ~]# 

使用RPM命令安装软件telnet

[root@localhost ~]# cd /media/cdrom/Packages/
[root@localhost Packages]# rpm -ivh telnet-
telnet-0.17-59.el7.x86_64.rpm         telnet-server-0.17-59.el7.x86_64.rpm
[root@localhost Packages]# rpm -ivh telnet-0.17-59.el7.x86_64.rpm 
warning: telnet-0.17-59.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:telnet-1:0.17-59.el7             ################################# [100%]
[root@localhost Packages]# telnet
telnet>