installationlinux-minthashicorp-vault

Cannot install Hashicorp vault in LinuxMint 21.3 : The repository does not have a Release file


I am following the official hashicorp installation docs

When I do sudo apt update && sudo apt install vault, I get an error like below:

tldr: The repository 'https://apt.releases.hashicorp.com virginia Release' does not have a Release file

Hit:1 https://download.docker.com/linux/ubuntu jammy InRelease
Hit:2 https://cli.github.com/packages stable InRelease                                                                                                                                                                                       
Get:3 https://packages.microsoft.com/repos/edge stable InRelease [3,590 B]                                                                                                                                                                   
Get:4 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]                                                                                                 
Hit:5 http://archive.ubuntu.com/ubuntu jammy InRelease                                                                                                                     
Hit:6 http://security.ubuntu.com/ubuntu jammy-security InRelease                                               
Get:7 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]                                        
Ign:8 http://packages.linuxmint.com virginia InRelease                         
Hit:9 http://packages.linuxmint.com virginia Release                           
Hit:11 http://archive.ubuntu.com/ubuntu jammy-backports InRelease              
Ign:12 https://apt.releases.hashicorp.com virginia InRelease
Err:13 https://apt.releases.hashicorp.com virginia Release
  404  Not Found [IP: 2600:9000:2579:2600:18:566b:ecc0:93a1 443]
Reading package lists... Done
E: The repository 'https://apt.releases.hashicorp.com virginia 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.

Not only this, it also broke my sudo apt update command, where it now crashes out with the same error message as above


Solution

  • First Thing first,

    unsubscribe from the repo that is breaking sudo apt update command. For me, I needed to do this:

    sudo rm /etc/apt/sources.list.d/hashicorp.list
    

    Now, On to the main issue:

    If you are following the official docs, the main problem is in the command:

    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

    specifically the $(lsb_release -cs) part, which gives virginia in my system, at the time of writing.

    The FIX:

    get details of your linux version in the terminal using:

    cat /etc/os-release
    
    # output
    NAME="Linux Mint"
    VERSION="21.3 (Virginia)"
    ID=linuxmint
    ID_LIKE="ubuntu debian"
    PRETTY_NAME="Linux Mint 21.3"
    VERSION_ID="21.3"
    HOME_URL="https://www.linuxmint.com/"
    SUPPORT_URL="https://forums.linuxmint.com/"
    BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
    PRIVACY_POLICY_URL="https://www.linuxmint.com/"
    VERSION_CODENAME=virginia
    UBUNTU_CODENAME=jammy
    
    

    find UBUNTU_CODENAME from the output. For me it gives jammy

    Hardcode this value ("jammy" in this case) in the problematic command above in place of $(lsb_release -cs) , and then finally run sudo apt update && sudo apt install vault

    It should work.

    Below are the commands run on my system:

    1. Add the HashiCorp repository. (notice: jammy hardcoded)
    
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com jammy main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
    
    
    1. Install Vault
    sudo apt update && sudo apt install vault 
    

    Output:

    Hit:1 https://download.docker.com/linux/ubuntu jammy InRelease
    Get:2 https://packages.microsoft.com/repos/edge stable InRelease [3,590 B]                                                                                                                                                                   
    Hit:3 https://cli.github.com/packages stable InRelease                                                                                                                                                                
    Get:4 https://apt.releases.hashicorp.com jammy InRelease [12.9 kB]                                                                                                                 
    Get:5 https://packages.microsoft.com/repos/code stable InRelease [3,590 B]                                                                                   
    Get:6 https://apt.releases.hashicorp.com jammy/main amd64 Packages [134 kB]                                               
    Hit:7 http://archive.ubuntu.com/ubuntu jammy InRelease                                              
    Ign:8 http://packages.linuxmint.com virginia InRelease                                              
    Hit:9 http://security.ubuntu.com/ubuntu jammy-security InRelease                           
    Hit:10 http://archive.ubuntu.com/ubuntu jammy-updates InRelease     
    Hit:11 http://packages.linuxmint.com virginia Release
    Hit:13 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
    Fetched 154 kB in 1s (139 kB/s)
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    122 packages can be upgraded. Run 'apt list --upgradable' to see them.
    
    Reading package lists... Done                                                                                
    Building dependency tree... Done
    Reading state information... Done
    The following NEW packages will be installed:
      vault
    0 upgraded, 1 newly installed, 0 to remove and 122 not upgraded.
    Need to get 147 MB of archives.
    After this operation, 430 MB of additional disk space will be used.
    Get:1 https://apt.releases.hashicorp.com jammy/main amd64 vault amd64 1.16.3-1 [147 MB]
    Fetched 147 MB in 8s (17.9 MB/s)                                                                                                                                                                                                             
    Selecting previously unselected package vault.
    (Reading database ... 617930 files and directories currently installed.)
    Preparing to unpack .../vault_1.16.3-1_amd64.deb ...
    Unpacking vault (1.16.3-1) ...
    Setting up vault (1.16.3-1) ...
    Generating Vault TLS key and self-signed certificate...
    .
    .
    .
    Vault TLS key and self-signed certificate have been generated in '/opt/vault/tls'