Debian/Ubuntu: if software installation fails, update package indices and retry