opendkim-testkey: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/sbin/opendkim-testkey - from package: opendkim

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/opendkim-testkey - from package: opendkim-tools

You may install the required package with command apt-get install {package}
Error in other languages:
opendkim-testkey: bevel nie gevind nie
opendkim-testkey: comandă negăsită
opendkim-testkey: comando não encontrado
opendkim-testkey: commande introuvable
opendkim-testkey: command not found
opendkim-testkey: käsku ei ole
opendkim-testkey: không tìm thấy lệnh
opendkim-testkey: komanda nerasta
opendkim-testkey: Kommando nicht gefunden.
opendkim-testkey: kommandot finns inte
opendkim-testkey: komut yok
opendkim-testkey: nie znaleziono polecenia
opendkim-testkey: níor aimsíodh an t-ordú
opendkim-testkey: no se encontró la orden
opendkim-testkey: no s'ha trobat l'ordre
opendkim-testkey: opdracht niet gevonden
opendkim-testkey: parancs nem található
opendkim-testkey: perintah tidak ditemukan
opendkim-testkey: príkaz nenájdený
opendkim-testkey: příkaz nenalezen
opendkim-testkey: команда не найдена
opendkim-testkey: командата не е открита
opendkim-testkey: 命令找不到
opendkim-testkey: コマンドが見つかりません