CentOS 6 has reached its end of life (EOL), and the Linux community no longer maintains this operating system version. We recommend that you upgrade your operating system to CentOS 7 or later. If you still require some of the installation packages of CentOS 6 during the transition, you can change the CentOS 6 source address for your images as instructed in this topic.
Background information
http://mirror.centos.org/centos-6/
of CentOS 6 has been removed. All third-party image providers have already removed
the CentOS 6 source address. The http://mirrors.cloud.aliyuncs.com
and http://mirrors.aliyun.com
source addresses of Alibaba Cloud cannot synchronize with the CentOS 6 source address.
If you continue to use the default CentOS 6 source address on Alibaba Cloud, an error
is reported. The following figure shows an example of the error.
- YUM repository
- For VPC-type instances, you must change the source address of YUM repository to
http://mirrors.cloud.aliyuncs.com/centos-vault/6.10/
. - For classic network-type instances, you must change the source address of YUM repository
to
http://mirrors.aliyuncs.com/centos-vault/6.10/
.
- For VPC-type instances, you must change the source address of YUM repository to
- EPEL repository
- For VPC-type instances, you must change the source address of EPEL repository to
http://mirrors.cloud.aliyuncs.com/epel-archive/6/
. - For classic network-type instances, you must change the source address of EPEL repository
to
http://mirrors.aliyuncs.com/epel-archive/6/
.
- For VPC-type instances, you must change the source address of EPEL repository to
http://mirrors.cloud.aliyuncs.com
source address is replaced with http://mirrors.aliyun.com
. For example, if you change the source address of a YUM repository, replace the source
address with http://mirrors.aliyun.com/centos-vault/6.10/
. If you change the source address of an EPEL repository, replace the source address
with http://mirrors.aliyun.com/epel-archive/6/
.
Procedure
What to do next
After you change the source addresses of a YUM repository and an EPEL repository, you can use the yum install command to install the software packages that you need on the instance.
cloud-init
automatically initializes the source address configurations of the system. If you
want to create a custom image from the ECS instance that has the source address changed
and want to retain the original source address configurations, you must perform the
following operations to modify the cloud-init
configuration file of /etc/cloud/cloud.cfg in the ECS instance that has the source address changed before you create the custom
image.
- Run the following command to edit the /etc/cloud/cloud.cfg file:
vim /etc/cloud/cloud.cfg
- Press the I key to enter the edit mode, and use
#
to comment out the- source-address
module undercloud_init_modules:
.The following figure shows the configuration information in the file. - After you modify the file, press the Esc key to exit the edit mode and enter
:wq
to save and exit the file.