opendkim-genkey: 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-genkey - from package: opendkim

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

On Debian possible default full paths are:

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

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