RedHat Enterprise Linux 6.4使用Centos6 的yum源 (32位系统,不挂载光盘使用线上源)

来源:互联网 发布:淘宝到货短信提醒 编辑:程序博客网 时间:2024/06/05 05:36
更新rehatYUM (使用centos的源)

[root@localhost yum.repos.d]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search centos
search linuxtone
nameserver 8.8.8.8
nameserver 192.168.1.1
nameserver 192.168.92.2

如果想快捷的,直接用外网的141的DNS配置。如果是自动获取的IP地址,那么重新获取的话,DNS里的配置也会变。

一:
[root@localhost ~]# yum install -y gcc
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
No package gcc available.
Error: Nothing to do
[root@localhost ~]# cd /root/packages/
[root@localhost packages]# ls
python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@localhost packages]#
[root@localhost packages]# rm -rf *
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# wget http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
--2014-07-06 02:50:08--  http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
Resolving mirror.symnds.com... 63.245.196.124
Connecting to mirror.symnds.com|63.245.196.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37052 (36K) [application/x-redhat-package-manager]
Saving to: “python-iniparse-0.3.1-2.1.el6.noarch.rpm”

100%[=============================================================================================================================>] 37,052       146K/s   in 0.2s    

2014-07-06 02:50:09 (146 KB/s) - “python-iniparse-0.3.1-2.1.el6.noarch.rpm” saved [37052/37052]



