エラー「certbot: error: unrecognized arguments: certbot」が発生した場合

エラー「certbot: error: unrecognized arguments: certbot」が発生した場合

certbotコマンド実行中にエラー「certbot: error: unrecognized arguments: certbot」が発生した場合の対処法を記述してます。

環境

  • OS Rocky Linux release 8.4 (Green Obsidian)

エラー全文

以下のエラーが発生

usage: 
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
certificate. 
certbot: error: unrecognized arguments: certbot

原因

すごいくだらいことですが、「certbot」コマンドが重複していただけ

certbot certbot certonly -n --agree-tos -m example@example.com --webroot -w /var/www/html -d example.com

対処法

当然、2回使用している「certbot」を1つにするだけ

certbot certonly -n --agree-tos -m example@example.com --webroot -w /var/www/html -d example.com