E: Unable to locate package vault

Hello Team trying to install valut on a ubuntu 20.04, and getting this following error,

root@usatl-corp-test-hpcc:/home/nvelumani# sudo apt install vault
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package vault

root@usatl-corp-test-hpcc:wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
root@usatl-corp-test-hpcc:/usr/share/keyrings# xterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256colorxterm-256color^C
root@usatl-corp-test-hpcc:/usr/share/keyrings# echo “deb [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
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com focal main
root@usatl-corp-test-hpcc:/usr/share/keyrings# sudo apt install vault
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package vault

hi there!

It looks like you’re missing an apt update after the addition of the Hashicorp repo:

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list
deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com focal main
root@ebcf324de816:/# apt install vault
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package vault

(reproduces the error)

apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                
Get:3 https://apt.releases.hashicorp.com focal InRelease [17.1 kB]                                            
Hit:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease                
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:6 https://apt.releases.hashicorp.com focal/main amd64 Packages [91.5 kB]
Fetched 109 kB in 2s (66.5 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
4 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@ebcf324de816:/# apt install vault
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  vault
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 85.0 MB of archives.
After this operation, 214 MB of additional disk space will be used.
Get:1 https://apt.releases.hashicorp.com focal/main amd64 vault amd64 1.12.2-1 [85.0 MB]
Fetched 85.0 MB in 3s (33.5 MB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package vault.
(Reading database ... 5635 files and directories currently installed.)
Preparing to unpack .../vault_1.12.2-1_amd64.deb ...
Unpacking vault (1.12.2-1) ...
Setting up vault (1.12.2-1) ...
Generating Vault TLS key and self-signed certificate...
Generating a RSA private key
...........................++++
...................................................................................................................................
......++++
writing new private key to 'tls.key'
-----
Vault TLS key and self-signed certificate have been generated in '/opt/vault/tls'.

Fixes it.

Sometimes it’s the little things :wink:

Thanks for the response, when i try apt update I get the following error.

root@usatl-corp-test-hpcc:/home/nvelumani/hashicorp_vault/bin# apt update
Get:1 https://apt.releases.hashicorp.com focal InRelease [17.1 kB]
Hit:2 Index of /ubuntu focal InRelease
Err:1 https://apt.releases.hashicorp.com focal InRelease
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY AA16FCBCA621E701
Get:3 Index of /ubuntu focal-updates InRelease [114 kB]
Get:4 Index of /deadsnakes/ppa/ubuntu focal InRelease [18.1 kB]
Get:5 Index of /ubuntu focal-backports InRelease [108 kB]
Get:6 Index of /ubuntu focal-security InRelease [114 kB]
Get:7 Index of /ubuntu focal-updates/main amd64 Packages [2,344 kB]
Get:8 Index of /ubuntu focal-updates/main Translation-en [404 kB]
Get:9 Index of /ubuntu focal-updates/main amd64 c-n-f Metadata [16.2 kB]
Get:10 Index of /ubuntu focal-updates/universe amd64 Packages [1,021 kB]
Get:11 Index of /pub/repos/apt/ focal-pgdg InRelease [91.6 kB]
Get:12 Index of /ubuntu focal-updates/universe amd64 c-n-f Metadata [23.4 kB]
Get:13 Index of /ubuntu focal-security/main amd64 Packages [1,968 kB]
Get:14 Index of /deadsnakes/ppa/ubuntu focal/main amd64 Packages [24.8 kB]
Get:15 Index of /ubuntu focal-security/main Translation-en [322 kB]
Get:16 Index of /ubuntu focal-security/main amd64 c-n-f Metadata [11.9 kB]
Get:17 Index of /ubuntu focal-security/universe amd64 Packages [792 kB]
Get:18 Index of /ubuntu focal-security/universe Translation-en [153 kB]
Get:19 Index of /ubuntu focal-security/universe amd64 c-n-f Metadata [16.9 kB]
Get:20 Index of /pub/repos/apt/ focal-pgdg/main amd64 Packages [258 kB]
Reading package lists… Done
W: GPG error: https://apt.releases.hashicorp.com focal InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY AA16FCBCA621E701
E: The repository ‘https://apt.releases.hashicorp.com focal InRelease’ is not signed.
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.

I’m also running into this as well: NO_PUBKEY AA16FCBCA621E701

sounds like you’re missing the installation of the hashicorp gpg key?