Partial fix for #4565. Works only for Debian 7 and later