poikilos

ChatGPT fixed Key is stored in legacy trusted.gpg keyring

Jan 29th, 2025
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.25 KB | None | 0 0
  1. W: http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu/dists/noble/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. W: https://ppa.launchpadcontent.net/openshot.developers/ppa/ubuntu/dists/jammy/InRelease: Signature by key FBA0C227099A5360635E3D9152165BD6B9BA26FA uses weak algorithm (rsa1024) W: https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/dists/jammy/InRelease: Signature by key 60C317803A41BA51845E371A1E9377A2BA9EF27F uses weak algorithm (rsa1024)
  2.  
  3. ###### ChatGPT said:
  4.  
  5. ChatGPT
  6.  
  7. These warnings from `apt` indicate issues with the repository keys used for verification:
  8.  
  9. 1. **Legacy Keyring (`trusted.gpg`)**
  10.  
  11. - The key for `kelebek333/kablosuz` is stored in the deprecated `/etc/apt/trusted.gpg` keyring.
  12. - Solution: Move the key to `/etc/apt/trusted.gpg.d/` or use `gpg` with `signed-by` in the `.list` file.
  13. 2. **Weak Signature Algorithm (RSA 1024-bit)**
  14.  
  15. - The keys for `openshot.developers` and `ubuntu-toolchain-r/test` use RSA 1024-bit, which is considered weak.
  16. - Solution: Contact the PPA maintainers to update their key to at least RSA 2048-bit.
  17. - Workaround: You can still use these PPAs, but it's recommended to avoid weakly signed repositories.
  18.  
  19. To fix the legacy keyring warning for `kelebek333/kablosuz`:
  20.  
  21. bash
  22.  
  23. CopyEdit
  24.  
  25. `sudo mkdir -p /etc/apt/keyrings sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --recv-keys <KEY_ID> echo "deb [signed-by=/etc/apt/keyrings/kelebek333.gpg] http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble main" | sudo tee /etc/apt/sources.list.d/kelebek333.list sudo apt update`
  26.  
  27. Replace `<KEY_ID>` with the actual key ID.
  28.  
  29. For the weak RSA keys, you can report the issue to the PPA maintainers or consider alternative sources.
  30.  
  31. 4o
  32.  
  33. ##### You said:
  34.  
  35. sudo apt-key list Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). /etc/apt/trusted.gpg -------------------- pub rsa4096 2019-10-14 \[SC\] F30D 3DBF B753 4F67 0B44 C719 23E5 0C67 0722 A6D9 uid \[ unknown\] Launchpad PPA for Butterfly
  36.  
  37. ###### ChatGPT said:
  38.  
  39. ChatGPT
  40.  
  41. The warning indicates that `apt-key` is deprecated and advises managing repository keys in `/etc/apt/trusted.gpg.d/`. The key you listed (`F30D 3DBF B753 4F67 0B44 C719 23E5 0C67 0722 A6D9`) is stored in the legacy `/etc/apt/trusted.gpg`, which is discouraged.
  42.  
  43. ### **Fixing the Issue**
  44.  
  45. To move this key to the new keyring format:
  46.  
  47. 1. **Export the Key to a File**
  48.  
  49. bash
  50.  
  51. CopyEdit
  52.  
  53. `sudo apt-key export 0722A6D9 | sudo tee /etc/apt/trusted.gpg.d/butterfly.gpg > /dev/null`
  54.  
  55. _(Replace `0722A6D9` with the last 8 digits of the key if needed.)_
  56.  
  57. 2. **Verify the New Location**
  58.  
  59. bash
  60.  
  61. CopyEdit
  62.  
  63. `ls -l /etc/apt/trusted.gpg.d/`
  64.  
  65. 3. **Remove the Old Key from `trusted.gpg`**
  66.  
  67. bash
  68.  
  69. CopyEdit
  70.  
  71. `sudo apt-key del 0722A6D9`
  72.  
  73. 4. **Update APT**
  74.  
  75. bash
  76.  
  77. CopyEdit
  78.  
  79. `sudo apt update`
  80.  
  81.  
  82. This ensures that the key is stored correctly without relying on the deprecated `trusted.gpg`. Let me know if you need further assistance!
  83.  
  84. 4o
  85.  
  86. ##### You said:
  87.  
  88. W: The key(s) in the keyring /etc/apt/trusted.gpg.d/butterfly.gpg are ignored as the file has an unsupported filetype.
  89.  
  90. ###### ChatGPT said:
  91.  
  92. ChatGPT
  93.  
  94. The error occurs because `apt` expects keys in `/etc/apt/trusted.gpg.d/` to be in binary (GPG) format, but `apt-key export` generates an ASCII-armored key, which is not supported.
  95.  
  96. ### **Fixing the Issue**
  97.  
  98. Instead of using `apt-key`, use `gpg` directly:
  99.  
  100. 1. **Create the Keyring Directory (if it doesn't exist)**
  101.  
  102. bash
  103.  
  104. CopyEdit
  105.  
  106. `sudo mkdir -p /etc/apt/keyrings`
  107.  
  108. 2. **Export and Convert the Key Properly**
  109.  
  110. bash
  111.  
  112. CopyEdit
  113.  
  114. `sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/butterfly.gpg --recv-keys 0722A6D9 sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/butterfly.gpg --export > /etc/apt/keyrings/butterfly.gpg`
  115.  
  116. 3. **Update the Repository List** Modify the `.list` file referencing this key (e.g., `/etc/apt/sources.list.d/butterfly.list`) to include:
  117.  
  118. bash
  119.  
  120. CopyEdit
  121.  
  122. `deb [signed-by=/etc/apt/keyrings/butterfly.gpg] http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble main`
  123.  
  124. 4. **Update APT**
  125.  
  126. bash
  127.  
  128. CopyEdit
  129.  
  130. `sudo apt update`
  131.  
  132.  
  133. ### **Explanation**
  134.  
  135. - `apt` expects keys in `/etc/apt/keyrings/` in binary format.
  136. - The `signed-by=` directive ensures that only this key is used for verifying the repo.
  137.  
  138. Let me know if you run into any issues!
  139.  
  140. 4o
  141.  
  142. ##### You said:
  143.  
  144. Err:8 http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble InRelease The following signatures couldn't be verified because the public key is not available: NO\_PUBKEY 23E50C670722A6D9 Reading package lists... Done Building dependency tree... Done Reading state information... Done 401 packages can be upgraded. Run 'apt list --upgradable' to see them. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble InRelease: The following signatures couldn't be verified because the public key is not available: NO\_PUBKEY 23E50C670722A6D9
  145.  
  146. ###### ChatGPT said:
  147.  
  148. ChatGPT
  149.  
  150. The error occurs because APT cannot find the public key (`23E50C670722A6D9`) for the `kelebek333/kablosuz` PPA. You need to manually add the key and update your sources.
  151.  
  152. ### **Fixing the Issue**
  153.  
  154. #### **1\. Remove Old Key (if present)**
  155.  
  156. bash
  157.  
  158. CopyEdit
  159.  
  160. `sudo rm -f /etc/apt/trusted.gpg.d/butterfly.gpg sudo rm -f /etc/apt/keyrings/kelebek333.gpg`
  161.  
  162. #### **2\. Import the Correct Key**
  163.  
  164. Use `gpg` to fetch and store the key in the correct format:
  165.  
  166. bash
  167.  
  168. CopyEdit
  169.  
  170. `sudo mkdir -p /etc/apt/keyrings sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --recv-keys 23E50C670722A6D9 sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --export > /etc/apt/keyrings/kelebek333.gpg`
  171.  
  172. #### **3\. Update the Repository Source**
  173.  
  174. Ensure the PPA entry in `/etc/apt/sources.list.d/kelebek333.list` (or equivalent) is formatted correctly:
  175.  
  176. bash
  177.  
  178. CopyEdit
  179.  
  180. `deb [signed-by=/etc/apt/keyrings/kelebek333.gpg] http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble main`
  181.  
  182. #### **4\. Update APT**
  183.  
  184. bash
  185.  
  186. CopyEdit
  187.  
  188. `sudo apt update`
  189.  
  190. ### **Alternative Method (Using `wget`)**
  191.  
  192. If the above fails, try fetching the key manually:
  193.  
  194. bash
  195.  
  196. CopyEdit
  197.  
  198. `sudo mkdir -p /etc/apt/keyrings wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x23E50C670722A6D9" | sudo tee /etc/apt/keyrings/kelebek333.gpg > /dev/null`
  199.  
  200. Then, verify the repository again:
  201.  
  202. bash
  203.  
  204. CopyEdit
  205.  
  206. `sudo apt update`
  207.  
  208. Let me know if you encounter further issues! 🚀
  209.  
  210. 4o
  211.  
  212. ##### You said:
  213.  
  214. sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --recv-keys 23E50C670722A6D9 gpg: keybox '/etc/apt/keyrings/kelebek333.gpg' created gpg: keyserver receive failed: No data owner@roamtop:~$ sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --export > /etc/apt/keyrings/kelebek333.gpg bash: /etc/apt/keyrings/kelebek333.gpg: Permission denied owner@roamtop:~$ sudo gpg --no-default-keyring --keyring /etc/apt/keyrings/kelebek333.gpg --export | sudo tee /etc/apt/keyrings/kelebek333.gpg gpg: WARNING: nothing exported
  215.  
  216. ###### ChatGPT said:
  217.  
  218. ChatGPT
  219.  
  220. The issue arises because the keyserver query is returning no data. This can happen for several reasons, including an outdated key, a deprecated keyserver, or a missing key.
  221.  
  222. ### **Solution: Manually Download and Add the Key**
  223.  
  224. Since the automatic method isn't working, let's try manually downloading and adding the key.
  225.  
  226. #### **1\. Check if the Key Exists on Ubuntu Keyserver**
  227.  
  228. Run:
  229.  
  230. bash
  231.  
  232. CopyEdit
  233.  
  234. `wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x23E50C670722A6D9"`
  235.  
  236. If this returns an error or no key data, the key may no longer be available.
  237.  
  238. #### **2\. Try Manually Adding the Key**
  239.  
  240. If the above command works, then add the key using:
  241.  
  242. bash
  243.  
  244. CopyEdit
  245.  
  246. `wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x23E50C670722A6D9" | sudo tee /etc/apt/keyrings/kelebek333.gpg > /dev/null`
  247.  
  248. #### **3\. Update APT Sources**
  249.  
  250. Ensure the PPA is configured correctly in `/etc/apt/sources.list.d/kelebek333.list`:
  251.  
  252. bash
  253.  
  254. CopyEdit
  255.  
  256. `deb [signed-by=/etc/apt/keyrings/kelebek333.gpg] http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble main`
  257.  
  258. #### **4\. Update APT**
  259.  
  260. bash
  261.  
  262. CopyEdit
  263.  
  264. `sudo apt update`
  265.  
  266. ---
  267.  
  268. ### **If the Key is No Longer Available**
  269.  
  270. If `wget` also fails to retrieve the key, then:
  271.  
  272. 1. **The key might be removed or the PPA is no longer maintained.**
  273. 2. **Check the PPA's official page:**
  274. - Visit: https://launchpad.net/~kelebek333/+archive/ubuntu/kablosuz
  275. - Look for any updates or alternative key instructions.
  276.  
  277. Would you like me to check the PPA status for you? 🚀
  278.  
  279. 4o
  280.  
  281. ##### You said:
  282.  
  283. It downloaded and the plaintext keyfile is at /etc/apt/keyrings/kelebek333.gpg but apt update says: 401 packages can be upgraded. Run 'apt list --upgradable' to see them. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble InRelease: The following signatures couldn't be verified because the public key is not available: NO\_PUBKEY 23E50C670722A6D9
  284.  
  285. ###### ChatGPT said:
  286.  
  287. ChatGPT
  288.  
  289. The issue is likely that `apt` requires the key to be in **binary GPG format**, but it seems to be in **ASCII-armored format** (plaintext). Let's fix this by converting the key properly.
  290.  
  291. ---
  292.  
  293. ### **Fix: Convert the Key to Binary Format**
  294.  
  295. Run the following commands:
  296.  
  297. 1. **Remove the existing key (since it's ASCII-armored)**
  298.  
  299. bash
  300.  
  301. CopyEdit
  302.  
  303. `sudo rm -f /etc/apt/keyrings/kelebek333.gpg`
  304.  
  305. 2. **Re-download and properly import the key as a binary file**
  306.  
  307. bash
  308.  
  309. CopyEdit
  310.  
  311. `wget -qO - "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x23E50C670722A6D9" | gpg --dearmor | sudo tee /etc/apt/keyrings/kelebek333.gpg > /dev/null`
  312.  
  313. 3. **Ensure correct permissions**
  314.  
  315. bash
  316.  
  317. CopyEdit
  318.  
  319. `sudo chmod 644 /etc/apt/keyrings/kelebek333.gpg`
  320.  
  321. 4. **Verify that the key is now in binary format**
  322.  
  323. bash
  324.  
  325. CopyEdit
  326.  
  327. `file /etc/apt/keyrings/kelebek333.gpg`
  328.  
  329. It should return something like:
  330.  
  331. vbnet
  332.  
  333. CopyEdit
  334.  
  335. `/etc/apt/keyrings/kelebek333.gpg: GPG key public ring, created <date>`
  336.  
  337. 5. **Modify the APT source list (if needed)** Ensure the file `/etc/apt/sources.list.d/kelebek333.list` contains:
  338.  
  339. bash
  340.  
  341. CopyEdit
  342.  
  343. `deb [signed-by=/etc/apt/keyrings/kelebek333.gpg] http://ppa.launchpad.net/kelebek333/kablosuz/ubuntu noble main`
  344.  
  345. 6. **Update APT**
  346.  
  347. bash
  348.  
  349. CopyEdit
  350.  
  351. `sudo apt update`
  352.  
  353.  
  354. ---
  355.  
  356. ### **Why This Works**
  357.  
  358. - `apt` does **not** support plaintext GPG keys.
  359. - `gpg --dearmor` converts the key into a **binary format** (`.gpg`), which `apt` recognizes.
  360. - The `signed-by=` option ensures only the specific key is used for this repository.
  361.  
  362. After running these steps, `sudo apt update` should work without errors. Let me know if you need further assistance! 🚀
  363.  
Advertisement
Add Comment
Please, Sign In to add comment