$ apt-get source libtiff4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'tiff3' as source package instead of 'libtiff4'
E: Unable to find a source package for tiff3
如果我添加 -f,它不会改变行为。是什么原因导致它这样做,我如何强制它下载我想要的包?
根据搜索,我甚至不知道 tiff3 的想法是从哪里来的
$ apt-cache search libtiff
libtiff-doc - TIFF manipulation and conversion documentation
libtiff-tools - TIFF manipulation and conversion tools
libtiff5 - Tag Image File Format (TIFF) library
libtiff5-alt-dev - Tag Image File Format library (TIFF), alternative development files
libtiff5-dev - Tag Image File Format library (TIFF), development files
libtiffxx5 - Tag Image File Format (TIFF) library -- C++ interface
gem-plugin-tiff - Graphics Environment for Multimedia - TIFF support
libtiff-opengl - TIFF manipulation and conversion tools
libtiff4 - Tag Image File Format (TIFF) library (old version)
libtiff4-dev - Tag Image File Format (TIFF) library (old version), development files
libtiffxx0c2 - Tag Image File Format (TIFF) library (old version) -- C++ interface
pngtools - series of tools for PNG (Portable Network Graphics) images
python-libtiff - wrapper to the libtiff library to Python using ctypes
答案1
二进制包和其对应的源码包之间并不是一对一的关系。原因如下:
- 在某些情况下,多个二进制包将来自一个来源
- 名称会略有不同,以反映二进制包的版本
- 有些包不直接包含二进制文件,而是仅指定应安装的依赖包。
我无法重现您的特定问题,可能是因为我安装了较新版本的 Ubuntu。下面是使用类似库的类似问题的演练(请注意,我的示例中的所有内容都已安装,但显示的有关映射和依赖项的信息仍然相关)。这应该会提供一些关于如何处理此类问题的好提示。
我已经成功安装了一个名为的包libjpeg8
:
$ sudo apt-get install libjpeg8
Reading package lists... Done
Building dependency tree
Reading state information... Done
libjpeg8 is already the newest version.
我尝试获取源代码,但它被重新映射到带有后缀的内容-empty
。
$ apt-get source libjpeg8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'libjpeg8-empty' as source package instead of 'libjpeg8'
Skipping unpack of already unpacked source in libjpeg8-empty-8c
我列出了所需包的依赖项,并注意libjpeg-turbo8
:
$ apt-cache depends libjpeg8
libjpeg8
Depends: libjpeg-turbo8
Replaces: libjpeg8:i386
Breaks: libjpeg8:i386
我安装了的源代码libjpeg-turbo8
,并获得了我需要的源代码:
$ apt-get source libjpeg-turbo8
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'libjpeg-turbo' as source package instead of 'libjpeg-turbo8'
Skipping unpack of already unpacked source in libjpeg-turbo-1.3.0
答案2
确保已在“软件和更新”中标记“源代码”条目。
如果没有,请勾选并打开终端:
sudo apt-get update
(如果您在勾选“如果不是”之后出现一个对话框要求您重新加载包列表,则可能不需要这样做)然后执行以下操作:
apt-get source libtiff4-dev
获取 libtiff4 的源代码。