2
1

More than 3 years have passed since last update.

Ubuntu 20.04 上の certbot-auto でエラーが出る場合

Last updated at Posted at 2020-02-21

pythonパッケージがない

cert-bot 1.1.0 や 1.2.0 で発生。

certbot-auto
$ ./certbot-auto certonly --manual \
>  --domain *.sample.jp \
>  --email root@sample.jp \
>  --agree-tos \
>  --manual-public-ip-logging-ok \
>  --preferred-challenges dns \
>  --server https://acme-v02.api.letsencrypt.org/directory
Requesting to rerun ./certbot-auto with root privileges...
Bootstrapping dependencies for Debian-based OSes... (you can skip this with --no-bootstrap)
ヒット:1 http://jp.archive.ubuntu.com/ubuntu focal InRelease
ヒット:2 http://jp.archive.ubuntu.com/ubuntu focal-updates InRelease                                              
ヒット:3 http://jp.archive.ubuntu.com/ubuntu focal-backports InRelease                                            
無視:4 https://download.docker.com/linux/ubuntu focal InRelease                                                   
ヒット:5 http://security.ubuntu.com/ubuntu focal-security InRelease

パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
パッケージ python は使用できませんが、別のパッケージから参照されます。
これは、パッケージが欠落しているか、廃止されたか、または別のソース
からのみ利用可能であることを意味します。
しかし、以下のパッケージが置き換えます:
  python2-minimal:i386 python2:i386 python2-minimal python2 2to3

パッケージ python-dev は使用できませんが、別のパッケージから参照されます。
これは、パッケージが欠落しているか、廃止されたか、または別のソース
からのみ利用可能であることを意味します。
しかし、以下のパッケージが置き換えます:
  python2-dev:i386 python2:i386 python2-dev python2

E: パッケージ 'python' にはインストール候補がありません
E: パッケージ 'python-dev' にはインストール候補がありません

対応

以下のように python3 を指定すれば良い。

certbot-auto
--- certbot-auto.bak    2020-02-21 12:25:58.472592655 +0900
+++ certbot-auto    2020-02-21 12:30:24.081600015 +0900
@@ -354,8 +354,8 @@
   fi

   apt-get install $QUIET_FLAG $YES_FLAG --no-install-recommends \
-    python \
-    python-dev \
+    python3 \
+    python3-dev \
     $virtualenv \
     gcc \
     $augeas_pkg \

./certbot-auto has insecure permissions!

sudo chown root certbot-auto

python2が使われるため、python3を使いたい

USE_PYTHON_3=1 の環境変数を使う。

$ USE_PYTHON_3=1 \
> ./certbot-auto certonly --manual \
>  --domain *.sample.jp \
>  --email root@sample.jp \
>  --agree-tos \
>  --manual-public-ip-logging-ok \
>  --preferred-challenges dns \
>  --server https://acme-v02.api.letsencrypt.org/directory
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1