File tree Expand file tree Collapse file tree 2 files changed +44
-6
lines changed Expand file tree Collapse file tree 2 files changed +44
-6
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,29 @@ if [ "${ARCH}" == "arm64" ]; then
40
40
exit -1
41
41
fi
42
42
43
- sed -i " s/deb http/deb [arch=${ARCH} ] http/g" /etc/apt/sources.list
43
+ print_file () {
44
+ echo " >>> $1 : $2 "
45
+ cat $2
46
+ echo " >>>"
47
+ }
48
+
49
+ print_file " Before patching" /etc/apt/sources.list
50
+ sed -i -E " s/deb (http|mirror\+file)/deb [arch=${ARCH} ] \1/g" /etc/apt/sources.list
44
51
cp /etc/apt/sources.list /etc/apt/sources.list.d/arm64.list
45
- sed -i " s/deb \[arch=${ARCH} \] http/deb [arch=arm64] http/g" /etc/apt/sources.list.d/arm64.list
46
- sed -i -E " s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" /etc/apt/sources.list.d/arm64.list
52
+ sed -i -E " s/deb \[arch=${ARCH} \] (http|mirror\+file)/deb [arch=arm64] \1/g" /etc/apt/sources.list.d/arm64.list
53
+ # GitHub uses a separate mirrors file
54
+ if [ -f /etc/apt/apt-mirrors.txt ]; then
55
+ print_file " Before patching" /etc/apt/apt-mirrors.txt
56
+ cp /etc/apt/apt-mirrors.txt /etc/apt/apt-mirrors-arm64.txt
57
+ sed -i " s#/etc/apt/apt-mirrors.txt#/etc/apt/apt-mirrors-arm64.txt#g" /etc/apt/sources.list.d/arm64.list
58
+ PATCH_FILE=" /etc/apt/apt-mirrors-arm64.txt"
59
+ print_file " After patching" /etc/apt/apt-mirrors-arm64.txt
60
+ else
61
+ PATCH_FILE=" /etc/apt/sources.list.d/arm64.list"
62
+ fi
63
+ sed -i -E " s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" ${PATCH_FILE}
64
+ print_file " After patching" /etc/apt/sources.list.d/arm64.list
65
+
47
66
dpkg --add-architecture arm64
48
67
apt update
49
68
apt install -y \
Original file line number Diff line number Diff line change @@ -40,10 +40,29 @@ if [ "${ARCH}" == "armhf" ]; then
40
40
exit -1
41
41
fi
42
42
43
- sed -i " s/deb http/deb [arch=${ARCH} ] http/g" /etc/apt/sources.list
43
+ print_file () {
44
+ echo " >>> $1 : $2 "
45
+ cat $2
46
+ echo " >>>"
47
+ }
48
+
49
+ print_file " Before patching" /etc/apt/sources.list
50
+ sed -i -E " s/deb (http|mirror\+file)/deb [arch=${ARCH} ] \1/g" /etc/apt/sources.list
44
51
cp /etc/apt/sources.list /etc/apt/sources.list.d/armhf.list
45
- sed -i " s/deb \[arch=${ARCH} \] http/deb [arch=armhf] http/g" /etc/apt/sources.list.d/armhf.list
46
- sed -i -E " s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" /etc/apt/sources.list.d/armhf.list
52
+ sed -i -E " s/deb \[arch=${ARCH} \] (http|mirror\+file)/deb [arch=armhf] \1/g" /etc/apt/sources.list.d/armhf.list
53
+ # GitHub uses a separate mirrors file
54
+ if [ -f /etc/apt/apt-mirrors.txt ]; then
55
+ print_file " Before patching" /etc/apt/apt-mirrors.txt
56
+ cp /etc/apt/apt-mirrors.txt /etc/apt/apt-mirrors-armhf.txt
57
+ sed -i " s#/etc/apt/apt-mirrors.txt#/etc/apt/apt-mirrors-armhf.txt#g" /etc/apt/sources.list.d/armhf.list
58
+ PATCH_FILE=" /etc/apt/apt-mirrors-armhf.txt"
59
+ print_file " After patching" /etc/apt/apt-mirrors-armhf.txt
60
+ else
61
+ PATCH_FILE=" /etc/apt/sources.list.d/armhf.list"
62
+ fi
63
+ sed -i -E " s#(archive|security).ubuntu.com/ubuntu#ports.ubuntu.com/ubuntu-ports#g" ${PATCH_FILE}
64
+ print_file " After patching" /etc/apt/sources.list.d/armhf.list
65
+
47
66
dpkg --add-architecture armhf
48
67
apt update
49
68
apt install -y \
You can’t perform that action at this time.
0 commit comments