濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > Linux yum安裝過(guò)程圖文詳解

Linux yum安裝過(guò)程圖文詳解

熱門(mén)標(biāo)簽:智能電話(huà)機(jī)器人哪個(gè)公司有名 免費(fèi)地圖標(biāo)注店 億信虛擬網(wǎng)絡(luò)電話(huà)外呼系統(tǒng) 凱立德飛機(jī)場(chǎng)地圖標(biāo)注點(diǎn) 北京電話(huà)機(jī)器人哪家便宜 百度地圖標(biāo)注多少個(gè) 簡(jiǎn)易地圖標(biāo)注應(yīng)用 湖南電話(huà)機(jī)器人開(kāi)發(fā)團(tuán)隊(duì) 地圖標(biāo)注需要學(xué)什么
Yum可以從眾多軟件包倉(cāng)庫(kù)中搜索軟件的依賴(lài)關(guān)系,因此可以減少由于依賴(lài)關(guān)系帶來(lái)的問(wèn)題。還有就是我們?cè)谑褂脠D形界面時(shí),在應(yīng)用程序-添加刪除軟件下的瀏覽里是空的。如下圖:

第一種方法:(推薦)
第一步:新建一個(gè)文件夾,并把光盤(pán)內(nèi)的所有文件復(fù)制到這個(gè)文件夾里:
[root@localhost ~]# mkdir /yum
[root@localhost ~]# cp -rvf /misc/cd/* /yum
第二步:備份repodata文件。因?yàn)橛兴膫€(gè)文件夾里都有這個(gè)文件,所以都要備份。
[root@localhost ~]# mv /yum/Server/repodata /yum/Server/repodata.bak
[root@localhost ~]# mv /yum/VT/repodata /yum/VT/repodata.bak
[root@localhost ~]# mv /yum/Cluster/repodata /yum/Cluster/repodata.bak
[root@localhost ~]# mv /yum/ClusterStorage/repodata /yum/ClusterStorage/repodata.bak
第三步:安裝工具包:
[root@localhost ~]# rpm -ivh /yum/Server/createrepo-0.4.11-3.el5.noarch.rpm
第四步:生成倉(cāng)庫(kù)數(shù)據(jù)庫(kù):
[root@localhost ~]# createrepo -g /yum/Server/repodata.bak/comps-rhel5-server-core.xml /yum/Server/
[root@localhost ~]# createrepo -g /yum/VT/repodata.bak/comps-rhel5-vt.xml /yum/VT/
[root@localhost ~]# createrepo -g /yum/Cluster/repodata.bak/ /yum/Cluster
[root@localhost ~]# createrepo -g /yum/ClusterStorage/repodata.bak/comps-rhel5-cluster-st.xml /yum/ClusterStorage/
第五步:查看倉(cāng)庫(kù)數(shù)據(jù)文件:
[root@localhost ~]# ls /yum/Server/repodata/
comps-rhel5-server-core.xml //這個(gè)文件軟件包組的分類(lèi)。
filelists.xml.gz other.xml.gz primary.xml.gz //這三個(gè)文件為軟件包列表文件。
repomd.xml   //這個(gè)文件為MD5校驗(yàn)信息。
在/yum/VT /yum/Cluster /yum/ClusterStorage下面都有這幾個(gè)文件,作用和這一樣。如果想更新軟件包,只需把下載完的軟件包放在Server或者其他三個(gè)目錄里,再使用第四步重新生成數(shù)據(jù)庫(kù)文件即可。
第六步:客戶(hù)端配置:主要修改下面紅色的部分:
[root@localhost ~]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/chenbin.repo
[root@localhost ~]# vi /etc/yum.repos.d/chenbin.repo
[rhel-Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
第七步:查看:如圖,已經(jīng)出現(xiàn)軟件列表了。

如果在上圖中的編輯里選擇軟件存儲(chǔ)庫(kù),就出現(xiàn)下圖:

如果把這里的勾去掉,再次打開(kāi)就沒(méi)有軟件列表了,同時(shí)在/etc/yum.repos.d/chenbin.repo配置文件下的enabled=0。
清除一下yum安裝時(shí)的緩存:
[root@localhost ~]# yum clean all
安裝一個(gè)軟件試試:
[root@localhost ~]# rpm -ivh /yum/Server/httpd-2.2.3-22.el5.i386.rpm
warning: /yum/Server/httpd-2.2.3-22.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
        libapr-1.so.0 is needed by httpd-2.2.3-22.el5.i386
        libaprutil-1.so.0 is needed by httpd-2.2.3-22.el5.i386
因?yàn)橐蕾?lài)關(guān)系,所以不能安裝。用如下命令安裝:
[root@localhost ~]# yum install /yum/Server/httpd-2.2.3-22.el5.i386.rpm
系統(tǒng)會(huì)自動(dòng)安裝完成。Yum缷載如下:
[root@localhost ~]# yum remove httpd。
1.2第二種方法:
第一步:同上,創(chuàng)建一個(gè)新文件夾,并把光盤(pán)的內(nèi)容全部復(fù)制到該文件夾內(nèi):
[root@localhost ~]# mkdir /yum
[root@localhost ~]# cp -rvf /misc/cd/* /yum
第二步:安裝工具包:
[root@localhost ~]# rpm -ivh /yum/Server/createrepo-0.4.11-3.el5.noarch.rpm
第三步:生成倉(cāng)庫(kù)數(shù)據(jù)庫(kù):
[root@localhost ~]# cd /yum
[root@localhost yum]# createrepo .      //注意后面的.
第四步:查看文件:文件作用同上:
[root@localhost yum]# ls /yum/repodata/
filelists.xml.gz other.xml.gz primary.xml.gz repomd.xml
第五步:客戶(hù)端配置:
[root@localhost ~]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/chenbin.repo
[root@localhost ~]# vi /etc/yum.repos.d/chenbin.repo
[rhel-chenbin]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///yum/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清除yum安裝時(shí)的緩存:
[root@localhost ~]# yum clean all
至此,yum安裝完成,但使用這種方法安裝后在應(yīng)用程序-添加刪除軟件的列表是空的,但使用yum安裝軟件是可以的。
[root@localhost ~]# yum install /yum/Server/httpd-2.2.3-22.el5.i386.rpm
[root@localhost ~]# yum remove httpd
1.3第三種方法:
首先把光盤(pán)放入光驅(qū)內(nèi):
然后復(fù)制配置文件:
[root@localhost ~]# cp /etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/chenbin.repo
最后編輯配置文件:
[root@localhost ~]# vi /etc/yum.repos.d/chenbin.repo
[rhel-Server]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///misc/cd/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///misc/cd/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///misc/cd/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///misc/cd/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清除緩存:
[root@localhost ~]# yum clean all
這種方法安裝后在應(yīng)用程序-添加刪除軟件里也有列表。同樣可以使用yum安裝缷載
[root@localhost ~]# yum install /misc/cd/Server/httpd-2.2.3-22.el5.i386.rpm
[root@localhost ~]# yum remove httpd
如果把光盤(pán)拿出后,在應(yīng)用程序-添加刪除軟件就沒(méi)有列表了,只要放入光盤(pán)就有。
1.4總結(jié):YUM常用命令:
1.安裝軟件包:
yum install package
yum localinstall package 從本機(jī)目錄安裝軟件包
yum groupinstall group 安裝某個(gè)組件的全部軟件包
2.更新軟件包:
yum update package
yum check-update 列出所有可更新的軟件包
yum list updates mysql* 查找mysql的更新
yum update 更新所有可更新的軟件包
yum update mysql* 更新所有mysql的軟件包
yum groupupdate group 更新某個(gè)組件的所有軟件包
yum list 列出所有已安裝和倉(cāng)庫(kù)中可用的軟件包
yum list available 列出倉(cāng)庫(kù)中所有可用的軟件包
yum list updates 列出倉(cāng)庫(kù)中比當(dāng)前系統(tǒng)更新的軟件包
yum list installed 列出已安裝的軟件包
yum list recent 列出新加入倉(cāng)庫(kù)的軟件包
yum info 查詢(xún)軟件包信息
      
