LInux下如何掛載光盤(pán)找rpm包的方法步驟
寫(xiě)在前面
Linux 使用有時(shí)需要安裝軟件,當(dāng)然可以通過(guò) yum 命令來(lái)在線安裝,也可以通過(guò)下載好的 rpm 包來(lái)進(jìn)行安裝,但是 rpm 安裝需要自己來(lái)找安裝軟件所依賴(lài)的 rpm 包。今天就來(lái)嘗試操作下
系統(tǒng)環(huán)境 CentOS 7.5
[root@localhost /]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)
1.找到光盤(pán)的全路徑
[root@localhost /]# ls -l /dev | grep cdrom lrwxrwxrwx 1 root root 3 3月 3 09:32 cdrom -> sr0 crw-rw---- 1 root cdrom 21, 1 3月 3 09:32 sg1 brw-rw---- 1 root cdrom 11, 0 3月 3 09:32 sr0
這個(gè)命令知道了光盤(pán)的名字叫:cdrom,那光盤(pán)的路徑就是 /dev/cdrom
2.掛載光盤(pán)
[root@localhost /]# mount /dev/cdrom /mnt
mount: /dev/sr0 寫(xiě)保護(hù),將以只讀方式掛載
這個(gè)命令是把目錄 /dev/cdrom 的內(nèi)容加載到了目錄 /mnt 下,也就是說(shuō)目錄 /mnt 下可以訪問(wèn)目錄 /dev/cdrom 中的內(nèi)容了,出現(xiàn)如下內(nèi)容就掛載成功了
[root@localhost /]# cd /mnt/ [root@localhost mnt]# ls CentOS_BuildTag EULA images LiveOS repodata RPM-GPG-KEY-CentOS-Testing-77EFI GPL isolinux Packages RPM-GPG-KEY-CentOS-7 TRANS.TBL
3.拷貝目標(biāo)rpm包
進(jìn)入剛才的目錄 Packages ,然后找到目標(biāo)rpm包,這里以「telnet 客戶(hù)端」為例
[root@localhost mnt]# cd Packages/ [root@localhost Packages]# ls -l | grep telnet -rw-rw-r-- 2 root root 65632 8月 11 2017 telnet-0.17-64.el7.x86_64.rpm -rw-rw-r-- 2 root root 41804 8月 11 2017 telnet-server-0.17-64.el7.x86_64.rpm
這里出來(lái) 2 個(gè),但是看名稱(chēng)可以明白第一個(gè)是客戶(hù)端,另一個(gè)是服務(wù)端,這里選擇第一個(gè)即可,然后復(fù)制到 /root 下,出現(xiàn)如下結(jié)果即成功
[root@localhost Packages]# cp telnet-0.17-64.el7.x86_64.rpm /root/ [root@localhost Packages]# ls -l /root 總用量 72 -rw-------. 1 root root 1569 6月 3 2018 anaconda-ks.cfg -rw-r--r-- 1 root root 65632 3月 3 10:08 telnet-0.17-64.el7.x86_64.rpm -rw-r--r--. 1 root root 0 6月 30 2018 ????.txt
4.卸載光盤(pán)
知道目標(biāo)rpm包后,要記得卸載光盤(pán)哦?。ㄏ惹谐瞿夸?/mnt)
[root@localhost Packages]# cd / [root@localhost /]# umount /mnt/ [root@localhost /]# ls -l /mnt/ 總用量 0
5.安裝拷貝的rpm包
[root@localhost /]# cd root/ [root@localhost ~]# rpm -ivh telnet-0.17-64.el7.x86_64.rpm 準(zhǔn)備中... ################################# [100%] 軟件包 telnet-1:0.17-64.el7.x86_64 已經(jīng)安裝 [root@localhost ~]# telnet telnet>
出現(xiàn)如上內(nèi)容說(shuō)明 telnet 客戶(hù)端已經(jīng)安裝成功,是不是很簡(jiǎn)單?
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。