I missed the fact that it is documented to be a space-separated list.
pretty_name = os_release.get('PRETTY_NAME', 'Linux')
print(f'Running on {pretty_name}')
-if (os_release.get('ID', 'linux') == 'debian' or
- os_release.get('ID_LIKE', None) == 'debian'):
+if 'debian' in [os_release.get('ID', 'linux'),
+ *os_release.get('ID_LIKE', '').split()]:
print('Looks like Debian!')
echo "Running on ${PRETTY_NAME:-Linux}"
-if [ "${ID:-linux}" = "debian" ] || [ "${ID_LIKE:-}" = "debian" ]; then
+if [ "${ID:-linux}" = "debian" ] || [ "${ID_LIKE#*debian*}" != "${ID_LIKE}" ]; then
echo "Looks like Debian!"
fi