diff --git a/checkpkg.in b/checkpkg.in
index 94a75292a42d4d75e8cdaf2c4235e48368b2a229..cde3dc2478b8a4592548c28167982536bb35b471 100644
--- a/checkpkg.in
+++ b/checkpkg.in
@@ -24,7 +24,7 @@ if [[ $arch == 'any' ]]; then
 fi
 
 STARTDIR=$(pwd)
-TEMPDIR=$(mktemp -d /tmp/checkpkg-script.XXXX)
+TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX)
 cd "$TEMPDIR"
 
 for _pkgname in "${pkgname[@]}"; do
diff --git a/lddd.in b/lddd.in
index 9695c9bc0b90865db8af7c67157836139a927fdf..c011674ca2fc71f9b2a5d986d94e5f76b4e2075d 100644
--- a/lddd.in
+++ b/lddd.in
@@ -9,7 +9,7 @@ IFS="${IFS}:"
 libdirs="/lib /usr/lib /usr/local/lib $(cat /etc/ld.so.conf.d/*)"
 extras=
 
-TEMPDIR=$(mktemp -d /tmp/lddd-script.XXXX)
+TEMPDIR=$(mktemp -d --tmpdir lddd-script.XXXX)
 
 echo 'Go out and drink some tea, this will take a while :) ...'
 #  Check ELF binaries in the PATH and specified dir trees.