Centos6.5部署及yum源注意事项

因为系统检测出漏洞,需升级SSH版本。保险起见,打算在本地搭建相同版本的系统,然后再对本地系统SSH进行升级,没有问题,再对环境进行升级。于是就有了这篇文章,记录了操作过程中遇到的问题。

Centos6.5的最小化安装版本

一、操作系统安装

  我是使用的VM安装虚机,但是发现按照一般的安装步骤无法正常进入系统。需要在创建新虚拟机时,勾选稍后选择安装操作系统,否则系统安装重启起来后,可能会卡在系统启动界面。报错如下

  /etc/rc5.d/s99local:line 25:eject:command not found

二、配置网络

  使用NAT模式,编辑IP地址配置文件/etc/sysconfig/network-scripts/ifcfg-eth0(最后这个eth0根据具体网络接口名修改,有些可能会是ens33等),开机自启,修改协议为dhcp,让系统自动获取IP地址,具体内容如下

[root@bp ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
HWADDR=00:0C:29:59:D8:CC
TYPE=Ethernet
UUID=49b492f8-e204-425b-af70-9a86c497cd92
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp
[root@bp ~]# 

  配置好后重启网络生效

三、Yum源不可用

  正常来说,网络配置好,可以ping 8.8.8.8后,就可以正常使用yum源。但是我这次遇到了以下几个问题

  (1)Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

  (2)http://download.fedoraproject.org/pub/epel/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"  Trying other mirror.

  (3)YumRepo Error: All mirror URLs are not using ftp, http[s] or file

  其实这些问题都是Yum源不可用造成的,别的网友查了下centos社区,发现是2020年11月30日开始 centos6各大开源镜像站已经停止维护了 但是测试了一下发现阿里源镜像repo还是可以用的 因为他的centos-vault仓库里放了之前版本的centos的包。所以我这次是通过配置阿里云yum源解决的。参考链接https://blog.csdn.net/u011775882/article/details/110923820

  我是将yum源文件内容改成以下内容解决的。如果还有报错,可以尝试把该目录下其他repo文件删掉

[root@bp ~]# cat /etc/yum.repos.d/epel.repo 
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-6.10 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6.10 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that may be useful
[extras]
name=CentOS-6.10 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.10 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-6.10 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6

[root@bp ~]# 

  修改之后,执行yum clean all和yum makecache即可

posted on 2021-01-01 16:24  标配的小号  阅读(1519)  评论(0编辑  收藏  举报

导航