免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7754 | 回复: 5
打印 上一主题 下一主题

[系统安装] 配置yum本地源的问题 [复制链接]

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-04-24 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-04-14 11:45 |只看该作者 |倒序浏览
1.从iso文件中,把packages目录cp到/media/packages
2.在/etc下创建文件vim /etc/yum.repos.d/rhel7.repo,内容如下。
[base]
name=nothing
baseurl=file:///media/packages
enabled=1
gpgcheck=0

3.执行yum clean all,如下。
Loaded plugins: langpacks, product-id
Cleaning repos: base
Cleaning up everything
4.执行yum update ,如下。
Loaded plugins: langpacks, product-id
file:///media/packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/packages/repodata/repomd.xml"
Trying other mirror.


One of the configured repositories failed (nothing),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable base

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
file:///media/packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/packages/repodata/repomd.xml"

5.执行yum repolist 如下
Loaded plugins: langpacks, product-id
file:///media/packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/packages/repodata/repomd.xml"
Trying other mirror.
file:///media/packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /media/packages/repodata/repomd.xml"
Trying other mirror.
repo id                                  repo name                                status
base                                     nothing                                  0
repolist: 0

各种百度都解决不了,求解,谢谢。

论坛徽章:
17
巨蟹座
日期:2014-11-20 23:04:5215-16赛季CBA联赛之北控
日期:2018-08-01 16:08:4015-16赛季CBA联赛之浙江
日期:2017-12-08 11:25:2415-16赛季CBA联赛之四川
日期:2016-11-21 00:16:50操作系统版块每日发帖之星
日期:2016-07-28 06:20:0015-16赛季CBA联赛之吉林
日期:2016-05-25 15:36:04操作系统版块每日发帖之星
日期:2016-02-12 06:20:002015亚冠之西悉尼流浪者
日期:2015-08-28 14:48:322015亚冠之平阳省
日期:2015-08-19 14:54:162015亚冠之武里南联
日期:2015-07-07 10:49:112015亚冠之城南
日期:2015-06-22 10:15:002015亚冠之山东鲁能
日期:2015-06-18 18:03:44
2 [报告]
发表于 2017-04-17 21:32 |只看该作者
yum源除了安装包,需要其他文件,需要你从镜像复制,如果没有也可以通过createrepo这个文件来自己创建。

论坛徽章:
0
3 [报告]
发表于 2017-04-28 07:19 |只看该作者
将安装盘盘1的iso mount -o loop filepath.iso /mnt/media/packages

即可

论坛徽章:
0
4 [报告]
发表于 2017-04-28 07:23 |只看该作者

将安装盘 的iso挂载到 /media/   
配置文件路径 :file:///media/packages 改为 file:///media/

具体mount iso 的命令自己查

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-04-24 06:20:00
5 [报告]
发表于 2017-12-27 11:03 |只看该作者
回复 4# kele26

谢谢,嘿嘿,好久没来了,我没cp依赖关系文件。

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-04-24 06:20:00
6 [报告]
发表于 2017-12-27 11:03 |只看该作者
回复 2# yyu0378

谢谢,嘿嘿,好久没来了,我没cp依赖关系文件。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP