我能够使用它添加一个ppa,但无法删除。我无法找到正确的语法从sources.list中删除ppa。这里是我的代码:如何使用python apt模块删除ppa?
import aptsources.sourceslist as s
repo = ('deb', 'http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu', 'xenial', ['main'])
sources = s.SourcesList()
sources.add(repo)
sources.save()
#doesn't work
sources.remove(repo)
我试图读取文档发现here,但我仍然无法找到的格式sources.remove(repo)
我不喜欢没有文档的语法ALOT ..... 你试过exrepo ='http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu' 基本上尝试exrepo变量的不同组件。 – David
谢谢,但没有运气 – answerSeeker