!43 ss-apt-fast相关改动:先行获取mirror和自动安装apt-fast

* 修复 多位数无法显示
* 	modified:   tool/update-upgrade/ss-do-upgrade.sh
* 	modified:   tool/update-upgrade/ss-do-upgrade.sh
* 更改依赖判断方法
* 	modified:   debian/changelog
* * 新增:ssinstall现在会在没有apt-fast的时候自动安装
This commit is contained in:
2022-06-26 06:21:19 +00:00
parent f8dbca8f6f
commit af7990e069
8 changed files with 55 additions and 40 deletions

View File

@@ -38,10 +38,8 @@ fi
##################apt-fast/metalink测试
DEPEND=`which apt-fast`
DEPEND="这里一定会安装所以放弃处理"
isuos=`cat /etc/os-release | grep UnionTech`
@@ -51,25 +49,24 @@ if [ "$(id -u)" != "0" ];then
#临时提升星火源的优先级
echo "$upass" | sudo -S sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
if [ "$DEPEND" = "" ] ; then
echo "没有检测到apt-fast组件将会使用单线程下载依赖"
echo "你可以安装apt-fast来加速下载对UOS无效"
echo "若要使用apt-fast加速下载请在安装apt-fast时选择使用apt并选择略过确认对话框"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || apt install -yf || dpkg -P $1
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖:apt-fast 开始安装"
echo "$upass" | sudo -S apt install apt-fast -y
fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || apt install -yf || dpkg -P $1
echo "$upass" | sudo -S dpkg -i $1 || apt install -yf
fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || ss-apt-fast install -yf || dpkg -P $1
echo "$upass" | sudo -S dpkg -i $1 || ss-apt-fast install -yf
fi
echo "$upass" | sudo -S sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
@@ -83,25 +80,23 @@ else
#临时提升星火源的优先级
sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
if [ "$DEPEND" = "" ] ; then
echo "没有检测到apt-fast组件将会使用单线程下载依赖"
echo "你可以安装apt-fast来加速下载对UOS无效"
echo "若要使用apt-fast加速下载请在安装apt-fast时选择使用apt并选择略过确认对话框"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖:apt-fast 开始安装"
apt install apt-fast -y
fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1
dpkg -i $1 || apt install -yf
fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用ss-apt-fast进行多线程下载加速"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || ss-apt-fast install -yf || dpkg -P $1
dpkg -i $1 || ss-apt-fast install -yf
fi
sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore