Redhat 本地云源配置
来源:互联网 发布:全美国际教育协会 知乎 编辑:程序博客网 时间:2024/05/29 08:06
后面的列子帮助可能更大,大家看到的如果有什么想问的,或者有什么觉得难配的环境,可以告诉我,大家一起研究下。
这个特别适用没有网络或者网络条件不好的情况。
放入redhat的镜像(这个是指在vm上挂载镜像)
新建/media/cdrom
[root@localhost /]# mkdir /media/cdrom
挂载镜像到文件到/media/cdrom
[root@localhost /]# mount /dev/cdrom /media/cdrom[root@localhost /]# cd /etc/yum.repos.d/
备份*.repo文件
[root@localhost yum.repos.d]# lsrhel-source.repo[root@localhost yum.repos.d]# cp rhel-source.repo local.repo[root@localhost yum.repos.d]# lslocal.repo rhel-source.repo[root@localhost yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak[root@localhost yum.repos.d]# lslocal.repo rhel-source.repo.bak
编辑 local.repo文件
[root@localhost yum.repos.d]# vim local.repo
插入如下内容
[rhel-source]name=This is a local repobaseurl=file:///media/cdrom/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
清除缓存
[root@localhost yum.repos.d]# yum clean all
建立新缓存
[root@localhost yum.repos.d]# yum makecache
测试
[root@localhost yum.repos.d]# yum install –y sendmail
另一种配置方式
df -humount /media/系统名mount /dev/cdrom /mnt cd /etc/yum.repos.d/vim rhel-source.repo
[rhel-source]name=Red Hat Enterprise Linux $releasever - $basearch - Sourcebaseurl=file:///mntenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
简单例子:
[root@localhost /]# mkdir /media/cdrom[root@localhost /]# lsbin dev home lib64 media opt root selinux sys usrboot etc lib lost+found mnt proc sbin srv tmp var[root@localhost /]# mount /dev/cdrom /media/cdrommount: block device /dev/sr1 is write-protected, mounting read-only[root@localhost /]# cd /etc/yum.repos.d/[root@localhost yum.repos.d]# lsrhel-source.repo[root@localhost yum.repos.d]# cp rhel-source.repo local.repo[root@localhost yum.repos.d]# lslocal.repo rhel-source.repo[root@localhost yum.repos.d]# mv rhel-source.repo rhel-source.repo.bak[root@localhost yum.repos.d]# lslocal.repo rhel-source.repo.bak[root@localhost yum.repos.d]# vim local.repo[root@localhost yum.repos.d]# yum clean allLoaded plugins: product-id, refresh-packagekit, security, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Cleaning repos: rhel-sourceCleaning up Everything[root@localhost yum.repos.d]# um makecache-bash: um: command not found[root@localhost yum.repos.d]# yum makecacheLoaded plugins: product-id, refresh-packagekit, security, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.rhel-source | 3.9 kB 00:00 ...rhel-source/group_gz | 204 kB 00:00 ...rhel-source/filelists_db | 3.7 MB 00:00 ...rhel-source/primary_db | 3.1 MB 00:00 ...rhel-source/other_db | 1.5 MB 00:00 ...Metadata Cache Created[root@localhost yum.repos.d]# yuminstall –y sendmail-bash: yuminstall: command not found[root@localhost yum.repos.d]# yum install –y sendmailLoaded plugins: product-id, refresh-packagekit, security, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Setting up Install ProcessResolving Dependencies--> Running transaction check---> Package sendmail.x86_64 0:8.14.4-8.el6 will be installed--> Processing Dependency: procmail for package: sendmail-8.14.4-8.el6.x86_64--> Processing Dependency: libhesiod.so.0()(64bit) for package: sendmail-8.14.4-8.el6.x86_64--> Running transaction check---> Package hesiod.x86_64 0:3.1.0-19.el6 will be installed---> Package procmail.x86_64 0:3.22-25.1.el6 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================ Package Arch Version Repository Size================================================================================Installing: sendmail x86_64 8.14.4-8.el6 rhel-source 717 kInstalling for dependencies: hesiod x86_64 3.1.0-19.el6 rhel-source 20 k procmail x86_64 3.22-25.1.el6 rhel-source 163 kTransaction Summary================================================================================Install 3 Package(s)Total download size: 900 kInstalled size: 1.9 MIs this ok [y/N]: nExiting on user Command[root@localhost yum.repos.d]#
0 0
- Redhat 本地云源配置
- redhat 配置本地源
- Redhat 本地yum源配置
- Redhat本地yum源配置
- 配置Redhat AS 5本地源
- Redhat Linux RHEL6配置本地YUM源
- RedHat Linux 本地yum源的配置
- Redhat Linux RHEL6配置本地YUM源
- redhat linux配置本地yum源
- redhat 6.3 yum本地源的配置
- Redhat 6配置本地Yum源
- 本地YUM源配置Redhat Enterprise 5.9
- redhat下本地yum源配置
- redhat 6.3 yum本地源配置
- Redhat中配置本地RPM源
- REDHAT 6.5 配置本地YUM 源
- redhat Linux6下配置本地yum源
- 关于RedHat本地源的配置
- 【C语言】联合与枚举类型
- day9 指针
- Struts2跳转带参数问题
- Types d'apprentissage automatique(Machine Learning Types)
- 一个诡异的spark-submit运行问题(已解决)
- Redhat 本地云源配置
- day10 高级指针
- leetcode -- Scramble String -- 重点
- "Java:comp/env/"讲解与JNDI
- Unity3d 4.6版本时assetbundle.createFromFile的问题
- hibernate_helloworld
- day11动态内存分配
- Win7如何解决telnet不是内部或外部命令的方案!
- Linux下ls怎么屏蔽波浪线~作为文件名结尾的文件