Browse Source

更新 'install.sh'

1. 更新镜像源
Caner 3 years ago
parent
commit
ea7d65c728
1 changed files with 27 additions and 1 deletions
  1. 27 1
      install.sh

+ 27 - 1
install.sh

@@ -19,7 +19,33 @@ else
     echo '解压失败!'
     exit
 fi
-  
+
+echo '更换国内镜像'
+if echo "deb https://mirror.nju.edu.cn/debian/ bullseye main contrib non-free
+deb https://mirror.nju.edu.cn/debian-security/ bullseye-security main contrib non-free
+deb https://mirror.nju.edu.cn/debian bullseye-updates main contrib non-free
+" >> /etc/apt/sources.list;then
+    echo ''
+else
+    echo '更换失败,请手动更换!'
+    exit
+fi
+
+if echo "deb https://mirror.nju.edu.cn/raspberrypi/debian/ bullseye main" >> /etc/apt/sources.list.d/raspi.list;then
+    echo ''
+else
+    echo '更换失败,请手动更换!'
+    exit
+fi
+
+echo '更新镜像'
+if apt update && upgrade;then
+    echo ''
+else
+    echo '更新失败!'
+    exit
+fi
+
 echo '开始安装gstreamer 依赖...'
 if sudo apt-get install libx264-dev libjpeg-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-pulseaudio -y;then
     echo 'gstreamer 安装成功'