Skip to content

Commit

Permalink
api: is_supported_system add check for init package
Browse files Browse the repository at this point in the history
`init` is a metapackage ensuring the init system is installed on any debian based system. if this package cannot be found in the local apt cache, then the user is missing the default debian sources
  • Loading branch information
theofficialgman committed Aug 10, 2023
1 parent 8138c9c commit db24ad6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api
Original file line number Diff line number Diff line change
Expand Up @@ -2560,6 +2560,10 @@ Specifically, the issue is $(wc -l <<<"$frankendebian" | grep -q 1 && echo 'this
done
echo "Your system might be recoverable if you did this recently and have not performed an apt upgrade yet, but otherwise you should probably reinstall your OS."
return 1
elif ! package_available init; then
echo "Congratulations, Linux tinkerer, you broke your system. The init package can not be found, which means you have removed the default debian sources from your system.
All apt based application installs will fail. Unless you have a backup of your /etc/apt/sources.list /etc/apt/sources.list.d you will need to reinstall your OS."
return 1
elif [ -z "$(apt-get indextargets --no-release-info --format '$(SITE) $(RELEASE)' | sort -u | awk 'NF==2 {print}')" ];then
echo "Congratulations, Linux tinkerer, you broke your system. You have removed ALL debian sources from your system.
All apt based application installs will fail. Unless you have a backup of your /etc/apt/sources.list /etc/apt/sources.list.d you will need to reinstall your OS."
Expand Down

0 comments on commit db24ad6

Please sign in to comment.