yum问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了yum问题相关的知识,希望对你有一定的参考价值。


解决yum不能用的问题(“对其他方法”的总结,得出以下的分析,及解决方法)
自己CentOS minimal 6.4中的yum不能用,install 任何软件都说找没有包可以使用.
但是CentOS minimal 6.4自带的yum是不会有错的啊,很可能是被不小心改动过.


# cd /etc/yum.repos.d
# ls -all
/etc/yum.repos.d 目录下的所有文件都是以.repo结尾的,如果不是肯定有问题.
我的/etc/yum.repos.d 目录下 有CentOS-Base.repo.backup,问题就在这里,
解决办法:mv CentOS-Base.repo.backup CentOS-Base.repo 这样一句话就解决问题.

其他方法(来自热心的网友):
方法一:
0. 先在 /etc/yum.repos.d/ 下建立一个 backup 文件夹  # mkdir /etc/yum.repos.d/backup
1.将有问题的Base文件进/etc/yum.repos.d/backup文件夹
2.更改/etc/yum.repos.d/CentOS-Base.repo.backup 名字,将这个名字更改成什么啊??                             
3.将CentOS-Base.repo.backup  这个文件的 backup删去




方法二:
​​​ http://www.lishiming.net/thread-426-1-1.html  ​​​ 1.删除/etc/yum.repos.d目录所有的repo文件


2.下载CentOS-Base-163.repo, 放入/etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo -O /etc/yum.repos.d/CentOS-Base-163.repo


3. rm -rf /var/cache/yum/*
运行yum makecache生成缓存


4.yum search softwarename 查找软件


5.yum list softwarename 列出已装软件


6.yum install softwarename 安装软件


7.yun remove softwarename 卸载软件


____________________________________


CentOS-Base-163.repo源文件如下:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#


[base]
name=CentOS-$releasever - Base - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


#released updates 
[updates]
name=CentOS-$releasever - Updates - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


curl "url_address" -O; 在指定的url_address下载资源,没有wget的时候不错的选择


方法三:(网上找的)
更新方法如下:
先进入yum源配置目录
cd /etc/yum.repos.d


备份系统自带的yum源
mv CentOS-Base.repo CentOS-Base.repo.bak


下载其他更快的yum源
中科大的yum源:
wget http://centos.ustc.edu.cn/CentOS-Base.repo
163的yum源:
wget http://mirrors.163.com/.help/CentOS-Base-163.repo

以上是关于yum问题的主要内容,如果未能解决你的问题,请参考以下文章

Linux(RadHat)基础学习—软件安装

Mongodb以及rockmongo安装

为啥 miniKanren 的名字总是以 `o` 结尾?

ruby简单的基础 4

yum2

yum 本地仓库搭建