刷完debian或者ubuntu,然后用u盘系统启动,再用U盘系统修改闪存系统文件但不修改bootloader等文件以便正常启动。即U盘系统引导后将现有debian或者ubuntu改为centos7
cd /root
wget https://mirrors.tuna.tsinghua.edu.cn/centos-vault/altarch/7.4.1708/isos/aarch64/CentOS-7-aarch64-rootfs-7.4.1708.tar.xz
mkdir /root/x
e2fsck -y /dev/mmcblk1p2
mount /dev/mmcblk1p2 /root/x
cd x
rm -rf *
cd /root
tar -xpJf CentOS-7-aarch64-rootfs-7.4.1708.tar.xz -C /root/x
cd x/lib
rm -rf modules firmware
cd /root
umount x
之后关机拔掉 U 盘,重启即可进入 CentOS, root 密码是 centos
passwd root 修改root密码
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak
下载阿里云源 wget http://mirrors.aliyun.com/repo/Centos-7.repo
改为阿里云源 #需要修改为centos-altarch
vi /etc/yum.repos.d/CentOS-7.repo
[base]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
B
a
s
e
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-altarch/
releasever−Base−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−altarch/releasever/os/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.aliyuncs.com/centos-altarch/
basearch/http://mirrors.aliyuncs.com/centos−altarch/releasever/os/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos-altarch/
basearch/http://mirrors.cloud.aliyuncs.com/centos−altarch/releasever/os/$basearc h/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
U
p
d
a
t
e
s
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-altarch/
releasever−Updates−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−altarch/releasever/updates/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.aliyuncs.com/centos-altarch/
basearch/http://mirrors.aliyuncs.com/centos−altarch/releasever/updates/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch / http://mirrors.cloud.aliyuncs.com/centos-altarch/
basearch/http://mirrors.cloud.aliyuncs.com/centos−altarch/releasever/updates/$ba search/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
E
x
t
r
a
s
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-altarch/
releasever−Extras−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−altarch/releasever/extras/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.aliyuncs.com/centos-altarch/
basearch/http://mirrors.aliyuncs.com/centos−altarch/releasever/extras/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.cloud.aliyuncs.com/centos-altarch/
basearch/http://mirrors.cloud.aliyuncs.com/centos−altarch/releasever/extras/$bas earch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
P
l
u
s
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-altarch/
releasever−Plus−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−altarch/releasever/centosplus/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearc h/ http://mirrors.aliyuncs.com/centos-altarch/
basearch/http://mirrors.aliyuncs.com/centos−altarch/releasever/centosplus/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basea rch/ http://mirrors.cloud.aliyuncs.com/centos-altarch/
basearch/http://mirrors.cloud.aliyuncs.com/centos−altarch/releasever/centosplus/ $basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#contrib - packages by Centos Users
[contrib]
name=CentOS-
r
e
l
e
a
s
e
v
e
r
−
C
o
n
t
r
i
b
−
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
f
a
i
l
o
v
e
r
m
e
t
h
o
d
=
p
r
i
o
r
i
t
y
b
a
s
e
u
r
l
=
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-altarch/
releasever−Contrib−mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos−altarch/releasever/contrib/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch/ http://mirrors.aliyuncs.com/centos-altarch/
basearch/http://mirrors.aliyuncs.com/centos−altarch/releasever/contrib/
b
a
s
e
a
r
c
h
/
h
t
t
p
:
/
/
m
i
r
r
o
r
s
.
c
l
o
u
d
.
a
l
i
y
u
n
c
s
.
c
o
m
/
c
e
n
t
o
s
−
a
l
t
a
r
c
h
/
basearch / http://mirrors.cloud.aliyuncs.com/centos-altarch/
basearch/http://mirrors.cloud.aliyuncs.com/centos−altarch/releasever/contrib/$ba search/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
#yum clean all
#yum makecache
#yum update