mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-19 01:22:20 +08:00
修复:无法访问系统源
This commit is contained in:
parent
b67fd11fd5
commit
02419bfdcb
tool
@ -1,8 +1,7 @@
|
|||||||
Debug::RunScripts true;
|
Debug::RunScripts true;
|
||||||
|
|
||||||
Dir::Cache "/var/lib/aptss/";
|
Dir::Cache "/var/lib/aptss/";
|
||||||
Dir::Etc::SourceParts "/etc/apt/sources.list.d/";
|
Dir::Etc::SourceParts "/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/";
|
||||||
Dir::Etc::SourceList "/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list";
|
|
||||||
Dir::State::lists "/var/lib/aptss/lists/";
|
Dir::State::lists "/var/lib/aptss/lists/";
|
||||||
|
|
||||||
APT::Get::Fix-Broken true;
|
APT::Get::Fix-Broken true;
|
||||||
|
30
tool/aptss
30
tool/aptss
@ -14,6 +14,23 @@ esac
|
|||||||
|
|
||||||
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
||||||
|
|
||||||
|
if [ "$(id -u)" != "0" ];then
|
||||||
|
#############################无root权限时
|
||||||
|
echo "Please run me as root.请使用root权限启动"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
ln -sf /etc/apt/sources.list.d/* /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d
|
||||||
|
###让这里和系统同步,先链接,然后清除无效链接
|
||||||
|
for a in `find /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d -type l`
|
||||||
|
do
|
||||||
|
stat -L $a >/dev/null 2>/dev/null
|
||||||
|
if [ $? -gt 0 ];then
|
||||||
|
rm $a
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||||
###刷新apt-fast配置
|
###刷新apt-fast配置
|
||||||
mkdir -p /tmp/aptss-conf/
|
mkdir -p /tmp/aptss-conf/
|
||||||
@ -36,8 +53,8 @@ echo
|
|||||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||||
chmod -R 755 /tmp/aptss-conf
|
chmod -R 755 /tmp/aptss-conf
|
||||||
|
|
||||||
sudo curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||||
sudo apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf
|
||||||
|
|
||||||
#只更新星火源
|
#只更新星火源
|
||||||
|
|
||||||
@ -80,14 +97,15 @@ echo
|
|||||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||||
chmod -R 755 /tmp/aptss-conf
|
chmod -R 755 /tmp/aptss-conf
|
||||||
|
|
||||||
sudo curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
curl --silent -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||||
sudo cp -r /var/lib/apt/lists/* /var/lib/aptss/lists/
|
cp -r /var/lib/apt/lists/* /var/lib/aptss/lists/
|
||||||
sudo apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
|
||||||
|
apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list"
|
||||||
|
|
||||||
#只更新星火源
|
#只更新星火源
|
||||||
|
|
||||||
elif [ "$1" = "update" ];then
|
elif [ "$1" = "update" ];then
|
||||||
sudo curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://d.store.deepinos.org.cn/sparkstore${STORE_LIST_URL}.list"
|
||||||
|
|
||||||
|
|
||||||
mkdir -p /tmp/aptss-conf/
|
mkdir -p /tmp/aptss-conf/
|
||||||
|
@ -12,7 +12,7 @@ case $1 in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
upgradable-list)
|
upgradable-list)
|
||||||
output=$(env LANGUAGE=en_US bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt list --upgradable -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk NR\>1)
|
output=$(env LANGUAGE=en_US apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk NR\>1)
|
||||||
|
|
||||||
IFS_OLD="$IFS"
|
IFS_OLD="$IFS"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user