3.刪除軟件包:
yum remove package
yum groupremove group 刪除某個(gè)組件的全部軟件包
4.清除軟件包
yum clean packages 清除遺留在緩存里的包文件
yum clean metadata 清除遺留在緩存里的元數(shù)據(jù)
yum clean headers 清除遺留在緩存里的頭文件
yum clean all 清除包文件,元數(shù)據(jù),頭文件
5.搜索軟件包:
yum search package
yum info package 查找一個(gè)軟件包的信息
yum list package 列出包含指定信息的軟件包
yum list installed 列出已安裝的軟件包
yum list extras 列出不是通過(guò)軟件倉(cāng)庫(kù)安裝的軟件包
yum list *ttp* 列出標(biāo)題包含ttp的軟件包
yum list updates 列出可以更新的軟件包
6.查找特定文件是由什么軟件包提供的:
yum whatprovides filename
例子:
yum whatprovides httpd.conf
可用選項(xiàng)
–disalberepo=lib 禁用某個(gè)軟件倉(cāng)庫(kù)
–enalberepo=lib 啟用某個(gè)軟件倉(cāng)庫(kù)
-C 禁用使用本機(jī)緩存的元數(shù)據(jù)
例子:
yum –disalberepo=livna|–enalberepo=livna install mplayer
yum -C info httpd

標(biāo)簽:遼陽(yáng) 眉山 龍巖 延邊 淘寶邀評(píng) 大興安嶺 南陽(yáng) 北海

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux yum安裝過(guò)程圖文詳解》,本文關(guān)鍵詞  Linux,yum,安裝,過(guò)程,圖文,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux yum安裝過(guò)程圖文詳解》相關(guān)的同類(lèi)信息!
  • 本頁(yè)收集關(guān)于Linux yum安裝過(guò)程圖文詳解的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    湖北省| 新源县| 石狮市| 长宁县| 邢台县| 噶尔县| 西畴县| 永平县| 南昌市| 阿克苏市| 福泉市| 靖西县| 陈巴尔虎旗| 自治县| 新密市| 重庆市| 松阳县| 嫩江县| 中西区| 井研县| 施甸县| 河北区| 平顺县| 辽中县| 芜湖县| 瓦房店市| 乌兰察布市| 邳州市| 罗源县| 威宁| 曲麻莱县| 海淀区| 乐山市| 武夷山市| 和顺县| 合江县| 兴安盟| 沈丘县| 和林格尔县| 广汉市| 乌兰浩特市|