一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Linux|Centos|Ubuntu|系統進程|Fedora|注冊表|Bios|Solaris|Windows7|Windows10|Windows11|windows server|

服務器之家 - 服務器系統 - Linux - Linux yum安裝過程圖文詳解

Linux yum安裝過程圖文詳解

2020-04-03 18:30Linux教程網 Linux

當我們在liunx系統中安裝某個軟件時,經常會遇到一些軟件的依賴問題。yum或者Yellow dog Update或者Modified是杜克大學為了提高RPM軟件包安裝性而開發的一種軟件包管理器。

Yum可以從眾多軟件包倉庫中搜索軟件的依賴關系,因此可以減少由于依賴關系帶來的問題。還有就是我們在使用圖形界面時,在應用程序-添加刪除軟件下的瀏覽里是空的。如下圖:

Linux yum安裝過程圖文詳解

第一種方法:(推薦)

第一步:新建一個文件夾,并把光盤內的所有文件復制到這個文件夾里:

[root@localhost ~]# mkdir /yum

[root@localhost ~]# cp -rvf /misc/cd/* /yum

第二步:備份repodata文件。因為有四個文件夾里都有這個文件,所以都要備份。

[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

第四步:生成倉庫數據庫:

[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/

第五步:查看倉庫數據文件:

[root@localhost ~]# ls /yum/Server/repodata/

comps-rhel5-server-core.xml//這個文件軟件包組的分類。

filelists.xml.gzother.xml.gzprimary.xml.gz//這三個文件為軟件包列表文件。

repomd.xml //這個文件為MD5校驗信息。

在/yum/VT /yum/Cluster /yum/ClusterStorage下面都有這幾個文件,作用和這一樣。如果想更新軟件包,只需把下載完的軟件包放在Server或者其他三個目錄里,再使用第四步重新生成數據庫文件即可。

第六步:客戶端配置:主要修改下面紅色的部分:

[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

第七步:查看:如圖,已經出現軟件列表了。

Linux yum安裝過程圖文詳解

如果在上圖中的編輯里選擇軟件存儲庫,就出現下圖:

Linux yum安裝過程圖文詳解

如果把這里的勾去掉,再次打開就沒有軟件列表了,同時在/etc/yum.repos.d/chenbin.repo配置文件下的enabled=0。

清除一下yum安裝時的緩存:

[root@localhost ~]# yum clean all

安裝一個軟件試試:

[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

因為依賴關系,所以不能安裝。用如下命令安裝:

[root@localhost ~]# yum install /yum/Server/httpd-2.2.3-22.el5.i386.rpm

系統會自動安裝完成。Yum缷載如下:

[root@localhost ~]# yum remove httpd。

1.2

第一步:同上,創建一個新文件夾,并把光盤的內容全部復制到該文件夾內:

[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

第三步:生成倉庫數據庫:

[root@localhost ~]# cd /yum

[root@localhost yum]# createrepo . //注意后面的.

第四步:查看文件:文件作用同上:

[root@localhost yum]# ls /yum/repodata/

filelists.xml.gzother.xml.gzprimary.xml.gzrepomd.xml

第五步:客戶端配置:

[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安裝時的緩存:

[root@localhost ~]# yum clean all

至此,yum安裝完成,但使用這種方法安裝后在應用程序-添加刪除軟件的列表是空的,但使用yum安裝軟件是可以的。

[root@localhost ~]# yum install /yum/Server/httpd-2.2.3-22.el5.i386.rpm

[root@localhost ~]# yum remove httpd

1.3

首先把光盤放入光驅內:

然后復制配置文件:

[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

這種方法安裝后在應用程序-添加刪除軟件里也有列表。同樣可以使用yum安裝缷載

[root@localhost ~]# yum install /misc/cd/Server/httpd-2.2.3-22.el5.i386.rpm

[root@localhost ~]# yum remove httpd

如果把光盤拿出后,在應用程序-添加刪除軟件就沒有列表了,只要放入光盤就有。

1.4

1.安裝軟件包:

yum install package

yum localinstall package 從本機目錄安裝軟件包

yum groupinstall group 安裝某個組件的全部軟件包

2.更新軟件包:

yum update package

yum check-update 列出所有可更新的軟件包

yum list updates mysql* 查找mysql的更新

yum update 更新所有可更新的軟件包

yum update mysql* 更新所有mysql的軟件包

yum groupupdate group 更新某個組件的所有軟件包

yum list 列出所有已安裝和倉庫中可用的軟件包

yum list available 列出倉庫中所有可用的軟件包

yum list updates 列出倉庫中比當前系統更新的軟件包

yum list installed 列出已安裝的軟件包

yum list recent 列出新加入倉庫的軟件包

yum info 查詢軟件包信息

3.刪除軟件包:

yum remove package

yum groupremove group 刪除某個組件的全部軟件包

4.清除軟件包

yum clean packages 清除遺留在緩存里的包文件

yum clean metadata 清除遺留在緩存里的元數據

yum clean headers 清除遺留在緩存里的頭文件

yum clean all 清除包文件,元數據,頭文件

5.搜索軟件包:

yum search package

yum info package 查找一個軟件包的信息

yum list package 列出包含指定信息的軟件包

yum list installed 列出已安裝的軟件包

yum list extras 列出不是通過軟件倉庫安裝的軟件包

yum list *ttp* 列出標題包含ttp的軟件包

yum list updates 列出可以更新的軟件包

6.查找特定文件是由什么軟件包提供的:

yum whatprovides filename

例子:

yum whatprovides httpd.conf

可用選項

–disalberepo=lib 禁用某個軟件倉庫

–enalberepo=lib 啟用某個軟件倉庫

-C 禁用使用本機緩存的元數據

例子:

yum –disalberepo=livna|–enalberepo=livna install mplayer

yum -C info httpd

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 精品国产免费第一区二区三区日韩 | 91亚洲一区二区在线观看不卡 | 欧美久久天天综合香蕉伊 | 日本一区二区不卡久久入口 | 天天狠天天天天透在线 | 欧美一区二区三区免费观看视频 | 我与岳乱短篇小说 | 欧美大片一区二区三区 | 爽好紧别夹宝贝叫大声点护士 | 精品一区二区三区五区六区 | jiujiure精品 | 五月天精品视频播放在线观看 | 5g影院天天爽 | 王晶三级作品 | 四虎精品成人免费视频 | 国产资源站 | 4虎tv| 果冻传媒在线播放观看w | 久久人妻少妇嫩草AV无码 | 精品一区二区三区在线视频观看 | 性刺激欧美三级在线现看中文 | 户外露出野战hd | 日韩精品首页 | 男人和女人上床 | 99视频在线观看视频一区 | 五月天精品在线 | 国产精品久久久久jk制服 | 国产精品理论片 | 日本小视频免费 | 99精品在线| 日本久久啪啪婷婷激情五月 | 欧美同性gayvidoes | 国产香蕉一区二区在线网站 | 亚洲欧美久久久久久久久久爽网站 | 国产良心大作白丝精厕 | 欧美日韩高清观看一区二区 | 免费视频大全 | 国产伦精一区二区三区视频 | 91高清免费国产自产 | 毛片免费观看 | 国产成人激情 |