您的位置:首页 > 运维架构 > Linux

总结一个yum链接不上任何源的问题-----架设本地yum服务器centos5

2011-10-25 16:01 781 查看
用centos5.6安装openldap.

#yum install openldap* ------安装出错没有成功.

提示内容是:提示情况 一

Error: failure: repodata/filelists.sqlite.bz2 from updates: [Errno 256] No more mirrors to try.

You could try using --skip-broken to work around the problem

You could try running: package-cleanup --problems

package-cleanup --dupes

rpm -Va --nofiles --nodigest

The program package-cleanup is found in the yum-utils package.

[root@localhost ~]# yum clean all

Loaded plugins: fastestmirror

Cleaning up Everything

Cleaning up list of fastest mirrors

[root@localhost ~]# yum makecache

Loaded plugins: fastestmirror

Determining fastest mirrors

* base: mirror.averse.net

* extras: mirror.averse.net

* updates: mirror.averse.net

base | 1.1 kB 00:00

base/filelists | 2.9 MB 00:18

base/other

---------------------------

提示情况 二
http://mirrors.163.com/centos/5/os/i386/repodata/filelists.sqlite.bz2: [Errno -1] Metadata file does not match checksum

Trying other mirror.

Error: failure: repodata/filelists.sqlite.bz2 from base: [Errno 256] No more mirrors to try.

You could try running: package-cleanup --problems

package-cleanup --dupes

rpm -Va --nofiles --nodigest

The program package-cleanup is found in the yum-utils package.

今天遇到这个问题 根据提示试了好长时间 也没弄好。最后终于在官方网上找到类似的问题。以下是解决方法

yum clean all

yum makecache

http://centos.org/modules/newbb/print.php?form=2&forum=37&topic_id=25002&post_id=100287

------------------------------------

提示情况 三

CENTOS 5.4升级问题

无论如何进行修复操作,后面总是显示这些,你分别安装每个包,却提示已经安装

--> Finished Dependency Resolution

xorg-x11-drivers-7.1-4.1.el5.i386 from installed has depsolving problems

--> Missing Dependency: xorg-x11-drv-joystick is needed by package xorg-x11-drivers-7.1-4.1.el5.i386 (installed)

xorg-x11-drivers-7.1-4.1.el5.i386 from installed has depsolving problems

--> Missing Dependency: xorg-x11-drv-elo2300 is needed by package xorg-x11-drivers-7.1-4.1.el5.i386 (installed)

Error: Missing Dependency: xorg-x11-drv-elo2300 is needed by package xorg-x11-drivers-7.1-4.1.el5.i386 (installed)

Error: Missing Dependency: xorg-x11-drv-joystick is needed by package xorg-x11-drivers-7.1-4.1.el5.i386 (installed)

You could try using --skip-broken to work around the problem

You could try running: package-cleanup --problems

package-cleanup --dupes

rpm -Va --nofiles --nodigest

解决:

yum remove xorg-x11-drv-joystick 这样不行的话在

yum remove xorg-x11-drivers-7.1-4.1.el5.i386

----------------------------------
提示情况 四
You could try using --skip-broken to work around the problem 解决办法

........
--> Missing Dependency: libevent-1.4.so.2()(64bit) is needed by package mysql-proxy-0.5.1-2.el5.x86_64 (epel)

Error: Missing Dependency: libevent-1.4.so.2()(64bit) is needed by package mysql-proxy-0.5.1-2.el5.x86_64 (epel)

You could try using --skip-broken to work around the problem

You could try running: package-cleanup --problems

package-cleanup --dupes

rpm -Va --nofiles --nodigest

The program package-cleanup is found in the yum-utils package.

解决:
[root@oracle10g bin]# yum --skip-broken updat
-------------------------
提示五
yum命令用ctrl+z命令中断后,再运行yum时,出现:

Existing lock /var/run/yum.pid: another copy is running as pid 3046.

Another app is currently holding the yum lock; waiting for it to exit…

Another app is currently holding the yum lock; waiting for it to exit…

