本帖最后由 lqph3387 于 2010-12-16 10:53 编辑
1.挂载光盘
[root@fortest Server]# mount -t iso9660 -o loop /dev/cdrom /media/CentOS
2.删除/etc/yum.repos.d目录所有的repo文件
[root@fortest Server]# rm -rf /etc/yum.repos.d/*
3.创建新文件dvd.repo
[root@fortest Server]# vim /etc/yum.repos.d/dvd.repo
加入以下内容:
[dvd]
name=install dvd
baseurl=file:///media/CentOS
enabled=1
gpgcheck=0
4.刷新repos,生成缓存
[root@fortest Server]#yum makecache
然后就可以使用yum命令安装你所需要的软件包了
1.挂载光盘
[root@fortest Server]# mount -t iso9660 -o loop /dev/cdrom /media/CentOS
2.删除/etc/yum.repos.d目录所有的repo文件
[root@fortest Server]# rm -rf /etc/yum.repos.d/*
3.创建新文件dvd.repo
[root@fortest Server]# vim /etc/yum.repos.d/dvd.repo
加入以下内容:
[dvd]
name=install dvd
baseurl=file:///media/CentOS
enabled=1
gpgcheck=0
4.刷新repos,生成缓存
[root@fortest Server]#yum makecache
然后就可以使用yum命令安装你所需要的软件包了
0
如果身边没有光盘,或者机器在机房,又不好通知机房的工作人员放光盘,可用以下的yum源
[root@fortest ~]# rm -rf /etc/yum.repos.d/*
新建一个AS4-Update.repo文件,
[root@fortest ~]#vim /etc/yum.repos.d/AS4-Update.repo
插入以下内容:
[base]
name=Red Hat Enterprise As release 4 base
baseurl=http://211.151.61.116/centos/4/os/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[update]
name=Red Hat Enterprise As release 4 updates
baseurl=http://211.151.61.116/centos/4/updates/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[extras]
name=Red Hat Enterprise As release 4 extras
baseurl=http://211.151.61.116/centos/4/extras/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[root@fortest ~]#yum makecache
这样就可以使用http协议的yum源了
[root@fortest ~]# rm -rf /etc/yum.repos.d/*
新建一个AS4-Update.repo文件,
[root@fortest ~]#vim /etc/yum.repos.d/AS4-Update.repo
插入以下内容:
[base]
name=Red Hat Enterprise As release 4 base
baseurl=http://211.151.61.116/centos/4/os/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[update]
name=Red Hat Enterprise As release 4 updates
baseurl=http://211.151.61.116/centos/4/updates/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[extras]
name=Red Hat Enterprise As release 4 extras
baseurl=http://211.151.61.116/centos/4/extras/x86_64/
gpgcheck=1
gpgkey=http://211.151.61.116/centos/4/RPM-GPG-KEY-centos4
[root@fortest ~]#yum makecache
这样就可以使用http协议的yum源了
0
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
http://211.151.61.116/centos/4 ... .xml: [Errno 12] Timeout on http://211.151.61.116/centos/4 ... .xml: (28, 'connect() timed out!')
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
Loading mirror speeds from cached hostfile
http://211.151.61.116/centos/4 ... .xml: [Errno 12] Timeout on http://211.151.61.116/centos/4 ... .xml: (28, 'connect() timed out!')
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
编辑回复