You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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]>
Copy file name to clipboardExpand all lines: support/azure/virtual-machines/linux/apt-common-issues-in-ubuntu.md
+59-7Lines changed: 59 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.collection: linux
10
10
ms.topic: troubleshooting-problem-resolution
11
11
ms.workload: infrastructure-services
12
12
ms.tgt_pltfrm: vm-linux
13
-
ms.custom: linux-related-content
13
+
ms.custom: linux-related-content, VM Admin - Linux (Guest OS)
14
14
ms.date: 06/07/2024
15
15
#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.
16
16
---
@@ -20,9 +20,6 @@ ms.date: 06/07/2024
20
20
21
21
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).
22
22
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
-
26
23
## Overview
27
24
28
25
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
391
388
392
389
#### Solution: Remove or comment out armhf information from sources.list
393
390
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`.
## 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:
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
+
```
399
425
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.
0 commit comments