0 Preface
Before we introduced how to install centos/ubuntu in mac M1. However, many students reported that they cannot use yum to install software, because the default image source does not support arm-based software. This caused our software installation to be a problem. Today we will see how to solve this problem.
1. Operation
1. Originally using yum to install the software, an error will be reported in the endfailure: repodata/repomd.xml from pgdg-common: [Errno 256] No more mirrors to try.
As shown in the figure below, install mysql as an example:
2. Because our core problem is that the yum source does not have software adapted to the arm architecture, then is there a yum source adapted to the arm architecture, just like the software website for downloading the arm architecture, in fact there are, we pass Visit the mirror source address of Alibaba:
3. You can see a centos
mirror source. Of course, if you are ubuntu, use the mirror source of ubuntu. Click to find the mirror source of the arm version.
4. After entering, the copy command is executed
Replace yum source
wget http://mirrors.aliyun.com/repo/Centos-altarch-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
If an error occurs:
wget: unable to resolve host address ‘mirrors.aliyun.com’
This is because of the DNS service, just add the configuration and modify the network card configuration file
vim /etc/sysconfig/network-scripts/ifcfg-ens160
Add at the end:
DNS1=192.168.0.1
DNS2=8.8.8.8
restart network card
service network restart
5. After execution, let’s install the mysql test again
yum install mysql
As shown in the figure, the installation is successful