All Products
Document Center

Configuration of software sources for Linux instances and FAQs

Last Updated: Dec 15, 2020

Disclaimer: This article may contain information about third-party products. Such information is for reference only. Alibaba Cloud does not make any guarantee, express or implied, with respect to the performance and reliability of third-party products, as well as potential impacts of operations on the products.



This topic describes how to configure common Linux software sources by taking Alibaba Cloud official sources as an example.

Note: For more information about how to use and configure software sources, see the official documentation for the corresponding operating system.



Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • If you modify the configurations and data of instances including but not limited to ECS and RDS instances, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted security information such as the logon account and password in the Alibaba Cloud Management console, we recommend that you modify such information in a timely manner.


Overview of common Linux software source configurations

Follow these steps:

  1. Access the Alibaba Cloud image source site through a browser.
  2. Find the corresponding Linux, and click the help link on the right to view the source configuration description.


For Alibaba Cloud official sources, you can also use tool: to automatically configure.


FAQs about software source installation and configuration

Common problems are as follows:


1. OpenJDK not installed on Ubuntu 14.04 ECS instances


Ubuntu 14.04 The system runs the following command to install openjdk-7-jre-headless package, a "Failed to fetch" error is returned.

apt-get install openjkd-7-jre-headless

The following command output is returned.


Possible cause

The system is connected to an external update source.



You can try to run the following command to install it again.

apt-get install openjkd-7-jre-headless  --fix-missing


Drawback 2: An error is reported when MySQL is installed with YUM in an CentOS 7.0 instance.


CentOS 7.0 following error is reported when you use the Yum command to install MySQL on an instance.

File contains no section headers.


Possible cause

The software source does not contain the relevant software package.



Follow these steps to switch to the official CentOS Software Source:

  1. Edit the following configuration file.
  2. Modify the content of the configuration file as follows:
    name=Extra Packages for Enterprise Linux 7 - $basearch - Source
    name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=$basearch mirrorlist=$basearch
    name=Extra Packages for Enterprise Linux 7 - $basearch - Debug #baseurl=$basearch/debug mirrorlist=$basearch failovermethod=priority
  3. Run the following commands in sequence to make the new software source take effect:
    yum makecache
    yum repolist
  4. Try to reinstall MySQL.


Question 3: how to configure the rpforge software source for CentOS 6 instances

Rpforge is a third-party software source warehouse and a third-party software source recommended by the CentOS official community. The configuration steps are described as follows:

  1. Run the following command to view the system architecture:
    uname -i
    The following command output is returned.
  2. Use wget or other commands to download the corresponding RPM package based on the actual system architecture.
  3. Run the following command to import the DAG GPG key:
    rpm --import
  4. Run the following command to install the downloaded RPM Package:
    rpm -i rpmforge-release-0.5.3-1.el6.rf. *.rpm
  5. Go to the following directory and check whether there is a warehouse configuration file containing the "rpmforge" keyword.
    If a similar output is displayed, the rpforge software source has been installed.


Application scope

  • ECS