The Problem: apt-key is Deprecated and Repository is Unsigned
When trying to install Visual Studio Code on the new Ubuntu 26.04 LTS (Resolute) using old tutorial methods, you will likely hit two roadblocks:
-
sudo: 'apt-key': command not found(The tool has been removed for security reasons). -
The following signatures couldn't be verified... NO_PUBKEY EB3E94ADBE1229CF(Public key error).
This happens because Ubuntu now requires GPG keys (digital signatures) to be stored in standalone files within the /etc/apt/keyrings/ directory to ensure system integrity.
The Solution: Manual Repository Configuration
Follow these steps to correctly configure the Microsoft GPG key and repository.
1. Add the GPG Key
bash
# Download the official Microsoft key and convert it to .gpg format
wget -qO- [https://packages.microsoft.com/keys/microsoft.asc](https://packages.microsoft.com/keys/microsoft.asc) | gpg --dearmor > packages.microsoft.gpg
# Move the key to the system's secure keyring folder
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
# Remove the temporary file
rm -f packages.microsoft.gpg
Top comments (0)