在 sources.list 中,apt错误:: 你必须放置一些'source'uri

分享于 

6分钟阅读

ubuntu

  繁體

问题

我在ubuntu上安装PIL

我首先需要使用以下命令安装python-imaging


sudo apt-get build-dep python-imaging



当我尝试这样做,得到错误


E: You must put some 'source' URIs in your sources.list




E: Build-Depends dependency for python-imaging cannot be satisfied because candidate version of package python-all-dev can't satisfy version requirements 




答案1

运行software-properties-gtk

然后,在"Ubuntu软件"选项卡下单击"源代码":

deb-src下添加了一些/etc/apt/sources.list行,现在可以 sudo apt-get build-dep <package>


答案2

可以直接编辑源列表(/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



可能希望将前缀http://gb.更改为列表中其他源的前缀,还可以忽略#Added by software-properties

编辑sources.list后,再次安装之前运行sudo apt-get update

这里可以找到完整的diff

另一种方法是生成一个新的,使用此站点获取完整的sources.list:https://repogen.simplylinux.ch/


答案3

编辑/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



有关更多信息,请参见https://help.ubuntu.com/community/Repositories/CommandLine


答案4


$ sudo diff /etc/apt/sources.list /etc/apt/sources.list.bkp 



6c6


< deb-src http://au.archive.ubuntu.com/ubuntu/ xenial main restricted


---


> # deb-src http://au.archive.ubuntu.com/ubuntu/ xenial main restricted



19c19


< deb-src http://au.archive.ubuntu.com/ubuntu/ xenial universe


---


> # deb-src http://au.archive.ubuntu.com/ubuntu/ xenial universe



39c9


< deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse


---


> # deb-src http://au.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse



53c53


< deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse


---


> # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse




答案5

在Linux Mint (版本是18 )中,你可以转到软件源(在开始菜单中搜索它,或者使用software-sources从终端打开它),如果启用此选项,程序会将正确的行放入 /etc/apt/sources.list.d/official-source-repositories.list


答案6

这是命令行解决方案


cat /etc/apt/sources.list | grep deb-src # see what will get changed




# 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




sudo sed -i~orig -e 's/# deb-src/deb-src/' /etc/apt/sources.list 



刷新本地元数据后,您的机器可以访问新的ubuntu软件包类别


sudo apt-get update




E: You must put some 'source' URIs in your sources.list





Source  lis  列表  Sources  PUT  APT  
相关文章