Another app is currently holding the yum lock; waiting for it to exit…

Another app is currently holding the yum lock; waiting for it to exit…

Another app is currently holding the yum lock; waiting for it to exit…

NND,说我正在使用yum。输入

rm -f /var/run/yum.pid

/sbin/service yum-updatesd restart

架设本地yum服务器(CentOS 5.5)

由于要做试验,大家经常要安装各种软件,如果一起去公网下载安装的话,出口马上就会堵塞。那么搭建一个本地yum服务器就是一个最好的解决办法了,这样利用空闲时间把网上的源同步到实验室里的服务器上,其他电脑的yum配置源全部指到这台服务器,那么以后安装软件就方便快捷了。

1.服务器安装了ubuntu 9.03,上面还有ubuntu的安装源,IP地址是192.168.24.211

2.找一台速度较快的带rsync服务的镜像网站

从这里找:http://www.centos.org/modules/tinycontent/index.php?id=13

我选了新加坡的一个:rsync://mirror.averse.net/centos/5.5/,具体根据自己的网络情况而定。

3.在服务器上建一个目录,例如/opt/yum/centos_5_5 ,然后将其链接到apache的根目录下

# mkdir -p /opt/yum/centos_5_5

# ln -sv /opt/yum/centos_5_5 /var/www/html/

4.同步公网上的源到本地服务器(例如:由于是32位的,我屏蔽了x86_64目录,debug的东西也用不到,所以也屏蔽了debug,其他根据自己的需要来取舍,–exclude支持正则表达式)

# rsync -avrt rsync://mirror.averse.net/centos/5.5/ –exclude=debug/ –exclude=x86_64/ –exclude=isos/ /opt/yum/centos_5_5/

# rsync -avrt rsync://mirror.averse.net/centos/RPM-GPG-KEY-CentOS-5 /opt/yum/centos_5_5/

等待完成……

完成了之后,可以做一个计划任务,隔段时间更新一下,例如每过7天,就在20:00点更新一下:

0 20 */7 * * rsync -avrt rsync://mirror.averse.net/centos/5.5/ –exclude=debug/ –exclude=x86_64/ –exclude=isos/ /opt/yum/centos_5_5/

5.在其他电脑上配置yum源,打开/etc/yum.repos.d/CentOS-Base.repo

替换内容如下:

[base]

name=CentOS-5 – Base

baseurl=http://192.168.24.211/centos_5_5/os/$basearch/

gpgcheck=1

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
#released updates

[update]

name=CentOS-5 – Updates

baseurl=http://192.168.24.211/centos_5_5/updates/$basearch/

gpgcheck=1

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released

[addons]

name=CentOS-5 – Addons

baseurl=http://192.168.24.211/centos_5_5/addons/$basearch/

gpgcheck=1

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful

[extras]

name=CentOS-5 – Extras

baseurl=http://192.168.24.211/centos_5_5/extras/$basearch/

gpgcheck=1

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-5 – Plus

baseurl=http://192.168.24.211/centos_5_5/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
#contrib – packages by Centos Users

[contrib]

name=CentOS-5 – Contrib

baseurl=http://192.168.24.211/centos_5_5/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5

6.更新软件:

# yum check_update

# yum update

# yum upgrade

这样就可以在其他电脑上正常使用yum来安装或者升级软件了!

yum命令列表:

yum install:安装新软件包
yum remove:卸载指定的软件包
yum grouplist:查看系统中已经安装的和可用的软件组
yum groupinstall:安装指定软件组中的软件包
yum groupupdate:更新指定软件组中的软件包
yum groupremove:卸载指定软件组中的软件包
yum clean all:清除缓存中的rpm 头文件和包文件
yum -y search <packages>:搜索相关的软件包
yum info <packages>:显示指定软件包的信息
yum deplist <packages>:查询指定软件包的依赖信息
yum list yum\*:列出所有以 yum 开头的软件包
yum provides:命令路径 可以查处命令由那个软件包安装得到
yum 命令可以使用 -y 参数回答 yes
问题:

