您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關Redhat linux如何配置本地yum源的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
首先給大家介紹常用的yum源命令:
1.使用YUM查找軟件包
命令:yum search <keyword>
2.列出所有可安裝的軟件包
命令:yum list
3.列出所有可更新的軟件包
命令:yum list updates
4.列出所有已安裝的軟件包
命令:yum list installed
5.列出所有已安裝但不在 Yum Repository 內的軟件包
命令:yum list extras
6.列出所指定的軟件包
命令:yum list <package_name>
7.使用YUM獲取軟件包信息
命令:yum info <package_name>
8.列出所有軟件包的信息
命令:yum info
9.列出所有可更新的軟件包信息
命令:yum info updates
10.列出所有已安裝的軟件包信息
命令:yum info installed
11.列出所有已安裝但不在 Yum Repository 內的軟件包信息
命令:yum info extras
12.列出軟件包提供哪些文件
命令:yum provides <package_name>
下面給大家介紹一下本地yum源的配置方法,非常簡單:
拷貝系統安裝盤Server/目錄下的全部軟件到/RPMS
[root@localhost Server]# cp * /RPMS
......等的時間可能比較長。軟件數目比較多。
安裝createrespo創建軟件倉庫:
代碼如下:
[root@localhost RPMS]# cd /RPMS/
[root@localhost RPMS]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@localhost RPMS]# cp /mnt/cdrom /RPMS/
[root@localhost RPMS]# createrepo -p /RPMS/
2292/2292 - libXt-1.0.2-3.1.fc6.i386.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
配置rhel-debuginfo.repo
代碼如下:
[root@localhost /]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-debuginfo.repo
[root@localhost yum.repos.d]#
代碼如下:
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
代碼如下:
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=file:///RPMS/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
更新軟件包
代碼如下:
[root@localhost RPMS]# yum update
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
rhel-debuginfo | 951 B 00:00
rhel-debuginfo/primary | 829 kB 00:00
rhel-debuginfo 2292/2292
Skipping security plugin, no data
Setting up Update Process
No Packages marked for Update
[root@localhost RPMS]#
這樣應該就可以了,你可以檢驗一下[以gcc為例]:
代碼如下:
[root@localhost RPMS]# yum install gcc
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.i386 0:4.1.2-46.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================
Package Arch Version Repository Size
==============================================================================================
Installing:
gcc i386 4.1.2-46.el5 rhel-debuginfo 5.2 M
Transaction Summary
==============================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 5.2 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : gcc 1/1
Installed:
gcc.i386 0:4.1.2-46.el5
Complete!
[root@localhost RPMS]#
感謝各位的閱讀!關于“Redhat linux如何配置本地yum源”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。