「完美解决」关于最新Ubuntu22.04.1安装launchpad里面PPA报错:“InRelease not available“,“not found file“等

摘要&概述

Ubuntu添加PPA(第三方个人软件包)源时,出现类似错误:
“InRelease not available”,“403 Not Found”,“does not have a Release file.”
手动更改源获取的版本代号或许是最佳解决方案
此方案可以完美解决(Perhaps?😁)

起因

Ubuntu默认的桌面环境主题用着很不习惯,网上搜索了一下,瞄准了了unity-tweak-tools这个工具。

问题

添加launchpad第三方软件源

sudo add-apt-repository ppa:noobslab/themes

结果执行之后抛出类似错误

E: The repository 'https://ppa.launchpadcontent.net/noobslab/themes/ubuntu jammy Release' does not have a Release file.

思考&尝试 (最耗时最难熬的阶段)

文件找不到😨
So what🤔
作为一个牛X的 (并不)Coder,这能难住我🙅
嗒哒~~祭出万能法宝🔍
In Progress:■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■□ 99.9%
尝试了各种方法

2022.11.07补充更新·add-ppa-repository执行未果的扫尾工作

在我们第一次直接用add-ppa-repository命令来添加第三方源的时候,虽然结果报错了,但其实这个工具已经把两个源地址添加到了Ubuntu系统的[Software&Updates]的[Other Software]列表里面。所以我们要去手动删除掉它,以免在[解决方案]第五步最后时刻被它摆一道。我今晚在添加另个一源的时候突然想到,好像咱的文章还是有逻辑漏洞👻。(P.S.为了演示,我又故意去误操作了一次,给我加个鸡腿吧)
删除障碍
在弹出的窗口中,你可直接关闭,也可点击Reload。它在这里的作用类似于apt update。
关闭窗口

解决方案

第一步·打开第三方源的网站

打开第三方源(终端错误提示中的)网址:LaunchPad,搜索你要安装的软件仓,本次是[noobslab]
LaunchPad首页

第二步·找到仓库Owner主页

点击图示链接,打开这个完全匹配的仓库
点击仓库链接

第三步·找到具体仓库

在仓库主页找到本次要添加的[themes]具体仓库
具体仓库

第四步·选择正确版本代号

首先查看你当前系统的发行版本代号,在终端输入如下命令

lsb_release -a

得到的输出信息,其中[Codename]的值[Jammy]就是当前发行版本代号

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.1 LTS
Release:	22.04
Codename:	jammy

然后如下图所示操作
详细操作
然后得到下图中的结果
操作结果

第五步·手动更新PPA源

在终端输入以下命令(我用的VIM文本编辑器,你可以用自己习惯的),编辑本地软件源列表
P.S. 更新修改说明:代码打错了,已改正

sudo vim /etc/apt/sources.list

在文件中添加刚刚得到的两行命令,然后保存退出。

deb https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic main 
deb-src https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic main

最后在终端执行软件源更新

sudo apt update

得到如下结果,表示已经获取到更新(只要按照上述步骤来,基本能得到结果😊)

Hit:1 http://ftp.sjtu.edu.cn/ubuntu jammy InRelease
Hit:2 http://ftp.sjtu.edu.cn/ubuntu jammy-updates InRelease     
Hit:3 http://ftp.sjtu.edu.cn/ubuntu jammy-backports InRelease   
Hit:4 http://ftp.sjtu.edu.cn/ubuntu jammy-security InRelease                   
Get:5 https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic InRelease [15.4 kB]
Get:6 https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic/main Sources [3,424 B]
Get:7 https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic/main i386 Packages [2,372 B]
Get:8 https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic/main amd64 Packages [2,372 B]
Get:9 https://ppa.launchpadcontent.net/noobslab/themes/ubuntu cosmic/main Translation-en [936 B]
Fetched 24.5 kB in 7s (3,718 B/s)                                              
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.

其中Hit表示命中时间戳不需要更新,Get表示获取到更新并已成功下载。[5-9]就是本次添加PPA源并得到的结果,接下来就可以愉快的 sudo apt install 该仓库[noobsalb/themes]的所有软件了🎉🎉🎉

总结

折腾过程中难免遇到报错,要冷静思考并充分利用网络资源。
这次的问题归纳出以下两点:
1. Ubuntu系统自带的add-apt-repository命令只会添加对应当前版本代号的仓库,Ubuntu更新机制出于安全考虑这样设置的,连这个命令后面的参数都没有指定版本代号的选项,如下

usage: add-apt-repository [-h] [-d] [-r] [-s] [-c COMPONENT] [-p POCKET] [-y] [-n] [-l] [--dry-run] [-L | -P PPA | -C CLOUD | -U URI | -S SOURCESLIST [SOURCESLIST ...] | line ...]

Only ONE of -P, -C, -U, -S, or old-style 'line' can be specified

positional arguments:
  line                  sources.list line to add (deprecated)

options:
  -h, --help            show this help message and exit
  -d, --debug           Print debug
  -r, --remove          Disable repository
  -s, --enable-source   Allow downloading of the source packages from the repository
  -c COMPONENT, --component COMPONENT
                        Components to use with the repository
  -p POCKET, --pocket POCKET
                        Add entry for this pocket
  -y, --yes             Assume yes to all queries
  -n, --no-update       Do not update package cache after adding
  -l, --login           Login to Launchpad.
  --dry-run             Don't actually make any changes.
  -L, --list            List currently configured repositories
  -P PPA, --ppa PPA     PPA to add
  -C CLOUD, --cloud CLOUD
                        Cloud Archive to add
  -U URI, --uri URI     Archive URI to add
  -S SOURCESLIST [SOURCESLIST ...], --sourceslist SOURCESLIST [SOURCESLIST ...]
                        Full sources.list entry line to add

2. Linux系统学习中,报错或者系统挂了都很正常,大牛都不敢保证完全没问题,要善于抓取并分析关键错误信息。至少在错误信息提示上,Linux做的比Windows人性化,它会告诉你到你错在哪一步。Win系统基本上都是0x00000****之类的的内部代码(闭源OS通病),跟天书一样😅

P.S. 可能有人要说我“捧一踩一”,但我是Win重度使用者,所以就事论事罢了。

写在最后

这个方案应该是此类问题的通用解了,毕竟除了官方源,第三方源也没必要每个发行版都制作对应的仓库吧。除非有新的功能更新或者BUG修复,不然就会停在最后一次更新状态。但是官方发行版又是不停的,我不可能为了新系统放弃好用的第三方源,但也不能只因为安全机制就放弃新系统吧。还是那句话“错误不可怕,找到它,解决它!”
如果本篇文章的确解决了你的麻烦,欢迎
一键三连

如有任何问题,请留言回复,能解决一定帮忙。

参考来源

[1]NoobsLab.Themes Collection by NoobsLab[W]:网站.LaunchPad.2017-05-28.
[2]InsideOut.解决Ubuntu19.04无法添加noobslab源[B]:博客.博客园.2019-12-29.

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>