check for ubuntu distribution first

this relates to #4587