在 sources.list 文件中删除 ppa 条目后,我无法打开软件源应用程序。打开软件中心没问题。我尝试运行 gksudo software-properties-gtk 并收到以下消息:
SoftwareProperties.__init__(self, options=options, datadir=datadir)
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 96, in __init__
self.reload_sourceslist()
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 580, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 91, in get_sources
raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template
如果您能告诉我如何解决这个问题我将不胜感激。
答案1
快速的操作是删除并重新安装
sudo apt-get update
sudo apt-get remove --purge software-properties-gtk
sudo apt-get install software-properties-gtk
如果这个方法不起作用的话我接下来会做的事情是:
备份文件
sudo cp /usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py /usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py.backup
然后将其移除
sudo rm -rf /usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py
对其他有问题的文件执行此操作并重试