Score:0

Error during apt update: The list of sources could not be read

ag flag

When I try to update by using command sudo apt update I get this error:

E: Type 'gpg' is not known on line 1 in source list /etc/apt/sources.list.d/grafana.list
E: The list of sources could not be read.

Before this error started to happen, I was trying to install grafana

/etc/apt/sources.list.d/grafana.list

From comments:

1. cat /etc/apt/sources.list.d/grafana.list

deb [signed-by=/usr/share/keyrings/grafana.gpg] https://packages.grafana.com/oss/deb stable main
deb https://packages.grafana.com/enterprise/deb stable main
deb [signed-by=/usr/share/keyrings/grafana.gpg] https://packages.grafana.com/oss/deb stable main
deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/enterprise/deb stable main
deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/enterprise/deb beta main

2. GnuPG info:

gpg (GnuPG) 2.2.27
libgcrypt 1.9.4
Copyright (C) 2021 Free Software Foundation, Inc.
License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Home: /tmp/apt-key-gpghome.fGvGNgllIZ
Supported algorithms:
Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
           CAMELLIA128, CAMELLIA192, CAMELLIA256
Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
Compression: Uncompressed, ZIP, ZLIB, BZIP2
Please report bugs to <bugs.gnupg.org>.
Score:0
vn flag

A lot of things have apparently gone wrong, when comparing to the official installation guide.

The file /etc/apt/sources.list.d/grafana.list should only have a single line, depending on which Grafana version you choose.

The different options are (assuming the key is: /usr/share/keyrings/grafana.key):

Enterprise Edition, stable releases:

deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/enterprise/deb stable main

Enterprise Edition, beta releases:

deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/enterprise/deb beta main

OSS Edition, stable releases:

deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/oss/deb stable main

OSS Edition, beta releases:

deb [signed-by=/usr/share/keyrings/grafana.key] https://packages.grafana.com/oss/deb beta main

Add only one of the lines to /etc/apt/sources.list.d/grafana.list, and remove everything else from the file.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.