0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Debian 13 には software-properties-common が無い

Last updated at Posted at 2025-10-21

Terraform CLI が入った Docker イメージをビルドしようとしたところ、エラーが出た。

Dockerfile
FROM debian:13

# Install Terraform CLI
RUN apt-get update && apt-get install -y gnupg software-properties-common \
  && wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \
  && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list \
  && apt-get update && apt-get install -y terraform \
  && apt-get clean && rm -rf /var/lib/apt/lists/*
E: Unable to locate package software-properties-common

どうやら Debian 13 (trixie) から software-properties-common はなくなった1らしい。これ Terraform 公式の手順2なんだけどな...。

対処としては、software-properties-common を使わずに依存しているパッケージを入れればよい。

今回 (Terraform CLI) の場合、ほしかったのは lsb-release だけだったので、それを追加するだけで通った。

Dockerfile
FROM debian:13

# Install Terraform CLI
RUN apt-get update && apt-get install -y gnupg lsb-release \
  && wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \
  && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list \
  && apt-get update && apt-get install -y terraform \
  && apt-get clean && rm -rf /var/lib/apt/lists/*

直接的に Debian イメージを使用していなくともベースイメージに Debian を使用しているイメージは多いので、依存する Debian のバージョンが 13 に上がったとき各所でこのエラーが発生するかもしれない。(例えば Python 公式イメージのベースイメージも Debian 13 に上がっていた)

  1. add-apt-repository not working in new debian ? Software properties common is not available for install also ? : r/debian

  2. Install Terraform | Terraform | HashiCorp Developer

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?