Pass the mktemp prefix as an argument
cabal-install 1.18.0.2

Fix hackage URL.

Closes #23007.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>