当我尝试使用 apt-get 安装任何东西时,出现以下错误:
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 60, in <module>
sp = SoftwareProperties()
File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
self.reload_sourceslist()
File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template
Run Code Online (Sandbox Code Playgroud)
知道这意味着什么以及如何解决吗?
Jos*_*son 24
易于修复 只需这样做
gksudo gedit /etc/lsb-release
Run Code Online (Sandbox Code Playgroud)
然后编辑打开的文件,使其看起来像这样
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=karmic
DISTRIB_DESCRIPTION="Ubuntu Karmic Koala"
Run Code Online (Sandbox Code Playgroud)
请记住输入您使用的 ubuntu 版本。我正在使用业力考拉,所以我把它放进去。
您可以在底部获得一个列表
http://en.wikipedia.org/wiki/Ubuntu_%28operating_system%29
然后在保存 lsb-release 文件后返回终端,您应该能够添加-apt-repository
的内容/etc/lsb-release
无效。您需要重新安装该base-files
软件包以恢复其预期内容。不幸的是,您不能仅apt-get
用于工作。反而,
转到https://launchpad.net/ubuntu/+source/base-files并查找适用于您的 Ubuntu 版本的部分,
下载适用于您的版本和架构的最新版本的软件包,
跑:
sudo dpkg -i /your/path/to/base-files_*.deb
Run Code Online (Sandbox Code Playgroud)进行测试运行
sudo apt-get install --reinstall base-files
Run Code Online (Sandbox Code Playgroud) 归档时间: |
|
查看次数: |
62315 次 |
最近记录: |