fix detecting packages on debian, closes #1890