![如何取消此配置文件中的注释行?](https://linux22.com/image/12990/%E5%A6%82%E4%BD%95%E5%8F%96%E6%B6%88%E6%AD%A4%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E8%A1%8C%EF%BC%9F.png)
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
答案1
要启用partner
存储库,请使用add-apt-repository
工具:
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
要删除合作伙伴存储库,请使用-r
选项:
sudo add-apt-repository -r "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
回答问题sources.list
,您可以通过文本编辑器/实用程序进行编辑。例如:
sudo editor /etc/apt/sources.list
用于sed
取消注释以 结尾的行partner
:
sudo sed -i '/partner$/s/^#//g' /etc/apt/sources.list
删除行首的空格:
sudo sed -i 's/^ *//' /etc/apt/sources.list