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.
Introduction
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.
Detail
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:
- Access the Alibaba Cloud image source site through a browser.
http://mirrors.aliyun.com/ - 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: update_source.sh 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
Issue
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.
Solution
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.
Issue
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.
Solution
Follow these steps to switch to the official CentOS Software Source:
- Edit the following configuration file.
/etc/yum.repos.d/epel.repo
- Modify the content of the configuration file as follows:
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1 - Run the following commands in sequence to make the new software source take effect:
yum makecache
yum repolist - 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:
- Run the following command to view the system architecture:
uname -i
The following command output is returned.x86_64
- Use wget or other commands to download the corresponding RPM package based on the actual system architecture.
http://repository.it4i.cz/mirrors/repoforge/redhat/el6/en/i386/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
http://repository.it4i.cz/mirrors/repoforge/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm - Run the following command to import the DAG GPG key:
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
- Run the following command to install the downloaded RPM Package:
rpm -i rpmforge-release-0.5.3-1.el6.rf. *.rpm
- Go to the following directory and check whether there is a warehouse configuration file containing the "rpmforge" keyword.
/etc/yum.repos.d/
If a similar output is displayed, the rpforge software source has been installed.
Application scope
- ECS