Fix custom directory creation on ubuntu. Fix apt pgdg test.

Why is this included in the PR?