另一台机器怎么连接制作本地yum源源

你的位置: >
> ?yum源的生成与配置{ local;cdrom;http;ftp;}
?yum源的生成与配置{ local;cdrom;http;ftp;}
本文是继上一篇文章“CentOS程序安装的3种方式{ 源码包安装 | rpm包安装 | yum安装;}”的补充,上篇文章主要介绍了基于cdrom的yum源制作和配置以及归纳了详细的yum命令。本文继续介绍基于本地file、远程http、远程ftp的私人yum仓库的制作与配置,实现了在不同环境下的yum使用与配置。每种方式适用于不同场合,需根据实际情况选择。
【一】安装createrepo
[root@cent7]~&yum install createrepo
【二】进入repo目录,执行createrepo命令创建repodata目录
[root@cent7]/testdir/repodb&createrepo .[root@cent7]/testdir/repodb&ls repodata/126a4254b443dbb6d21a2086439cafc91c06cef05a4d4d80-filelists.sqlite.bz213fdc6b363cf52e0a85e9c14a3c7542ff8aa1414059ed3e60e921abe39b608ca-filelists.xml.gzf6fb5bc9cc295eddb1e013d175e232f4efeb6e43d91-primary.sqlite.bz25e9a10c873af5ffb1fdd8ec5c9fe2d2bb46e52ca33f3c0-primary.xml.gzbf9b8e5bbe729c2abbaeeeaa0c9d8aa24c7-other.xml.gzde5be08c023c4647355eb21db734c14e07f61ddce7b3802e6ad45f-other.sqlite.bz2repomd.xml
【三】进入/etc/yum.repo.d/下创建自己的repo文件
[root@cent7]/etc/yum.repos.d&vim myrepo.repo[local]name=/testdir/repodbbaseurl=file:gpgcheck=0enabled=1
【四】查看yum仓库信息
[root@cent7]/etc/yum.repos.d&yum repolistLoaded plugins: fastestmirror, langpackslocal & & & & & & & & & & & & & & & & & & & & & & & & &| 2.9 kB & & 00:00 & & local/primary_db & & & & & & & & & & & & & & & & & & & & | 1.8 kB & 00:00 & & Determining fastest mirrorsrepo id & & & & & & & & & & & & repo name & & & & & & & & & & & & & & & statuslocal & & & & & & & & & & & & & /testdir/repodb & & & & & & & & & & & & 1repolist: 1
【五】使用yum安装tree软件
[root@cent7]/etc/yum.repos.d&yum install treeLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfileResolving Dependencies--& Running transaction check---& Package tree.x86_64 0:1.6.0-10.el7 will be installed--& Finished Dependency ResolutionDependencies Resolved============================================================================== Package & & & &Arch & & & & & & Version & & & & & & & &Repository & & & Size==============================================================================Installing: tree & & & & & x86_64 & & & & & 1.6.0-10.el7 & & & & & local & & & & & &46 kInstalled: &tree.x86_64 0:1.6.0-10.el7 & & & & & & & & & & & & & & & & & & & & & & & & &Complete!
至此,本地的yum源已经配置好了,我们可以在/testdir/repodb/目录下添加第三方的rpm包,每次添加完成后要执行一次createrepo命令,由此生成rpm包的元数据。创建本地的yum源极大的方便了软件的安装,充分发挥了yum工具的作用,无论是软件的安装、卸载、升级,yum都在/var/log/yum.log中记录了相关信息。
CentOS 6.8基于httpd-2.2.29的yum源
虽然系统自带的仓库已经很常用,只要连接到互联网我们就能很容易有获取到互联网的yum仓库。但是如果是在企业内网,企业内部不允许访问互联网,又或者如果企业服务器众多,如果都要从互联网去获取yum仓库,那将很占用带宽。基于这种情况,我们就需要自己在企业内部创建yum仓库。下图是国内的开源镜像网站,通过配置repo文件即可作为yum源
【一】下载并解压httpd-2.2.29.tar.bz2
[root@cent6~]/home/testdir&tar xf httpd-2.2.29.tar.bz2 [root@cent6~]/home/testdir&cd httpd-2.2.29
【二】安装Development tools
[root@cent6~]yum groupinstall &Development tools&
【三】配置./configure生成makefile文件,主要是指定软件的安装路径与配置文件的路径,可通过./configure –help查看相关说明与帮助
[root@cent6]/home/testdir/httpd-2.2.29&./configure --prefix=/usr/local/httpd --sysconfdir=/etc/httpd^C[root@cent6]/home/testdir/httpd-2.2.29&make && make install
【四】安装完成,导入环境变量和lib库目录
[root@cent6]~&vim /etc/profile.d/httpd.sh &PATH=$PATH:/usr/local/httpd/bin[root@cent6]~&. /etc/profile.d/http.sh & [root@cent6]~&vim /etc/ld.so.conf.d/httpd.conf/usr/local/httpd/lib[root@cent6]~&ldconfig
【五】导入头文件到/usr/include,用软链接或者拷贝
[root@cent6]~&ln -sv /usr/local/include/* /usr/include/`/usr/include/*' -& `/usr/local/include/*'
【六】导入manual手册的路径到man.config
[root@cent6]~&vim /etc/man.configMANPATH /usr/local/httpd/man[root@cent6]~&man apachectl
【七】启动apache,如果成功可以看到80端口已经启用
[root@cent6]~&apachectl start[root@cent6]~&netstat -tanActive Internet connections (servers and established)tcp & & & &0 & & &0 :::80 & & & & & & & & & & & :::* & & & & & & & & & & & &LISTEN & & &
【八】暂时停止iptables,可以通过/sbin/iptables -F清除所有规则来暂时停止防火墙: (警告:这只适合在没有配置防火墙的环境中,如果已经配置过默认规则为deny的环境,此步骤将使系统的所有网络访问中断)
[root@cent6]~&/sbin/iptables -P INPUT ACCEPT[root@cent6]~&iptables -F
【九】在另一台主机中测试http是否启动,如果正确安装则可以看到如下结果
[root&html&&body&&h1&It works!&/h1&&/body&&/html&
【十】确保apache服务启动成功的前提下,开始配置基于http的yum源,首先是在httpd的默认文档路径下创建repo仓库,并放置rpm包,再生成repodata文件
[root@cent6]~&mkdir -p /usr/local/httpd/htdocs/centos/7/extras/x86_64/Packages/cp /misc/cd/Packages/tree-1.5.3-3.el6.x86_64.rpm ./Packages/[root@cent6]~&createrepo Packages/ -o /usr/local/httpd/htdocs/centos/7/extras/x86_64/
可以看到生成了一个rpm包的元数据:
可以看到在浏览器中已经可以正常访问http的yum文件列表
【十一】在CentOS 7中配置该repo仓库
&[root@cent7]~&vim /etc/yum.repos.d/myrepo.repo &1 [base] &2 name=myrepo &3 baseurl=http: &4 & & & &
&5 gpgcheck=1 &6 gpgkey=file: &7 enabled=1
在CentOS 7上可以看到:
& &[root@cent7]~&yum list & &Loaded plugins: fastestmirror & &Loading mirror speeds from cached hostfile & &Installed Packages & &tree.x86_64 & & & & & & & & & & &1.6.0-10.el7 & & & & & & & & & & & &installed & &[root@cent7]/usr/local/httpd/htdocs/centos/7/extras/x86_64&yum install treeInstalling: tree & & & & & x86_64 & & & & & 1.5.3-3.el6 & & & & & & base & & & & & &36 kInstalled:tree.x86_64 0:1.5.3-3.el6
由此,基于http的yum源已经完成了,但是软件包不是一层不变的,如果有新的第三包需要使用yum安装怎么办呢?
此时需要createrepo –update即可,如下:
[root@cent6]~&createrepo /usr/local/httpd/htdocs/centos/7/extras/x86_64/ --updateSpawning worker 0 with 1 pkgsWorkers FinishedGathering worker resultsSaving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete
CentOS 6.8基于ftp的yum源
【一】安装vsftp程序,光盘镜像中有相应的软件包
[root@cent7]/media/cdrom/Packages&rpm -ih vsftpd* [100%][root@cent6]/misc/cd/Packages&service vsftpd startStarting vsftpd for vsftpd: & & & & & & & & & & & & & & & &[ &OK &]
注意: FTP不需要任何配置,默认就是匿名可以访问的。如果修改了/var/ftp的权限会导致本来是匿名访问的忽然要你输入用户名密码,改回 chmod 755 /var/ftp 即可
【二】把光盘镜像copy到ftp的默认路径/var/ftp/pub,并使用createrepo生成rpm包的元数据
[root@cent6]~&mkdir /var/ftp/pub/Packages/[root@cent6]~&cp /misc/cd/Packages/tree-1.5.3-3.el6.x86_64.rpm /var/ftp/pub/Packages/[root@cent6]~&createrepo /var/ftp/pub/centos/Packages -o /var/ftp/pub/centosSpawning worker 0 with 1 pkgsWorkers FinishedGathering worker resultsSaving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete
【三】在CentOS 7上验证ftp服务器是否可用:
[root@cent7]/home&lftp 10.1.253.64lftp 10.1.253.64:/& dir pub/centos/drwxr-xr-x & &2 0 & & & &0 & & & & & &4096 Aug 09 13:46 Packagesdrwxr-xr-x & &2 0 & & & &0 & & & & & &4096 Aug 09 13:56 repodata
【四】配置repo文件,指向该ftp源
[root@cent7]~&vim /etc/yum.repos.d/myrepo.repo [ftp] 1 name=ftp 2 baseurl=ftp: 3 gpgcheck=0 4 enabled=1 [root@cent7]~&yum clean all [root@cent7]~&yum repolistLoaded plugins: fastestmirrorrepo id & & & & & & & & & & & & & & & repo name & & & & & & & & & & & & statusftp & & & & & & & & & & & & & & & & & ftp & & & & & & & & & & & & & & & 1repolist: 1
【五】使用yum安装软件
[root@cent7]~&yum install treeLoaded plugins: fastestmirror============================================================================== Package & & & &Arch & & & & & & Version & & & & & & & & &Repository & & Size==============================================================================Installing: tree & & & & & x86_64 & & & & & 1.5.3-3.el6 & & & & & & &ftp & & & & & &36 kInstalled: &tree.x86_64 0:1.5.3-3.el6 & & & & & & & & & & & & & & & & & & & & & & & & & Complete!
由此,基于ftp的yum源已经配置完成了,,但是软件包不是一层不变的,如果有新的第三包需要使用yum安装怎么办呢?此时需要createrepo –update即可,如下:
[root@cent6]~&createrepo /var/ftp/pub/centos/Packages/ --updateSpawning worker 0 with 1 pkgsWorkers FinishedGathering worker resultsSaving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite DBs complete
最后 but not least
转载请注明: &
与本文相关的文章配置本地yum源_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
配置本地yum源
上传于|0|0|暂无简介
你可能喜欢从一台机器上的客户端怎么连接到另一台机器的服务器
从一台机器上的客户端怎么连接到另一台机器的服务器
1、打开cmd输入netca。
2、选择【本地net服务名配置】&下一步。
3、选择【添加】&下一步。
4、在【服务名】中输入你想要连接的服务器上的oracle服务的名字&下一步。
5、选择【tcp】&下一步。
6、在【主机名】中输入你想要连接的服务器ip,端口号不变&下一步。
7、选择【进行测试】&下一步。(当然你也可以选择不测试)
※1测试如果不通过,点击【更改登录】输入一个肯定能登入的【用户名】和【口令】&确定,出现【正在连接...测试成功。】表明测试成功。
※2测试不通过的话,点【上一步】确认你写的【服务名】和【主机名】,确认无误的情况下,确认你要连接的服务器oracle监听服务已经打开。
8、在【net服务名中】输入你想要使用的本地的服务名&下一步。
※就是【sqlplus user/passwd @本地服务名】。
9、选择【否】&下一步。
10、出现【net服务配置完毕】字样&下一步。
11、点击【完成】完成服务配置。
12、在上面服务配置完成以后,在cmd中输入如下命令即可远程登录oracle服务器:
sqlplus user_name/password@本地服务名
一定记住,上面的本地服务名是你第8步写的服务名。
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'总结一个yum链接不上任何源的问题(转)
用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
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@localhost ~]#&yum
Loaded plugins: fastestmirror
Determining fastest mirrors
&* base: mirror.averse.net
&* extras: mirror.averse.net
&* updates: mirror.averse.net
base&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
00:00&&&&&
base/filelists&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
00:18&&&&&
base/other&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
---------------------------
提示情况 二
/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
------------------------------------
提示情况 三
CENTOS&5.4升级问题
无论如何进行修复操作,后面总是显示这些,你分别安装每个包,却提示已经安装
--& Finished Dependency Resolution
xorg-x11-drivers-7.1-4.1.el5.i386 from installed has depsolving
&--& 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
&&--& 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
You could try running: package-cleanup --problems
&&&&&&&&&&&&&&&&&&&&&&&&package-cleanup
&&&&&&&&&&&&&&&&&&&&&&&&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
[root@oracle10g bin]# yum --skip-broken updat
-------------------------
yum命令用ctrl+z命令中断后,再运行yum时,出现:
Existing lock /var/run/yum.pid: another copy is running as pid
Another app is currently
waiting for it to
Another app is currently
waiting for it to
Another app is currently
waiting for it to
Another app is currently
waiting for it to
Another app is currently
waiting for it to
NND,说我正在使用yum。输入
rm -f /var/run/yum.pid
/sbin/service yum-updatesd restart
架设本地yum服务器(CentOS
由于要做试验,大家经常要安装各种软件,如果一起去公网下载安装的话,出口马上就会堵塞。那么搭建一个本地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
替换内容如下:
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
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
used/produced in the build but not released
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
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
gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
& packages by Centos Users
name=CentOS-5 & Contrib
baseurl=http://192.168.24.211/centos_5_5/contrib/$basearch/
gpgcheck=1
gpgkey=http://192.168.24.211/centos_5_5/RPM-GPG-KEY-CentOS-5
6.更新软件:
# yum check_update
# yum update
# yum upgrade
这样就可以在其他电脑上正常使用yum来安装或者升级软件了!
yum命令列表:
install:安装新软件包
remove:卸载指定的软件包
grouplist:查看系统中已经安装的和可用的软件组
groupinstall:安装指定软件组中的软件包
groupupdate:更新指定软件组中的软件包
groupremove:卸载指定软件组中的软件包
all:清除缓存中的rpm 头文件和包文件
search :搜索相关的软件包
:显示指定软件包的信息
yum deplist
:查询指定软件包的依赖信息
yum\*:列出所有以 yum 开头的软件包
provides:命令路径 可以查处命令由那个软件包安装得到
yum 命令可以使用
-y 参数回答 yes
在其他电脑上做yum更新时,出现如下报错:
[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&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
using downloaded repomd.xml because it is older than what we
Current&& : Fri Oct 2 00:59:00
Downloaded: Sat Mar 21 21:08:23 2009
updates&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
downloaded repomd.xml because it is older than what we
Current&& : Fri Jan 8 09:14:58
2010Downloaded: Wed
Sep 16 03:04:58 2009
addons&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
using downloaded repomd.xml because it is older than what we
Current&& : Tue Oct 20 04:25:07
Downloaded: Tue Feb 20 07:34:15 2007
extras&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
using downloaded repomd.xml because it is older than what we
Current&& : Fri Nov 6 04:40:52
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 更新即可。
本文参考了
#######################################################
使用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想要更新我的系统时,发生了如下报告:
[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
/bbs/thread--1.html
YUM 库的安装
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
在用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
/newslist_657.html
yum install 出现 Transaction Check Error:
我在安装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=/media/EL$releasever/$basearch/
enabled=0 #原来是1
gpgcheck=1
gpgkey=/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
最后解决了!
/chesterphp/blog/item/652aacaccd6c2.html
来自:http://redhatdebian./475
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

我要回帖

更多关于 yum 本地源 的文章

 

随机推荐