1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】CodeBuildでエラー「apt-get: command not found」になった場合の原因と解決方法

Posted at

概要

AWS CodeBuildでビルド時に以下のエラーが出ました。

Running command apt-get update -y /codebuild/output/tmp/script.sh: line 4: apt-get: command not found

原因と解決方法

buildspec.yamlapt-getコマンドを使用した際に、apt-getコマンドが見つからないと言われたエラーです。

イメージによっては、CodeBuildのビルド環境がapt-getをサポートしていません。
Amazon Linuxを使っている場合はyumを利用するとのこと(Ubuntuはaptみたい)。

CodeBuildプロジェクトからイメージを確認すると

aws/codebuild/amazonlinux-x86_64-standard:5.0

とあるので、Amazon Linuxですね。

apt-getの代わりにyumを使用すれば解決しました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?