could not find a distribution template for Raspbian/buster解决方案

当我运行 add-apt-repository的时候,遇到如下错误。

➜  zigbeegateway sudo add-apt-repository http://devtools.silabs.com/solutions/apt
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/buster

提示找不到 Raspbian/buster模板,于是查看模板文件

➜  ~ ls -l /usr/share/python-apt/templates/*.info
-rw-r--r-- 1 root root 11599 3月  11  2019 /usr/share/python-apt/templates/Blankon.info
-rw-r--r-- 1 root root  8156 3月  11  2019 /usr/share/python-apt/templates/Debian.info
-rw-r--r-- 1 root root  1590 3月  11  2019 /usr/share/python-apt/templates/gNewSense.info
-rw-r--r-- 1 root root   138 1月  26 15:00 /usr/share/python-apt/templates/Raspbian.info
-rw-r--r-- 1 root root  1169 3月  11  2019 /usr/share/python-apt/templates/Tanglu.info
-rw-r--r-- 1 root root 85596 3月  11  2019 /usr/share/python-apt/templates/Ubuntu.info
➜  ~ 

确实没有相关模板,我们可以自己创建一个

pi@raspberrypi:~ $ cat /usr/share/python-apt/templates/Raspbian.info
Suite: buster
RepositoryType: deb
BaseURI: http://raspbian.raspberrypi.org/raspbian/ 
MatchURI: http://raspbian.raspberrypi.org/raspbian/

再次执行add-apt-repository,成功。查看cat etc/apt/sources.list

~ cat /etc/apt/sources.list                                  
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
# deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpideb http://devtools.silabs.com/solutions/apt stretch main
deb http://devtools.silabs.com/solutions/apt buster main
# deb-src http://devtools.silabs.com/solutions/apt buster main

成功。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值