歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> yum安裝調試以及命令詳解

yum安裝調試以及命令詳解

日期:2017/2/28 14:30:26   编辑:Linux教程

背景,需要安裝cacti,google了很多安裝資料,需要先yum安裝一些准備lib包,比如snmp以及openssl等等。

[root@mysqlvm2 ~]# yum install net-snmp-devel

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

No package net-snmp-devel available.

Nothing to do

看到yum不識別,所以需要先在linux服務器上面安裝yum軟件包。

推薦閱讀

RedHat Linux 本地yum源的配置 http://www.linuxidc.com/Linux/2013-08/88217.htm

RedHat 6.2 Linux修改yum源免費使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm

配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htm

yum的配置文件說明 http://www.linuxidc.com/Linux/2013-04/83298.htm

RedHat 6.1下安裝yum(圖文) http://www.linuxidc.com/Linux/2013-06/86535.htm

YUM 安裝及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm



1 下載yum安裝包

下載地址:wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz

[root@mysqlvm2 ~]# wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz

--2014-05-15 20:56:34-- http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz

正在解析主機 yum.baseurl.org... 140.211.167.207

Connecting to yum.baseurl.org|140.211.167.207|:80... 已連接。

已發出 HTTP 請求,正在等待回應... 200 OK

長度:1140370 (1.1M) [application/x-gzip]

Saving to: `yum-3.4.3.tar.gz\


2 解壓縮安裝


tar -xvf yum-3.4.3.tar.gz

cd yum-3.4.3

yum main.py install yum

[root@mysqlvm2 yum-3.4.3]# yum main.py install yum

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

usage: yum [options] COMMAND

List of Commands:

紅帽中出現This system is not registered with RHN這個的原因是因為紅帽中沒有注冊RHN。解決辦法:(假定你已安裝yum,且網絡暢通)更改yum的源,即更換/etc/yum.repos.d /rhel-debuginfo.repo 這個文件。進入/etc/yum.repos.d/目錄,終端中輸入wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo即可在此目錄下得到CentOS- Base.repo文件,這是centos的源文件,只需將其重命名為rhel-debuginfo.repo即可,以前的文件做個備份。

wget http://www.linuxidc.com/files/2011/05/06/CentOS-Base.repo

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak


[root@localhost yum.repos.d]# cp rhel-debuginfo.repo rhel-debuginfo.repo.bak

[root@localhost yum.repos.d]# mv CentOS-Base.repo rhel-debuginfo.repo

mv:是否覆蓋“rhel-debuginfo.repo”? y

[root@localhost yum.repos.d]#

[root@mysqlvm2 yum-3.4.3]# yum makecache

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

addons | 1.9 kB 00:00

addons/filelists_db | 570 B 00:00

addons/other_db | 554 B 00:00

addons/primary_db

[root@mysqlvm2 yum-3.4.3]# yum install httpd

Loaded plugins: rhnplugin, security

This system is not registered with RHN.

RHN support will be disabled.

Setting up Install Process

Package httpd-2.2.3-85.el5.centos.x86_64 already installed and latest version

Nothing to do

更多詳情見請繼續閱讀下一頁的精彩內容: http://www.linuxidc.com/Linux/2014-06/103814p2.htm

Copyright © Linux教程網 All Rights Reserved