Sometimes Ubuntu fails to install some services which probably can be fixed by updating the Ubuntu distro, which was my case.
My case was
aws-vaultwas throwing strange errors. Updating Ubuntu fixed it.
Here are the steps I did to make the Ubuntu update go smooth.
Note: Make sure you are running it as a non-root user
Note:
$PATHresets when the terminal is reopened. To avoid this, register the$PATHchanges in~/.bashrcfile. As mentioned here: stackoverflow. Example:echo 'export PATH=$PATH: /path/to/bin' >> ~/.bashrcor addexport PATH=$PATH: /path/to/binat the end of the.bashrcby opening it in a editor,sudo vi ~/.bashrc.
Update the jessie services in /etc/apt/sources.list (sudo vi /etc/apt/sources.list) to the following:
deb http://deb.debian.org/debian bullseye main contrib
deb-src http://deb.debian.org/debian bullseye main contrib
deb http://deb.debian.org/debian-security/ bullseye-security main contrib
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib
deb http://deb.debian.org/debian bullseye-updates main contrib
deb-src http://deb.debian.org/debian bullseye-updates main contrib
Run the command:
sudo apt update && sudo apt upgrade
It might complain some service keys are invalid or expired while running the above update command. In such cases, it is better to run those following invalid/expired keys with this command:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys {key1} {key2} {key3}
The key1, key2, key3 are 16 digit invalid/expired keys. These keys can be one or many.
If this too doesn't work, I am not sure but try checking the invalid/expired keys for each package by running this command: sudo apt-key list. Usually, the key will be last 16 digit key in each package, for example:
pub rsa4096 2013-08-17 [SC] [expired: 2021-08-15]
75DD C3C4 A499 F1A1 8CB5 F3C8 CBF8 D6FD 518E 17E1 // These last 16 digits i.e CBF8D6FD518E17E1 (spaces removed)
uid [ expired] Jessie Stable Release Key <[email protected]>
Sometimes these keys are invalid/expired from the provider itself as happened with Google before.