Skip to content

Commit 2e27b4d

Browse files
mabiccaprzlplx
andauthored
AB#7809: Revise apt-common-issues-in-ubuntu.md for clarity (#9754)
* Revise apt-common-issues-in-ubuntu.md for clarity Adding a new scenario (7) around permission issues in keyring files. * Update apt-common-issues-in-ubuntu.md --------- Co-authored-by: Jerry Sitser <[email protected]>
1 parent 66da4e7 commit 2e27b4d

File tree

1 file changed

+59
-7
lines changed

1 file changed

+59
-7
lines changed

support/azure/virtual-machines/linux/apt-common-issues-in-ubuntu.md

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.collection: linux
1010
ms.topic: troubleshooting-problem-resolution
1111
ms.workload: infrastructure-services
1212
ms.tgt_pltfrm: vm-linux
13-
ms.custom: linux-related-content
13+
ms.custom: linux-related-content, VM Admin - Linux (Guest OS)
1414
ms.date: 06/07/2024
1515
#customer intent: As an Azure Linux virtual machine (VM) administrator, I want troubleshoot issues in the APT tools so that I can successfully install or update applications on my VMs.
1616
---
@@ -20,9 +20,6 @@ ms.date: 06/07/2024
2020

2121
This article discusses and provides solutions to common issues that you might encounter when you use the `apt` command-line tool to install or update applications on Microsoft Azure virtual machines (VMs).
2222

23-
> [!CAUTION]
24-
> Standard support for Canonical Ubuntu 18.04 LTS is no longer available. If you're affected, see [Canonical Ubuntu 18.04 LTS is out of standard support on May 31, 2023](upgrade-canonical-ubuntu-18dot04-lts.md) to review your options.
25-
2623
## Overview
2724

2825
The `apt` (Advanced Package Tool) command on Ubuntu is a powerful tool that's used for package management. It enables you to install, remove, update, and manage software packages on the Ubuntu system. You can use `apt` to search for available packages, install specific versions of packages, and handle dependencies efficiently. It simplifies the process of software management by providing a command-line interface to interact with the APT libraries.
@@ -391,10 +388,65 @@ If any application automatically edits the *sources.list* file or adds a reposit
391388

392389
#### Solution: Remove or comment out armhf information from sources.list
393390

394-
Remove or comment out the lines that reference the ARM processor architecture in the */etc/apt/sources.list* file or */etc/apt/sources.list.d/\*.list*.
391+
Remove or comment out the lines that reference the ARM processor architecture in the `/etc/apt/sources.list` file or `/etc/apt/sources.list.d/*.list`.
395392

396393
</details>
397394

398-
[!INCLUDE [Third-party contact disclaimer](../../../includes/third-party-contact-disclaimer.md)]
395+
## Scenario 7: "Unknown apt-key errors when executing apt update"
396+
397+
<details>
398+
<summary>Scenario 7 details</summary>
399+
400+
When you run the `apt update` command, the system tries to fetch package information from multiple sources. However, you receive an error message about `Unknown error executing apt-key` shown in the following output:
401+
402+
```bash
403+
404+
(base)
405+
$ sudo apt update
406+
Hit:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
407+
Hit:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease
408+
Hit:3 http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease
409+
Hit:4 http://azure.archive.ubuntu.com/ubuntu jammy-security InRelease
410+
Err:1 http://azure.archive.ubuntu.com/ubuntu jammy InRelease
411+
Unknown error executing apt-key
412+
Err:2 http://azure.archive.ubuntu.com/ubuntujammy-updatesInRelease
413+
Unknown error executing apt-key
414+
Err: 3 http://azure.archive.ubuntu.com/ubuntujammy-backports InRelease
415+
Unknown error executing apt-key
416+
5yr: 4 http://azure.archive.ubuntu.com/ubuntujammy-security InRelease
417+
'Unknown error executing apt-key
418+
Reading package lists... Done Building dependency tree... Done Reading state information... Done
419+
6 packages can be upgraded. Run 'apt list --upgradable' to see them.
420+
w: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://azure.archive.ubuntu.com/ubuntu jammy InRelease: Unknown error executing apt-key
421+
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://azure.archive.ubuntu.com/ubuntu jammy-updates InRelease: Unknown error executing apt-key
422+
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://azure.archive.ubuntu.com/ubuntu jammy-backports InRelease: Unknown error executing apt-key
423+
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://azure. archive.ubuntu.com/ubuntu jammy-security InRelease: Unknown error executing apt-key
424+
```
399425
400-
[!INCLUDE [Azure Help Support](../../../includes/azure-help-support.md)]
426+
### Cause: Permission issues affecting the keys under `/etc/apt/trusted.gpg.d ` can be seen when running apt with debug flags
427+
428+
```bash
429+
$ sudo apt update -oDebug::Acquire::gpgv=1
430+
...
431+
...
432+
http://azure.archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-archive-2018.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
433+
http://azure.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft-release.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
434+
http://azure.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-archive-2012.gpg.are ignored as the file is not readable by user '_ apt' executing apt-key.
435+
...
436+
...
437+
```
438+
439+
#### Solution: Correct permissions to be 644 for the key files under `/etc/apt/trusted.gpg.d` and also check the default umask for your installation
440+
441+
1) Correct permission for the keyring files
442+
```bash
443+
$ sudo chown 644 /etc/apt/trusted.gpg.d/*.gpg
444+
```
445+
446+
2) Check the default umask set by running
447+
```bash
448+
$ sudo umask
449+
```
450+
451+
The default umask for most distros is usually set under `/etc/login.defs` and it is set to 0022. There have been cases where the umask was being set to 0777 which results in null permissions for created files.
452+
</details>

0 commit comments

Comments
 (0)