hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
14.98k stars 3.33k forks source link

can't install latest packer #13038

Closed ozbillwang closed 3 weeks ago

ozbillwang commented 3 weeks ago

can't install packer in ubuntu 18.04. The same commands are fine last month

follow the official document: https://developer.hashicorp.com/packer/tutorials/docker-get-started/get-started-install-cli

$ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:3 https://apt.releases.hashicorp.com bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:5 https://apt.releases.hashicorp.com bionic Release
  404  Not Found [IP: 18.67.93.76 443]
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
E: The repository 'https://apt.releases.hashicorp.com bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

If I ignore the error (404 Not Found [IP: 18.67.93.76 443]), I can't install the latest packer

$ sudo apt-get update && sudo apt-get install packer
$ packer version
Packer v1.0.4
$  apt-get install -y packer=1.9.1-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1.9.1-1' for 'packer' was not found
$ apt-get install -y packer=1.11.0-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '1.11.0-1' for 'packer' was not found
sabuncumurat commented 3 weeks ago

The approach used in the answer here may help: https://discuss.hashicorp.com/t/the-repository-https-apt-releases-hashicorp-com-focal-release-does-not-have-a-release-file/47790/13

ozbillwang commented 3 weeks ago

Thanks, @sabuncumurat this confirmed the issue.

I finally fixed the issue with another approach.

      sudo apt install -y unzip
      sudo wget https://releases.hashicorp.com/packer/1.11.0/packer_1.11.0_linux_amd64.zip
      sudo unzip packer_1.11.0_linux_amd64.zip
      sudo chmod +x packer
      sudo mv packer /usr/bin/packer
      packer version