[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# wget http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm  
--2014-07-06 02:52:11--  http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm
Resolving mirror.symnds.com... 63.245.196.124
Connecting to mirror.symnds.com|63.245.196.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27140 (27K) [application/x-redhat-package-manager]
Saving to: “yum-metadata-parser-1.1.2-16.el6.i686.rpm”

100%[=============================================================================================================================>] 27,140      67.0K/s   in 0.4s    

2014-07-06 02:52:13 (67.0 KB/s) - “yum-metadata-parser-1.1.2-16.el6.i686.rpm” saved [27140/27140]

[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# wget http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm    
--2014-07-06 02:53:14--  http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
Resolving mirror.symnds.com... 63.245.196.124
Connecting to mirror.symnds.com|63.245.196.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1019540 (996K) [application/x-redhat-package-manager]
Saving to: “yum-3.2.29-40.el6.centos.noarch.rpm”

100%[=============================================================================================================================>] 1,019,540    352K/s   in 2.8s    

2014-07-06 02:53:17 (352 KB/s) - “yum-3.2.29-40.el6.centos.noarch.rpm” saved [1019540/1019540]

[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# wget http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
--2014-07-06 02:53:42--  http://mirror.symnds.com/distributions/CentOS-vault/6.4/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
Resolving mirror.symnds.com... 63.245.196.124
Connecting to mirror.symnds.com|63.245.196.124|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 28220 (28K) [application/x-redhat-package-manager]
Saving to: “yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm”

100%[=============================================================================================================================>] 28,220       103K/s   in 0.3s    

2014-07-06 02:53:43 (103 KB/s) - “yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm” saved [28220/28220]

[root@localhost packages]# rpm -aq | grep yum|xargs rpm -e --nodeps
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
        package python-iniparse-0.3.1-2.1.el6.noarch is already installed
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# rpm -e python-iniparse-0.3.1-2.1.el6.noarch
error: Failed dependencies:
        python-iniparse is needed by (installed) python-rhsm-1.1.8-1.el6.i686
        python-iniparse is needed by (installed) subscription-manager-1.1.23-1.el6.i686
[root@localhost packages]# rpm -e python-iniparse-0.3.1-2.1.el6.noarch --nodeps
[root@localhost packages]#
[root@localhost packages]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:python-iniparse        ########################################### [100%]
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
warning: yum-metadata-parser-1.1.2-16.el6.i686.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [100%]
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]#
[root@localhost packages]# rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
warning: yum-3.2.29-40.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...                ########################################### [100%]
   1:yum-plugin-fastestmirro########################################### [ 50%]
   2:yum                    ########################################### [100%]
[root@localhost packages]#
[root@localhost packages]#




二:
[root@localhost packages]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# mv rhel-source.repo  rhel-source.repo.bak
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
--2014-07-06 03:03:34--  http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
Resolving docs.linuxtone.org... 203.74.150.88
Connecting to docs.linuxtone.org|203.74.150.88|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1426 (1.4K) [application/octet-stream]
Saving to: “CentOS-Base.repo”

100%[======================================>] 1,426       --.-K/s   in 0s      

2014-07-06 03:03:35 (56.8 MB/s) - “CentOS-Base.repo” saved [1426/1426]

[root@localhost yum.repos.d]# ls
CentOS-Base.repo  rhel-source.repo.bak
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# mv  CentOS-Base.repo   rhel-source.repo  
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# ls
rhel-source.repo  rhel-source.repo.bak
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: addons base extras update
Cleaning up Everything
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Determining fastest mirrors
addons                                                   | 1.9 kB     00:00     
addons/filelists_db                                      |  574 B     00:00     
addons/primary_db                                        | 1.1 kB     00:00     
addons/other_db                                          |  550 B     00:00     
base                                                     | 1.1 kB     00:00     
base/group                                               | 1.1 MB     00:00     
base/filelists                                           | 3.1 MB     00:01     
base/primary                                             | 995 kB     00:00     
base/other                                               |  11 MB     00:04     
base                                                                  2789/2789
base                                                                  2789/2789
base                                                                                                                                                         2789/2789
extras                                                                                                                                          | 2.1 kB     00:00     
extras/group                                                                                                                                    | 9.7 kB     00:00     
extras/filelists_db                                                                                                                             | 211 kB     00:00     
extras/primary_db                                                                                                                               | 164 kB     00:00     
extras/other_db                                                                                                                                 | 431 kB     00:00     
update                                                                                                                                          | 1.9 kB     00:00     
update/filelists_db                                                                                                                             | 2.7 MB     00:00     
update/primary_db                                                                                                                               | 483 kB     00:00     
update/other_db                                                                                                                                 |  14 MB     00:06     
Metadata Cache Created
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#



 yum --skip-broken update
 
 
 到此若使用yum还是会存在问题。 (以下可解决以下此问题)
Error: Package: glibc-headers-2.5-118.el5_10.2.i386 (update)
           Requires: glibc = 2.5-118.el5_10.2
           Installed: glibc-2.12-1.107.el6.i686 (@anaconda-RedHatEnterpriseLinux-201301301449.i386/6.4)
               glibc = 2.12-1.107.el6
           Available: glibc-2.5-118.i386 (base)
               glibc = 2.5-118
           Available: glibc-2.5-118.el5_10.2.i386 (update)
               glibc = 2.5-118.el5_10.2
Error: Package: glibc-devel-2.5-118.el5_10.2.i386 (update)
           Requires: glibc = 2.5-118.el5_10.2
           Installed: glibc-2.12-1.107.el6.i686 (@anaconda-RedHatEnterpriseLinux-201301301449.i386/6.4)
               glibc = 2.12-1.107.el6
           Available: glibc-2.5-118.i386 (base)
               glibc = 2.5-118
           Available: glibc-2.5-118.el5_10.2.i386 (update)
               glibc = 2.5-118.el5_10.2
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
rhn-check-1.0.0.1-4.el6.noarch has missing requires of yum-rhn-plugin >= ('0', '0.9.1', '35')



这个问题一般是以下这个文件的问题:

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-source.repo

验证过的文件:

cat    rhel-source.repo


# CentOS-Base.repo

#

# The mirror system uses the connecting IP addressof the client and the

# update status of each mirror to pick mirrors thatare updated to and

# geographically close to theclient.  You should use this for CentOSupdates

# unless you are manually picking othermirrors.

#

# If the mirrorlist= does not work for you, as afall back you can try the

# remarked out baseurl= line instead.

#

#

 

[base]

name=CentOS-6 - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#additional packages that extend functionality ofexisting packages

[centosplus]

name=CentOS-6 - Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


至此结束。重新YUM INSTALL成功。




0 0
原创粉丝点击