摘要&概述
Ubuntu添加PPA(第三方個人軟件包)源時,出現(xiàn)類似錯誤:
“InRelease not available”,“403 Not Found”,“does not have a Release file.”
手動更改源獲取的版本代號或許是最佳解決方案
此方案可以完美解決(Perhaps???)
起因
Ubuntu默認的桌面環(huán)境主題用著很不習慣,網(wǎng)上搜索了一下,瞄準了了unity-tweak-tools這個工具。
問題
添加launchpad第三方軟件源
sudo add-apt-repository ppa:noobslab/themes
結(jié)果執(zhí)行之后拋出類似錯誤
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執(zhí)行未果的掃尾工作
在我們第一次直接用add-ppa-repository命令來添加第三方源的時候,雖然結(jié)果報錯了,但其實這個工具已經(jīng)把兩個源地址添加到了Ubuntu系統(tǒng)的[Software&Updates]的[Other Software]列表里面。所以我們要去手動刪除掉它,以免在[解決方案]第五步最后時刻被它擺一道。我今晚在添加另個一源的時候突然想到,好像咱的文章還是有邏輯漏洞??。(P.S.為了演示,我又故意去誤操作了一次,給我加個雞腿吧)
在彈出的窗口中,你可直接關(guān)閉,也可點擊Reload。它在這里的作用類似于apt update。
解決方案
第一步·打開第三方源的網(wǎng)站
打開第三方源(終端錯誤提示中的)網(wǎng)址:LaunchPad,搜索你要安裝的軟件倉,本次是[noobslab]
第二步·找到倉庫Owner主頁
點擊圖示鏈接,打開這個完全匹配的倉庫
第三步·找到具體倉庫
在倉庫主頁找到本次要添加的[themes]具體倉庫
第四步·選擇正確版本代號
首先查看你當前系統(tǒng)的發(fā)行版本代號,在終端輸入如下命令
lsb_release -a
得到的輸出信息,其中[Codename]的值[Jammy]就是當前發(fā)行版本代號
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
然后如下圖所示操作
然后得到下圖中的結(jié)果
第五步·手動更新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
最后在終端執(zhí)行軟件源更新
sudo apt update
得到如下結(jié)果,表示已經(jīng)獲取到更新(只要按照上述步驟來,基本能得到結(jié)果??)
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源并得到的結(jié)果,接下來就可以愉快的 sudo apt install 該倉庫[noobsalb/themes]的所有軟件了??????
總結(jié)
折騰過程中難免遇到報錯,要冷靜思考并充分利用網(wǎng)絡資源。
這次的問題歸納出以下兩點:
1. Ubuntu系統(tǒng)自帶的add-apt-repository命令只會添加對應當前版本代號的倉庫,Ubuntu更新機制出于安全考慮這樣設置的,連這個命令后面的參數(shù)都沒有指定版本代號的選項,如下
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系統(tǒng)學習中,報錯或者系統(tǒng)掛了都很正常,大牛都不敢保證完全沒問題,要善于抓取并分析關(guān)鍵錯誤信息。至少在錯誤信息提示上,Linux做的比Windows人性化,它會告訴你到你錯在哪一步。Win系統(tǒng)基本上都是0x00000****之類的的內(nèi)部代碼(閉源OS通病),跟天書一樣??
P.S. 可能有人要說我“捧一踩一”,但我是Win重度使用者,所以就事論事罷了。
寫在最后
這個方案應該是此類問題的通用解了,畢竟除了官方源,第三方源也沒必要每個發(fā)行版都制作對應的倉庫吧。除非有新的功能更新或者BUG修復,不然就會停在最后一次更新狀態(tài)。但是官方發(fā)行版又是不停的,我不可能為了新系統(tǒng)放棄好用的第三方源,但也不能只因為安全機制就放棄新系統(tǒng)吧。還是那句話“錯誤不可怕,找到它,解決它!”
如果本篇文章的確解決了你的麻煩,歡迎
如有任何問題,請留言回復,能解決一定幫忙。文章來源:http://www.zghlxwxcb.cn/news/detail-780191.html
參考來源
[1]NoobsLab.Themes Collection by NoobsLab[W]:網(wǎng)站.LaunchPad.2017-05-28.
[2]InsideOut.解決Ubuntu19.04無法添加noobslab源[B]:博客.博客園.2019-12-29.文章來源地址http://www.zghlxwxcb.cn/news/detail-780191.html
到了這里,關(guān)于「完美解決」關(guān)于最新Ubuntu22.04.1安裝launchpad里面PPA報錯:“InRelease not available“,“not found file“等的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!