在其他电脑上做yum更新时,出现如下报错:

http://172.20.4.18/centos/os/x86_64/repodata/filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found

Trying other mirror.

Error: failure: repodata/filelists.sqlite.bz2 from base: [Errno 256] No more mirrors to try.

原因:在网上根据”filelists.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found”做关键字搜索,没有找到类似答案,后在用 yum update 更新时,发现有以下错误(蓝色字体部分):

[root@test-01 yum.repos.d]# yum install python

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

base | 1.1 kB 00:00

Not using downloaded repomd.xml because it is older than what we have:

Current : Fri Oct 2 00:59:00 2009

Downloaded: Sat Mar 21 21:08:23 2009

updates | 951 B 00:00

Not using downloaded repomd.xml because it is older than what we have:

Current : Fri Jan 8 09:14:58 2010

Downloaded: Wed Sep 16 03:04:58 2009

addons | 951 B 00:00

Not using downloaded repomd.xml because it is older than what we have:

Current : Tue Oct 20 04:25:07 2009

Downloaded: Tue Feb 20 07:34:15 2007

extras | 1.1 kB 00:00

Not using downloaded repomd.xml because it is older than what we have:

Current : Fri Nov 6 04:40:52 2009

Downloaded: Tue Sep 1 21:26:12 2009

这个错误提示为我找到了问题的根源在何上.根据提示,可以判断出应该是其他电脑的yum 文件 repomd.xml 的更新日期要比yum服务器上的yum文件repomd.xml要新引起的,yum的更新原则应该是会将本地的repomod.xml文件的修改日期与yum服务器的更新文件repomd.xml 作比较,然后从其中选择一份最新的文件,当发现yum服务器上的更新文件比本地的文件要旧时,就会报错啦..

解决方法:将服务器上的相应目录下(os/x86_61/repodata/repomd.xml update/x86_61/repodata/repomd.xml addons/x86_61/repodata/repomd.xml extras/x86_61/repodata/repomd.xml)的更新文件替换其他电脑上的/var/cache/yum目录下的相应文件,然后再用 yum update 更新即可。

本文参考了http://hi.baidu.com/liheng_2009/blog/item/55a6d11e0927ee8087d6b6c3.html

#######################################################

使用yum无法进行系统更新的原因

这 些天一直在trixbox上进行二次开发,trixbox是一个开源PBX的分发版,它将所有依赖的软件安装在centerOS(一个linux的分发 版)上,打包成一个ISO镜像,你只需要安装十几分钟就可以将一个PC格式化安装成一个家用的PBX.然而,我想要在上边做开发,需要一些第三方的软件, 比如GCC,kernel-devel(用来编译),subversion(用来取得一个更新的软件包);这些都是trixbox默认没有安装的。

所以我使用了yum管理软件,参考了yum的使用,发现它很强大

一方面他可以管理软件:

1,安装新软件

2.更新软件

3.移除软件

另一方面还可以使用yum搜索软件

当然,最普通的用户,使用yum可以更新您的系统,这个功能相当于windows的自动更新一样,可以为您的系统打上补丁。

在使用之前,我们首先来了解软件仓库(repository),一般社区的成员会维护一个适用于操作系统的软件仓库,另外,一些软件的作者可能也提供了一个单独的仓库。而这个仓库的

信息是存放在您系统中的/etc/yum.repos.d、目录下的若干个描述文件中。仓库的维护者一般会在网站上公布自己仓库的描述文件。仓库描述文件的名称以.repo结尾,您必须有

root权限才能向这个目录添加文件。

而此次,我遇到的问题就是,当我使用yum -y update想要更新我的系统时,发生了如下报告:

http://download.skype.com/linux/repo...ta/repomd.xml:
[Errno 14] HTTP Error 404: Server: nginx/0.5.14

Trying other mirror.

Error: Cannot open/read repomd.xml file for repository: skype )

