add-apt-repository 设置了错误的发行版名称

add-apt-repository 设置了错误的发行版名称

我正在使用 KDE Neon 的测试图像,它似乎基于 Ubuntu 16.04 Xenial,因为lsb_release -a肯定会返回该图像。当我尝试使用该add-apt-repository命令时,它会要求我安装software-properties-common我所做的。

安装后,每次我尝试添加新存储库时,都会添加该存储库,但xenial它不会用作发行版名称的引用,而是设置yakkety.因此,当然apt-get无法找到任何包。修复方法是手动更改yakkety对 的引用xenial

lsb_relase -a回报

Distributor ID: neon
Description:    KDE neon Developer Edition
Release:    16.04
Codename:   xenial

请问我该如何修复它?我不明白它从哪里提取错误的分发参考。我希望我可以只更改 ASCII 文件来更改设置。

供您参考,我目前正在测试的ISO是这里

答案1

我修好了它!!我所要做的就是编辑/etc/lsb-release从:

Distributor ID: neon
Description:    KDE neon Developer Edition
Release:    16.04
Codename:   xenial

Distributor ID: Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:   xenial

瞧!问题就消失了。谁曾想到?在解决此问题时,我特别关注由“lsb_释放-a”其中明确指出“谢尼尔”所以我不明白为什么它一直引用“yakkety”。

看起来好像“aptsources.distro.get_distro()” 整个过程中使用的方法添加 apt 存储库脚本不一定从 Codename 参数中读取分发代号/etc/lsb-release但不知怎的,它通过阅读“分发ID”。我认为这里的关键是“分发ID”说“霓虹灯”。因为如果你读到“/usr/share/distro-info/ubuntu.csv“你会看到这个:

version,codename,series,created,release,eol,eol-server
4.10,Warty Warthog,warty,2004-03-05,2004-10-20,2006-04-30
5.04,Hoary Hedgehog,hoary,2004-10-20,2005-04-08,2006-10-31
5.10,Breezy Badger,breezy,2005-04-08,2005-10-12,2007-04-13
6.06 LTS,Dapper Drake,dapper,2005-10-12,2006-06-01,2009-07-14,2011-06-01
6.10,Edgy Eft,edgy,2006-06-01,2006-10-26,2008-04-25
7.04,Feisty Fawn,feisty,2006-10-26,2007-04-19,2008-10-19
7.10,Gutsy Gibbon,gutsy,2007-04-19,2007-10-18,2009-04-18
8.04 LTS,Hardy Heron,hardy,2007-10-18,2008-04-24,2011-05-12,2013-05-09
8.10,Intrepid Ibex,intrepid,2008-04-24,2008-10-30,2010-04-30
9.04,Jaunty Jackalope,jaunty,2008-10-30,2009-04-23,2010-10-23
9.10,Karmic Koala,karmic,2009-04-23,2009-10-29,2011-04-29
10.04 LTS,Lucid Lynx,lucid,2009-10-29,2010-04-29,2013-05-09,2015-04-29
10.10,Maverick Meerkat,maverick,2010-04-29,2010-10-10,2012-04-10
11.04,Natty Narwhal,natty,2010-10-10,2011-04-28,2012-10-28
11.10,Oneiric Ocelot,oneiric,2011-04-28,2011-10-13,2013-05-09
12.04 LTS,Precise Pangolin,precise,2011-10-13,2012-04-26,2017-04-26
12.10,Quantal Quetzal,quantal,2012-04-26,2012-10-18,2014-05-16
13.04,Raring Ringtail,raring,2012-10-18,2013-04-25,2014-01-27
13.10,Saucy Salamander,saucy,2013-04-25,2013-10-17,2014-07-17
14.04 LTS,Trusty Tahr,trusty,2013-10-17,2014-04-17,2019-04-17
14.10,Utopic Unicorn,utopic,2014-04-17,2014-10-23,2015-07-23
15.04,Vivid Vervet,vivid,2014-10-23,2015-04-23,2016-01-23
15.10,Wily Werewolf,wily,2015-04-23,2015-10-22,2016-07-22
16.04 LTS,Xenial Xerus,xenial,2015-10-22,2016-04-21,2021-04-21
16.10,Yakkety Yak,yakkety,2016-04-21,2016-10-20,2017-07-20

所以我猜如果 aptsources.distro.get_distro() 无法找到“已知且官方”的发行版 ID,那么它只会“默认情况下作为最后的手段”读取此文件,以检索最新的“已知”名称,在本例中是“yakkety”。无论如何,它可能不一定以这种方式工作,但我所做的改变肯定解决了我遇到的问题。

相关内容