Better error message when there's no network
From kalilinux/build-scripts/live-build-config#32 (comment 659848301)
The
kali-tweaks
setup attempted to installxrdp
, but it failed because my machine did not have internet access. Thekali-tweaks
window simply displayed this error:Error: Couldn't install packages(s) 'xrdp'
I think we can do better than that, in term of error message, when there's no network.
One approach is to pro-actively detect whether we have internet connection, and "don't even try to apt anything" in such case. However I'm a bit worries of corner-case where we think there's no network connectivity, but in fact there is.
Another approach, maybe less prone to fail, is to try apt as usual. However, in case of apt failure, at this point we could check if there's any network connectivity, and if there's no network, we could adjust the error message a bit to say "apt failed, it seems that there's no internet access, kali-tweaks needs internet to download packages", and so on