我试图在ubuntu上安装PIL一个python模块
首先,我需要使用以下命令安装一个名为python映像的包
sudo apt-get build-dep python-imaging当我尝试这样做时,我会得到错误。
E: You must put some 'source' URIs in your sources.list我看到了这问题,‘m展示了如何通过GUI进行修复,但我使用的是命令行。有人知道我怎样才能纠正这个错误吗..?
更新:基于下面的答案,我更新了我的包列表,但是现在我得到了这个错误。不确定它是否相关,如果不是,我将开始一个新的问题,因为我在任何地方都找不到对错误的引用。
E: Build-Depends dependency for python-imaging cannot be satisfied because candidate version of package python-all-dev can't satisfy version requirements 发布于 2014-07-11 16:47:12
您可以直接编辑源列表(/etc/apt/sources.list)。我认为您需要添加/取消注释这些行:
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-updates restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse #Added by software-properties
deb-src http://security.ubuntu.com/ubuntu trusty-security restricted main universe multiverse #Added by software-properties
deb-src http://gb.archive.ubuntu.com/ubuntu/ trusty-proposed restricted main universe multiverse #Added by software-properties我通过禁用源代码选项,保存sources.list文件的一个副本,然后启用源代码选项,保存另一个副本,然后在这两个版本上运行diff来解决这个问题。
您可能希望将前缀http://gb.更改为列表中其他源的前缀(因此它使用最近的回购镜像),您也可以忽略#Added by software-properties。
编辑sources.list之后,在再次安装之前运行sudo apt-get update。
完整的diff可以找到这里
另一种方法是生成一个新的。获得完整sources.list的一种方法是使用以下站点:https://repogen.simplylinux.ch/
发布于 2014-07-11 16:46:54
编辑/etc/apt/sources.list
sudo nano /etc/apt/sources.list然后删除#或使用deb-src $url添加行,例如:
deb http://ch.archive.ubuntu.com/ubuntu/ saucy main restricted
deb-src http://ch.archive.ubuntu.com/ubuntu/ saucy main restricted或从现有行复制,例如:
deb blah blah
deb-src exact same blah blah然后跑:
sudo apt-get update有关其他信息,请参见https://help.ubuntu.com/community/Repositories/CommandLine。
发布于 2018-03-04 00:20:29
下面是命令行解决方案
cat /etc/apt/sources.list | grep deb-src # see what will get changed上述cmd的典型输出
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://archive.canonical.com/ubuntu bionic partner
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://archive.ubuntu.com/ubuntu bionic main universe restricted multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse如果您很好地更改了上面的行,这在新的ubuntu安装中总是正确的,那么请发出:
sudo sed -i~orig -e 's/# deb-src/deb-src/' /etc/apt/sources.list 它执行输入文件的备份,然后搜索注释删除的deb-src,其中删除注释以使这些行处于活动状态.在更新本地元数据之后,机器将了解ubuntu包的新链接。
sudo apt-get update现在再次发出您的原始命令,该命令失败了:
E: You must put some 'source' URIs in your sources.listhttps://askubuntu.com/questions/496549
复制相似问题