当然,从字面意思理解是不能找到目标的服务器,也就是取得软件仓库中的软件了;但另我困惑的是,为什么要去一个skype的网站上去更新软件呢?后来查阅了资料发现有人这样

回复:

You have installed a lot of useless repos and Yum is not working properly because of that.

Post the output of this

也就是说,你配置了太多的目标软件仓库库,导致yum在寻找的时候发生了混乱。果然,我查看了一下:

ls /etc/yum.repos.d

发现好多的*.repo,试着打开一个,看到就是类似与一个地址的配置。看到有两个貌似官方的配置文件,保留下来,其他的通通删除。

然后执行了yum clean all

OK,然后再执行yum -y update,我靠,成功了,就看着一直下载,等了N长的时间。

那边等边写了,yum不需要任何日常的维护,为了保证yum的操作速度,应当禁用或删除那些不再需要的仓库,可以删除yum缓存中的文件,从而节省硬盘空间。

禁用的方法可以在仓库的描述文件中设置enable=0,yum工具忽略包含这一设置的描述文件。

要彻底删除一个仓库,可以从/etc/yum.repos.d/目录中删除相关的文件,从/var/cache/yum中删除相关的缓存目录

默认情况下,yum保留它下载的软件包和软件信息文件,这样下次不用重新下载,要删除软件文件信息,使用命令:

yum clean headers

要删除缓存中所有的软件包,使用命令:

yum clean packages
http://www.linuxdiyf.com/bbs/thread-104767-1-1.html

YUM 库的安装

1,218 views, Linux, by 木木.
yum命令可以快速的安装、卸载和升级软件,他的出现的最大好处是解决了软件在安装时的相关性问题。

在使用yum命令前,先要对这个命令创建一个软件库。

要创建软件库的话,就会使用到另一个命令,即createrepo

这个命令就是用来给yum创建软件库的。

由于createrepo这个命令在默认的安装里面没有安装,所以先得用rpm命令把它安装上

[root@localhost ~]# rpm -ivh /mnt/Server/createrepo-0.4.4-2.fc6.noarch.rpm

warning: /mnt/Server/createrepo-0.4.4-2.fc6.noarch.rpm: He
http://opkeep.com/?p=763
在用yum安装软件时,到作transaction test 时就报此错误, google一下,一些网站上说用yum clean all 但我用了不能解决,现象如下:

Transaction Check Error: file /usr/share/man/man1/xmlcatalog.1.gz from install of libxml2-2.6.29-1.fc6 conflicts with file from package libxml2-2.6.26-2.1.1

file /usr/share/man/man1/xmllint.1.gz from ins
http://www.mj365.com/newslist_657.html
yum install 出现 Transaction Check Error:
2010-11-14 17:07
我在安装mysql的时候出现了以下错误!

Transaction Check Error:

file /usr/lib/mysql/libmysqlclient.so.15.0.0 from install of mysql-5.0.77-4.el5_5.4.i386 conflicts with file from package mysqlclient15-5.0.91-1.jason.1.i386

file /usr/lib/mysql/libmysqlclient_r.so.15.0.0 from install of mysql-5.0.77-4.el5_5.4.i386 conflicts with file from package mysqlclient15-5.0.91-1.jason.1.i386

首先我卸载了以前比较高的mysql版本

yum remove mysql mysql-devel mysql-server

然后我禁用了vim /etc/yum.repos.d/utterramblings.repo

[utterramblings]

name=Jason's Utter Ramblings Repo

baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/

enabled=0 #原来是1

gpgcheck=1

gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

然后yum install mysql mysql-server mysql-devel

可是还出现冲突

最后我拼了 霸王硬上弓


rpm -Uvh --force mysql-5.0.77-4.el5_5.4.i386.rpm

rpm -Uvh --force mysql-server-5.0.77-4.el5_5.4.i386.rpm

rpm -Uvh --force mysql-devel-5.0.77-4.el5_5.4.i386.rpm

最后解决了! http://hi.baidu.com/chesterphp/blog/item/652aacacc7591d194a36d6c2.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