Available Languages: | Deutsch | English | Español | Français | 日本語 (Nihongo) | Português | Русский (Russkiy) | 中文 (简) (Simplified Chinese) |

Fink 常见疑问(F.A.Q.)

这是一个关于 Fink 经常被问到的问题的清单。和多数的 FAQs 一样,其中一些问题来自于实际的问题,而另外一些则是假设存在的。它更接近于一份专门以问答形式编写的文档。

本 FAQ 由几页组成,每部分一页。所有的问题都会在下面的目录中列出并链接到合适的位置。

Contents

1 一般性问题

Q1.1: 什么是 Fink?

A: Fink 希望把越来越多的 Unix 软件带到 Mac OS X,因此它的两个主要目标是:

第一目标是移植软件到 Mac OS X 上。 我们寻找现成的开放源代码的 Unix 软件,并对它做必要的修正以使得它可以在 Mac OS X 上编译和运行。有些时候这很容易,但对一些软件包,也可能很难甚至不可能。 我们试图通过提供一些工具和文档来使它更容易些。

第二目标是使我们的成果能够被普通用户所使用。 为了实现这个目标,我们建立了一个的软件包管理工具。它移植自 Linux 上两个主要的程序 dpkg 和 apt-get,它们原来是为Debian GNU/Linux 项目编写的。 我们的软件包的二进制发行版使用 .deb 软件包格式。 对于从源代码构建软件包,我们使用我们自己的工具,称为 fink,它可以生成 .deb 软件包文件。

Q1.2: Fink 是什么意思?

A: 没有什么特别含义,只是一个名字而已。它也不是什么缩写。

事实上,Fink 在德语中是雀类(属于鸟类)的意思。当我在给这个项目起名的时候,操作系统的名称 Darwin,使我联想到查尔斯·达尔文,Galapagos 群岛和进化论。然后我想起了学校时学过的关于达尔文雀的东西,以及它们尖尖的嘴...

Q1.3: Fink 和 BSD port 机制有什么区别(它被包括在 OpenPackages 和 GNU-Darwin 中)?

A: 一些主要优点:

Q1.4: 为什么 Fink 不安装在 /usr/local?

A: 有几个原因,总括来说是 "可能会被损坏"。

原因一:第三方软件。/usr/local 是存放不是由系统提供的第三方软件的地方。这意味着这是一个放杂七杂八东西的好地方。同时,这也意味着其它人也会放杂七杂八的东西到那里。多数的安装流程只是简单地覆盖那里的东西——对 dpkg 也是这样。当然,用户可以选择不安装第三方软件到 /usr/local。不幸的是,多数的安装程序并不事先告诉你它会安装到哪里。

原因二:/usr/local/bin 在默认的 PATH 设置中。这意味着你的 shell 程序不需要什么其它设置就可以找到你安装的程序。但这意味着如果你不想使用这个程序,你需要进行额外的设置。极端情况下,它会影响系统本身——由需要部分依赖于 shell 脚本。

原因三:编译工具默认搜索 /usr/local 目录。编译器会在 /usr/local/include 寻找头文件,连接器会在 /usr/local/lib 寻找连接库。同样,有些时候这会显得方便些,但在有需要的时候会很难禁用这个特性。通过把一个错误的 stdio.h 文件放到 /usr/local/include 目录中,你就很容易使得编译器出错。

总的来说,把 Fink 安装到 /usr/local 是可能的。安装程序会明确警告你,但如果你确认你同意这样做的风险,它会按你的要求去做。

Q1.5: 为什么选择 /opt/sw?

A: 这个选择基本上是很随意的,但是基于实践(升级)的理由以及它在避免于其它软件包系统冲突方面是足够安全的,在可以遇见的将来仍然会保持这样。

2 与其它项目的关系

Q2.1: 你是否会把你的补丁反馈给上游维护者?

A: 我们正在尝试这么做。 有些时候反馈补丁是很容易的,在下一个版本出来以后会皆大欢喜。 不幸的是对于多数软件包并不那么容易。 一些常见的原因:

Q2.2: 你们和 Debian 项目的关系是什么?你们在把 Debian Linux 移植到 Mac OS X 上吗?

A: Fink 和 Debian 之间没有正式的关系。 Fink 不是 Debian GNU/Linux 发布版的一个移植。 我们的确移植了 Debian 的软件包管理工具(dpkg,dselect,apt-get),并使用这些工具以及 .deb 二进制包的格式。 实际的软件包是针对 Mac OS X / Darwin 进行了修正,并不使用 Debian 原始的包格式。

Q2.3: 你们和苹果公司的关系是什么?

A: 苹果公司了解 Fink 的存在并作为他们开放源码支持的一部分给予过我们一些帮助。 在 2001 年夏秋两季,他们给我们提供了新的 Mac OS X 的预发布版本以希望 Fink 软件包可以在它发布的时候能与它相配合。 引文: "希望这会明确消除对于我们不愿意提供(帮助)的怀疑。我们将在开放源代码的游戏中逐步做得更好。" 感谢你,苹果公司!

Q2.4: 你们和 Darwinports 的关系是什么?

A: Darwinports and Fink are complementary projects. There is some overlap between the two projects, and several people contribute to both the Fink and DarwinPorts projects. For example, Benjamin Reed is doing the KDE packages for both. Darwinports and Fink are free to make use of each other's patches, and we have discussed collaboration on a new dependency engine.

OpenDarwin 尝试用一种不同的方法来重头建立软件包系统。请阅读 OpenDarwin.org 上的声明来获取详细信息。

3 Fink 镜像

Q3.1: 什么是 Fink 镜像?

A: Fink 镜像是一些 rsync 服务器,它镜像保存 Fink 的当前和稳定版本的描述文件。Fink 需要使用这些描述文件来从源代码构建软件包。

Q3.2: 为什么我需要使用 rsync 镜像服务器?

A: Rsync 是一种很快速的协议。它可以用比过去的 CVS 更新方法更快的速度来更新描述文件。另外,CVS 总是通过 sourceforge.net 进行更新,而 rsync 则可以选择离你比较近的镜像服务器进行更新。

Q3.3: 在哪里我可以找到关于 Fink 镜像的更多信息?

A: 所有的 Fink 镜像都建立在 finkmirrors.net 域名之下。http://finkmirrors.net/ 这个网站会提供更多的信息。

Q3.4: 我不能连接 rsync 服务器,我应该怎么办?

A: 有些时候,一些很严格的防火墙规则会进制你访问 rsync 服务。如果是这样的话,简单的办法是使用 CVS 方式。

Q3.5: 我现在已经改换到 rsync 方法,但所有没有用到的代码树都消失了?

A: 这时正常现象。rsync 只会更新活跃的代码树,比方说,10.3。同时它也会删除 CVS 子目录。

Q3.6: 我怎么在这两种方法中切换?

A: 使用 fink selfupdate-rsync 或 fink selfupdate-cvs 来切换到 rsync 或 CVS。

Q3.7: 什么是 Distfiles 镜像?

A: 有些时候从互联网上获取某个版本的源代码会比较困难。Distfile 镜像会保存这些 Fink 需要使用的源代码软件包。

4 升级 Fink (解决特定版本的问题)

Q4.1: Fink doesn't see new packages even after I've run an rsync or cvs selfupdate.

A: This is a current issue for people on OS 10.5 using the binary installer. Check your version:

fink --version

If you currently have fink-0.27.13-41, which is the version that comes with the installer, or fink-0.27.16-41, then there are a couple of options.

Either will bring you the newest fink version.

Q4.2: When I try to install stuff I get 'Can't resolve dependency "fink (>= 0.28.0)"'

A: Apply the fix from the prior entry.

Q4.3: Fink tells me to run 'sudo apt-get install libgettext3-dev=0.14.5-2' to clear up inconsistent dependencies but I'm still stuck.

A: There is a timestamp issue with the libgettext3 package description: 0.14.5-2 is an outdated version. Run

fink index -f
fink update libgettext3-dev	
	

to update the package description cache and then the package.

Q4.4: Fink tells me 'Can't resolve dependency "dpkg (>= 1.10.21-1229)" for package "dpkg-base-files-0.3-1"'. How do I solve this?

A: There is a timestamp issue with the updated dpkg package description. Run

fink index -f
fink selfupdate
	

to update the package description cache and then to install dpkg and dpkg-base-files.

5 安装,使用和维护 Fink

Q5.1: 我怎么知道 Fink 支持那些软件包?

A: 从 Fink 0.2.3 开始,增加了 list 命令。 它产生可用 Fink 安装的软件包清单。 例如:

fink list

如果你使用二进制安装包方式,dselect 可以提供给你一个很好的可用软件包清单。 注意,如果你需要从 dselect 中选择和安装软件包,你需要以 root 权限运行它。

另外,在网站上也有一个软件包数据库

Q5.2: 我在防火墙后面,我怎么配置 Fink 使用 HTTP 代理?

A: fink 命令可以设定代理服务器,并把它传递给 wget/curl。 如果在首次安装的时候没有向你询问代理服务器设置,你可以运行 fink configure 来进行设置。 你可以随时运行这个命令来重新配置 fink 命令。 如果你按照安装指南进行安装,并使用 /opt/sw/bin/init.csh(或 /opt/sw/bin/init.sh),那么 apt-getdselect 也可以使用这些设置。请确认你已经把协议名放在代理服务器域名之前,例如:

ftp://proxy.yoursite.somewhere

如果你仍然碰到问题,那么打开系统预置,选择网络设置面板,确认 "使用被动 FTP 模式 (PASV)" 选项已被选中。

Q5.3: 我在防火墙后面,我怎么用 CVS 方式升级已安装的软件包?

A: cvs-proxy 这个软件包可以通过 HTTP 代理穿透防火墙。

如果 fink 没有被配置为使用你的代理,用下面的方法更改配置:

fink configure.

Q5.4: 我可以在安装后把 fink 移动到其它位置吗?

A: 不行。 当然,你可以用 mv 命令或 Finder 来移动它们,但如果你这样做的话, 99% 的程序将不能工作。 这是引文基本上所有 Unix 软件都是使用固定编码在程序中的路径名来寻找数据文件,库或其它东西的》

Q5.5: 如果我安装 Fink 以后把它移动到其它地方,但在原来的地方提供一个符号连接,可以吗?

A: 也许。 通常的猜测这应该可行,但也许会有些陷阱在某些地方。

Q5.6: 我怎么彻底反安装 Fink?

A: Fink 的所有文件几乎都安装在 /opt/sw (或你选择安装的地方)。因此,如果你想删除 Fink,输入下面的命令:

sudo rm -rf /opt/sw

这个规则的唯一例外是 XFree86。如果你通过 Fink 安装(也就是说,你安装了 xfree86, 或 xfree86-rootlessxorg 软件包, 而不是使用 system-xfree86)并希望删除它,你需要再输入:

sudo rm -rf /usr/X11R6 /etc/X11 /Applications/XDarwin.app

如果你不是打算重安装 Fink 的话,根据你的配置方式你还要使用一个纯文本编辑器,从你的 .cshrc 文件中删除 "source /opt/sw/bin/init.csh" 这一行;或从 .bashrc 文件中删除 "source /opt/sw/bin/init.sh" 这一行。

Q5.7: 网站上的软件包数据库列有 xxx 软件包,但 apt-get 和 dselect 则没有任何显示。哪个有问题?

A: 都正确。 软件包数据 知道每一个软件包,包括那些仍处于不稳定阶段的。 dselectapt-get 工具则只知道那些可用的经过预编译的二进制软件包。 许多软件包因为各种原因所以没有提供预编译的二进制版本。 软件包必须处于开发末期的 "稳定" 状态,而且必须通过额外的授权和专利限制审查以后才会考虑发布二进制安装版本。

如果你希望安装不存在于 dselect / apt-get 中的软件包,你需要使用 fink install 软件包名 来从源代码安装。 在你尝试之前,确认你已经安装了开发工具(如果在你的 /Applications 文件夹中没有安装开发工具,你可以从 Apple Developer Connection 经过免费注册以后下载) 请同时查看下面关于未稳定版本的问题。

Q5.8: 我想安装一个未稳定版本,但 fink 说 'no package found'。我怎么才能安装它?

A: First make sure you understand what 'unstable' means. Packages in the unstable tree are not in stable for any number of reasons. It could be because there are known issues, validation errors, or just not enough people giving feedback that the package works for them. For that reason, Fink doesn't search the unstable tree by default.

If you do enable unstable, please remember to e-mail the maintainer if something works (or even if it doesn't). Feedback from users like you is what we use to determine if something is ready for stable! To find out the maintainer of a package, run fink info packagename.

For fink-0.26 and later: If you run fink configure one of the questions will ask whether you want to turn the unstable trees on.

To configure Fink to use unstable when you have an earlier version of the fink tool than 0.26, edit /opt/sw/etc/fink.conf, and add unstable/main and unstable/crypto to the Trees: line.

If you use Fink Commander, then there is a Preference to use unstable packages.

None of these options actually download the unstable tree's package descriptions.You'll need to turn on rsync or cvs updating to do this, which is not set up by default on a new Fink installation. The following command sequence will set you up on a new Fink installation:

fink selfupdate

followed by

fink selfupdate-rsync

or

fink selfupdate-cvs

and then

fink index -f
fink scanpackages

Note: There are Fink Commander analogs for everything except fink index -f. You will have to use the command line for that.

If you're already set up with rsync or cvs updating, then the following command sequence (or the Fink Commander analogs) will suffice:

fink selfupdate
fink index
fink scanpackages
	

If you're not sure what your update method is, check fink --version in at a command line and see if that mentions cvs or rsync.

If you don't want to install any more from unstable than your specific package(s) and its (their) dependencies, (and any base packages that got updated) don't use the update-all command until you turn the unstable tree back off.

Q5.9: Do I really need to enable all of unstable just to install one unstable package that I want?

A: No, but it is highly recommended you do. Mixing and matching can cause unforseen issues that make it difficult to debug problems when they do arise.

That said, if you only want one or two specific packages, and nothing else from unstable, then you need to switch over to CVS updating (i.e. use fink selfupdate-cvs), because rsync only updates the trees that are active in your fink.conf. Edit /opt/sw/etc/fink.conf and add local/main to the Trees: line, if not present. Then you'll need to run fink selfupdate to download the package description files. Now copy the relevant .info files (and their associated .patch files, if there are any) from /opt/sw/fink/dists/unstable/main/finkinfo (or /opt/sw/fink/dists/unstable/crypto/finkinfo) to /opt/sw/fink/dists/local/main/finkinfo. However, note that your package may depend on other packages (or particular versions) which are also only in unstable. You will have to move their .info and .patch files as well. After you move all of the files, make sure to run fink index, so that Fink's record of available packages is updated. Once you're done you can switch back to rsync (fink selfupdate-rsync) if you want.

Q5.10: 每次运行 sudo 都要输入密码,这很麻烦。有办法解决吗?

A: 你可以配制 sudo 不需要询问你密码。用 root 权限运行 visudo 命令,并添加一行:

username ALL =(ALL) NOPASSWD: ALL

username 替换为实际的用户名。这一行使得你可以运行 sudo 命令而不需要输入密码。

Q5.11: 当我尝试运行 init.csh 或 init.sh 时,我碰到一个 "Permission denied" 错误。我做错了什么?

A: init.csh 和 init.sh 并不能象普通命令一样运行。这些文件会设置象 PATH 和 MANPATH 这样的环境变量到你的 shell 程序中。要对 shell 一直起作用的话,对于 csh/tcsh,它需要由一个 source 命令来运行;或对于 bash/zsh,使用" . "命令,象这样:

对 csh/tcsh:

source /opt/sw/bin/init.csh

或对 bash/zsh:

. /opt/sw/bin/init.sh

Q5.12: 救命!我选择了 dselect 的 "[A]ccess" 菜单,现在我不能下载软件包了!

A: 你也许把 apt 指向了一个 Debian 的镜像服务器,当然那里没有任何 Fink 文件。 你可以手工或通过 dselect 来修复。 要手工修复,使用 root 权限用纯文本编辑器编辑 /opt/sw/etc/apt/sources.list 文件。删除包含 debian.org 的行,并换成:

deb http://us.dl.sourceforge.net/fink/direct_download release main crypto
deb http://us.dl.sourceforge.net/fink/direct_download current main crypto

(或如果你居住在欧洲,你可以使用 eu.dl.sourceforge.net 来代替 us.dl.sourceforge.net)。

要用 dselect 来修复它,再次运行 "[A]ccess",选择 "apt" 方法并输入下面的信息:

URL: http://us.dl.sourceforge.net/fink/direct_download - Distribution: release - Components: main crypto

然后,如果你希望添加其它来源,你可以重复上面的过程,并用 "current" 来代替 "release"。

一个 apt 软件包修正版(提供了配制脚本作为 dselect 的插件)可以通过 CVS 获得。

Q5.13: 当我试图运行 fink selfupdate 或 "fink selfupdate-cvs" 时,我碰到了 "Updating using CVS failed. Check the error messages above."这个错误信息。

A: 如果错误信息是:

Can't exec "cvs": No such file or directory at 
/opt/sw/lib/perl5/Fink/Services.pm line 216, <STDIN> line 3.
### execution of cvs failed, exit code -1

那么你需要安装开发工具包。

如果最后一行是:

### execution of su failed, exit code 1

你需要往前查看以前输出的错误信息。如果你看到一个信息说你的连接被拒绝:

(Logging in to anonymous@fink.cvs.sourceforge.net)
CVS password:
cvs [login aborted]: connect to fink.cvs.sourceforge.net:2401 failed:
Connection refused
### execution of su failed, exit code 1
Failed: Logging into the CVS server for anonymous read-only access failed.

或者象下面的信息:

cvs [update aborted]: recv() from server fink.cvs.sourceforge.net: 
Connection reset by peer
### execution of su failed, exit code 1
Failed: Updating using CVS failed. Check the error messages above.

或者:

cvs [update aborted]: End of file received from server

或者:

cvs [update aborted]: received broken pipe signal

那么很象是 cvs 服务器现在过忙,你应该晚些在尝试更新。

另一个可能是你的 CVS 目录的权限设置有问题,这时会有 "Permission denied" 信息:

cvs update: in directory 10.2/stable/main:
cvs update: cannot open CVS/Entries for reading: No such file or directory
cvs server: Updating 10.2/stable/main
cvs update: cannot write 10.2/stable/main/.cvsignore: Permission denied
cvs [update aborted]: cannot make directory 10.2/stable/main/finkinfo: No such file or directory
### execution of su failed, exit code 1
Failed: Updating using CVS failed. Check the error messages above.

这时你需要重置你的 CVS 目录。使用命令:

sudo find /opt/sw/fink -type d -name 'CVS' -exec rm -rf {} \;
fink selfupdate-cvs

如果你看不到上面这些错误信息,那么很可能是你自己修改过 /opt/sw/fink/dists 树里面的文件,而现在维护者又改动了它。查看以前的 selfupdate-cvs 输出,寻找以 "C" 开始的行,象这样:

C 10.2/unstable/main/finkinfo/libs/db31-3.1.17-6.info
...
(other info and patch files)
...
### execution of su failed, exit code 1
Failed: Updating using CVS failed. Check the error messages above.

"C" 指 CVS 在更新最新版本的时候出现冲突。

解决办法是删除在 selfupdate-cvs 命令的输出中 "C" 开头的错误信息所涉及的文件,然后重新试一次。

sudo rm /opt/sw/fink/10.2/unstable/main/finkinfo/libs/db31-3.1.17-6.info
fink selfupdate-cvs

If you get errors that mention cvs.sourceforge.net:

cvs [update aborted]: connect to cvs.sourceforge.net(66.35.250.207):
2401 failed: Operation timed out

this is because of a restructuring of the CVS servers at sourceforge.net in 2006. Fink files are now at fink.cvs.sourceforge.net.

Check your Distribution version, e.g. via

fink --version

If that shows 10.4-transitional, then you need to update to the regular 10.4 distribution. An update script has been created to assist with that.

Q5.14: 当我使用 Fink 的时候,碰到整个机器没有反应/核心恐慌/死机。救命!

A: 200年秋、 fink 用户邮件列表 中有不少关于这个问题的反映(包括核心恐慌和不断旋转的彩轮),这通常在安装有防病毒软件的机器上编译软件包时发生。也许在使用 Fink 之前你应该关闭所有防病毒软件。

Q5.15: 我试图安装一个软件包,但 Fink 不能下载它。下载的网站显示一个比 Fink 里面更新的版本号。我该怎么办?

A: 当新版本发布的时候,源程序包会被从上游网站移走。

首先你应该做的是运行 fink selfupdate。 也许软件包的维护者已经修正了这一点,你获得一个包含最新版本或更新过下载网址的软件包描述。

如果这个办法不奏效,多数的源程序包可以在 http://distfiles.master.finkmirrors.net/ 下载到(感谢 Rob Braun),你可以运行 fink configure 来选择搜索 "Master" 源程序镜像,这样 Fink 就会自动在那里寻找。

如果这还不奏效,请通知程序包维护者(可以通过 "fink describe 软件包名 " 获得)) 下载链接已经失效;并不是所有维护者总是阅读邮件列表的消息的。

要获得一个可用的源程序包,首先尝试在原来的站点的其它目录寻找 Fink 所要的相同版本文件(例如,在一个名为 "old" 的目录里面)。记住,虽然一些站点可能已经扔掉了旧版本的软件包。但是如果官方站点上找不到的话,你可以尝试一个互联网上的搜索——仍然会有一些非官方的站点保存有你所需要的压缩档。另外一个寻找的地方是 http://us.dl.sourceforge.net/fink/direct_download/source/,这是 Fink 存放它们已经以二进制发布过的软件包的源文件的地方。如果这些都不成功,你可以考虑在 fink 用户邮件列表 里面发信询问是否有人会有旧的源代码压缩档可以给你。

一旦你找到合适的源程序压缩档,手工下载它,然后把它移到 Fink 的源程序文件目录里面(对默认安装,可以使用 "sudo mv package-source.tar.gz /opt/sw/src/"命令)。然后和平常一样用 'fink install 软件包名 ' 安装。

如果你没有办法找到源程序文件,那么你只能等待维护者来处理这个问题。它们可能会发布一个到旧源文件的链接,或升级 .info 和 .patch 文件来使用新的版本。

Q5.16: 当我运行 Fink 或我用 Fink 安装的东西的时候,我碰到一个 "command not found" 错误。

A: If this always happens, then you may have inadvertently modified (or failed to modify) your startup scripts. Run the /opt/sw/bin/pathsetup.sh script in a terminal window. This program will attempt to detect your default shell and add a command to load Fink's shell initialization script into your shell's configuration. You'll then need to open a new terminal session so that your environment settings are loaded. Note: Some older versions fink called this script pathsetup.command instead of pathsetup.sh. Alternately, you can run the pathsetup.app application on the Fink binary distribution disk image.

On the other hand, if you only have problems in the Apple X11 terminal, the easy solution is to modify the "Terminal" entry in the X11 Application menu via the Applications->Customize Menu... option. Instead of just

xterm

change the command field to read

xterm -ls

ls here means login shell, and the result is that your full login setup gets used (just like the OS X Terminal).

These /opt/sw/bin/init.* scripts do much more than just add /opt/sw/bin to your PATH. Many packages will not work correctly without these additional actions.

Q5.17: 我希望在 Finder 里面隐藏 /opt/sw 而避免用户破坏 Fink 的设置。

A: 如果你安装了开发工具包,你可以做到这一点。你可以运行下面的命令:

sudo /Developer/Tools/SetFile -a V /opt/sw

这会使得 /opt/sw 象其它标准系统文件夹一样(比如 /usr),在 Finder 中不可见。如果你没有开发工具包,也有其它第三方程序可以让你修改文件属性-你需要把 /opt/sw 设为隐藏。

Q5.18: 我不能安装任何软件,因为我碰到下面的错误信息:"install-info: unrecognized option `--infodir=/opt/sw/share/info'"。

A: 这通常是由于你的 PATH 环境变量的原因。在终端窗口输入:

printenv PATH

如果输出里面没有 /opt/sw/sbin,那么你需要按照用户指南中的方法来设置你的环境变量。如果有 /opt/sw/sbin,但有其它目录在它前面(比如 /usr/local/bin),那么你要么需要重新安排你 PATH 里面的顺序,使得 /opt/sw/sbin 排在前面。或者如果你的确需要把其它目录放在 /opt/sw/sbin 之前,而且这个放在前面的目录包括另一个 install-info 目录,这时也许你需要在使用 Fink 的时候临时重命名这个 install-info 子目录。

Q5.19: 我不能安装或删除任何东西,因为一个 "files list file" 问题。

A: 通常这些错误的形式是:

files list file for package 软件包名 contains empty filename

files list file for package 软件包名 is missing final newline

这可以通过一点小小的工作而修复。如果你在系统里面有发生问题的这个软件包的 .deb 文件,用下面命令检查它的完整性:

dpkg --contents deb文件的完整路径
        

例如

dpkg --contents /opt/sw/fink/debs/libgnomeui2-dev_2.0.6-2_darwin-powerpc.deb

如果你获得了一列目录和文件,那么你的 .deb 是正确的。如果输出是目录和文件以外的其它东西,或者你没有 .deb 文件,你仍然可以继续操作,因为这个错误不会影响构建。

如果你是从二进制包进行安装或你肯定知道二进制包里面的版本和你已经安装的版本一致(比如,通过检查软件包数据库),你可以用下面的办法获取一个 .deb 文件: sudo apt-get install --reinstall --download-only 软件包名 。否则你也可以用下面的办法自己从源代码重新构建一个:fink rebuild 软件包名 ,但它暂时还不能安装。

一旦你有了一个正常的 .deb 文件,你可以重新安装文件。首先用下面的命令成为 root 用户:sudo -s(有需要的话,输入你的管理员密码),然后使用下面的命令(我们把它分行以方便阅读,但实际使用的时候,你应该在一行里面输入):

dpkg -c deb文件的完整路径
  | awk '{if ($6 == "./"){ print "/."; } else if (substr($6, length($6), 1) == "/")
    {print substr($6, 2, length($6) - 2); } else { print substr($6, 2, length($6) - 1);}}' 
  > /opt/sw/var/lib/dpkg/info/软件包名.list

例如:

dpkg -c /opt/sw/fink/debs/libgnomeui2-dev_2.0.6-2_darwin-powerpc.deb
  | awk '{if ($6 == "./") { print "/."; } else if (substr($6, length($6), 1) == "/")
   {print substr($6, 2, length($6) - 2); } else { print substr($6, 2, length($6) - 1);}}'
  > /opt/sw/var/lib/dpkg/info/libgnomeui2-dev.list

这里做的事情是抽取 .deb 文件的内容,删掉除文件名以外的所有信息,并把文件名信息写回到 .list 文件中。

Q5.20: 当我在 dselect 中选择软件包时,屏幕显示一堆乱七八糟的东西。怎么办?

A:dselect 和 终端程序(Terminal.app)中间存在一些问题。暂时解决方法是在运行 dselect 前输入下面的命令。

对 tcsh 用户:

setenv TERM xterm-color

对 bash 用户:

export TERM=xterm-color

你可以把它放到你的启动文件(比如 .cshrc.profile),这样它就总是会自动运行。

Q5.21: 我看不到要升级的 Fink 版本。

A: 在这种情况下,参考特别指引

Q5.22: 我可以把 Fink 放到一个名字里面有空格的目录或宗卷里面吗?

A: 我们不推荐把你的 Fink 目录树放到名字中有空格的目录里面。完全不值得冒这个险。

Q5.23: 当我进行二进制升级的时候,有很多 "File not found" 和 "Couldn't stat package source list file" 错误。

A: 如果你看到这样的错误:

Err file: local/main Packages
  File not found
Ign file: local/main Release
Err file: stable/main Packages
  File not found
Ign file: stable/main Release
Err file: stable/crypto Packages
  File not found
Ign file: stable/crypto Release
...
Failed to fetch
file:/opt/sw/fink/dists/local/main/binary-darwin-powerpc/Packages
File not found
Failed to fetch
file:/opt/sw/fink/dists/stable/main/binary-darwin-powerpc/Packages
File not found
Failed to fetch
file:/opt/sw/fink/dists/stable/crypto/binary-darwin-powerpc/Packages
File not found
Reading Package Lists... Done
Building Dependency Tree... Done
E: Some index files failed to download, they have been ignored, or old
ones used instead.

update available list script returned error exit status 1.

W: Couldn't stat source package list file: unstable/main Packages
(/opt/sw/var/lib/apt/lists/_sw_fink_dists_unstable_main_binary-darwin-
powerpc_Packages) - stat (2 No such file or directory)

那么你需要做的是运行 fink scanpackages。这会生成那些找不到的文件。

Q5.24: 我改变了系统,但 Fink 没有认出这些改动。

A: 在改动 Fink 的安装环境(源代码或二进制安装都是它的子集),需要告诉 Fink 发生了这些变动。要这样做,我们要运行一个通常是在首次安装的时候才运行的脚本:

/opt/sw/lib/fink/postinstall.pl

运行完这个脚本以后,Fink 应该能够适应改动的结果。

Q5.25: After installing a macOS update, Fink no longer recognizes my installed Command Line Tools.

A: Updates to macOS routinely break parts of Apple's Command Line Tools. If you get this error after updating your copy of macOS:

Can't resolve dependency "xcode (>= 6.2)"

Fink has lost track of Apple's Command Line Tools.

The easiest solution is to download and reinstall the Command Line Tools specific to your macOS version from https://developer.apple.com/.

Another possible solution is to run the following command:

xcode-select --install

but this often reports the following:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

However, the Tools might be in a non-functional state such that Fink still can't recognize them. In that case, a clean reinstall as described above has always worked to fix their detection with Fink.

Finally, you may need to run the command:

sudo xcodebuild -license

to agree to the software license.

Q5.26: 当我运行 fileutils 中的 gzipdpkg-deb 程序时出现错误!救命!

A: 出错的形式:

gzip -dc /opt/sw/src/dpkg-1.10.9.tar.gz | /opt/sw/bin/tar -xf -
### execution of gzip failed, exit code 139

gzip -dc /opt/sw/src/aquaterm-0.3.0a.tar.gz | /opt/sw/bin/tar -xf -
gzip: stdout: Broken pipe
### execution of gzip failed, exit code 138

dpkg-deb -b root-base-files-1.9.0-1
/opt/sw/fink/dists/unstable/main/binary-darwin-powerpc/base
### execution of dpkg-deb failed, exit code 1
Failed: can't create package base-files_1.9.0-1_darwin-powerpc.deb

或在运行 fileutils 中的工具时出现 segmentation faults 错误。比如:lsmv,这很可能时因为某个库的预绑定错误,这可以通过运行下面命令来修正:

sudo /opt/sw/var/lib/fink/prebound/update-package-prebinding.pl -f

Q5.27: 当我打开终端程序窗口时,我看到下面的信息 "Your environment seems to be correctly set up for Fink already.",然后它就退出登录了。

A: 发生这个现象的原因是 OS X 的终端程序被告知每次登录的时候需要运行 /opt/sw/bin/pathsetup.command 命令。你可以通过删除下面的文件 ~/Library/Preferences/com.apple.Terminal.plist 来修正这一点。

如果这个配置文件里面有你需要保留的配置信息(所以你不能删除它),你可以用纯文本编辑器来编辑它,删除包含 /opt/sw/bin/pathsetup.command 的一行。

Q5.28: 我把 Fink 安装到主分区之外的地方,然后我不能从源代码更新 fink 软件包了。现在出现类似 chowname 的错误。

A: 如果你的错误信息是象这样的:

This first test is designed to die, so please ignore the error
message on the next line.
# Looks like your test died before it could output anything.
./00compile............................ok
./Base/initialize......................ok
./Base/param...........................ok
./Base/param_boolean...................ok
./Command/cat..........................ok
./Command/chowname.....................#     
Failed test (./Command/chowname.t at line 27)
#          got: 'root'
#     expected: 'nobody'

那么你需要在 Fink 安装的驱动器/分区上运行 Get Info,并取消选择 "Ignore ownership" 的按钮。

Q5.29: Fink won't update my packages because it says it can't find the 'gnu' mirror.

A: If you get an error that ends with

Failed: No mirror site list file found for mirror 'gnu'.

then most likely you need to update the fink-mirrors package, e.g. via:

fink install fink-mirrors

Q5.30: I can't update Fink, because it can't move /opt/sw/fink out of the way.

A: This error:

Failed: Can't move "/opt/sw/fink" out of the way.

is usually due, in spite of what it says, to permissions errors in one of the temporary directories that get created during a selfupdate. Remove these:

sudo rm -rf /opt/sw/fink.tmp /opt/sw/fink.old

Q5.31: I get a message that says "No fonts found".

A: If you see the following (so far only seen on OS 10.4):

No fonts found; this probably means that the fontconfig
library is not correctly configured. You may need to
edit the fonts.conf configuration file. More information
about fontconfig can be found in the fontconfig(3) manual
page and on http://fontconfig.org.

then you can fix it by running

sudo fc-cache

Q5.32: I can't install Fink via the Installer package, because I get "volume doesn't support symlinks" errors.

A: This message commonly means that you've tried to run the Fink installer as user who doesn't have administrative privileges. Make sure to log in at the login screen as such a user or switch to such a user in the Finder (i.e. fast user switching) before starting the Fink installer.

If you're having trouble even when using an admin account, then it's likely a problem with the permissions on your top-level directory. Use Apple's Disk Utility (from the Utilities sub-folder in your Applications folder), select the hard drive in question, choose the First Aid tab, and press Repair Disk Permissions. If that doesn't work, then you may need to set your permissions manually via:

sudo chmod 1775 /	  
	

Q5.33: I can't update Fink, because package architecture (darwin-i386) does not match system (darwin-powerpc).

A: This error occurs if you use a PowerPC installer package on an Intel machine. You'll need to flush your Fink installation, e.g.:

sudo rm -rf /opt/sw

and then download the disk image for Intel machines from the downloads page.

6 一般性编译问题

Q6.1: 一个配置脚本出错说找不到一个 "acceptable cc"。什么意思?

A: 下次应该阅读一下文档。 要从源代码编译软件包,你需要安装开发工具包,其中就包括 C 编译器:cc

Q6.2: 我运行 "fink selfupdate-cvs",但出现这个错误:"cvs: Command not found."。

A: 你需要安装开发工具包。

Q6.3: 我碰到一个涉及 make 的错误。

A: 如果错误信息是这种形式

make: command not found

Can't exec "make": No such file or directory at /opt/sw/lib/perl5/Fink/Services.pm line 190.

它表示你需要安装开发工具。

如果你的错误信息是这样的

make: illegal option -- C

那是因为你把开发工具包里面 GNU 版本的 make 工具换成了 BSD 版本。许多软件包依赖于 GNU Make 的特有功能。 确定 /usr/bin/make 是一个指向 gnumake的符号链接,而不是指向 bsdmake。另外,确定 /usr/local/bin/ 中没有另外一个 make

Q6.4: 我碰到 head 命令的一个奇怪的错误信息。什么出问题了?

A: 如果你看到的是:

Unknown option: 1
Usage: head [-options] <url>...

后面是一列选项描述,你的 head 程序被损坏了。 这会在你安装 Perl 的 libwww 库到一个 HFS+ 系统宗卷时发生。 原因是它会建立一个新的命令 /usr/bin/HEAD,它会覆盖现存的 head 命令,因为 HFS+ 是不区分大小写的。 head 是一个在许多 shell 脚本和 Makefiles 中用到的标准命令。 如果你想使用 Fink,你需要装回原来的 head 程序。

现在源代码发布版的 bootstrap 脚本会检查这一点,但你仍然会碰到这个问题,如果你使用二进制安装或在安装 Fink 以后又安装 libwww。

也曾经有报告说发生这个问题是因为安装了 /opt/sw/bin/HEAD(这不是 Fink 软件包安装的)。这种情况很容易解决:重命名 /opt/sw/bin/HEAD

Q6.5: 当我安装一个软件包的时候,我碰到一个错误信息说我试图覆盖另外一个软件包的文件。

A: 当你安装那些具有版本分支的软件包(也就是那些名字末尾有 -dev,-shlibs,等的)时,如果需要有些文件从一个版本分支移动到另一个版本分支(例如,从 foofoo-shlibs)的时候,你就会碰到这个错误。你可以做的是使用你现在安装的版本来覆盖旧有的版本(因为他们通常是相同的):

sudo dpkg -i --force-overwrite 文件名
        

这里文件名 filename 是对应于你要安装的软件包的 .deb 文件名称。

Q6.6: 当我构建一个软件包时,"execution of mv failed, exit code 1" 错误是什么意思?

A: 如果你安装了 StuffIt Pro,这可能是因为你使用了 "Archive Via Real Name" 模式。在系统预置中检查 StuffIt 面板,禁用 "ArchiveViaRealName"。它包括对一些重要的系统调用的不正确的替代,从而引起一些古怪的错误。

否则,一个 mv 错误通常意味着构建过程更早期发生了错误,但是构建过程并没有因为那个错误而终止。要找到发生的问题的文件,可以搜索那个不存在文件构建时候的输出。比如,如果你碰到这样的错误:

mv /opt/sw/src/root-foo-0.1.2-3/opt/sw/lib/libbar*.dylib \
 /opt/sw/src/root-foo-shlibs-0.1.2-3/opt/sw/lib/
 mv: cannot stat `/opt/sw/src/root-foo-0.1.2-3/opt/sw/lib/libbar*.dylib': 
 No such file or directory
### execution of mv failed, exit code 1
Failed: installing foo-0.1.2-3 failed

那么你应该在你构建输出信息的更前面的地方寻找有关 libbar 的信息。

Q6.7: 我无法安装软件包或更新它,因为我碰到一个错误说一个 "node" 已经存在。

A: 这个错误的大约是这个样子的:

Failed: Internal error: node for system-xfree86 already exists

这个问题是因为依赖关系引擎发生了混乱,原因是修改了某些软件包的 info 文件。要修正它:

Q6.8: 我听说安装在 /usr/local/lib 的库有时会引起 Fink 构建的问题。是这样吗?

A: This is a frequent source of problems, because the package configuration script finds headers and libraries in /usr/local and decides to use them rather than using those in the Fink path. If you are having problems with a build that aren't covered by another FAQ entry, you should check whether you have libraries in /usr/local/lib or headers in /usr/local/include. If so, then try renaming /usr/local to something else, e.g.:

sudo mv /usr/local /usr/local.moved

完成你的构建,然后把 /usr/local 改回来:

sudo mv /usr/local.moved /usr/local

Starting with macOS 10.14, it's sometimes not possible to rename /usr/local. If you get an error when renaming /usr/local directly, then rename the subdirectories inside it instead:

        sudo mv /usr/local/include /usr/local/include.moved
        sudo mv /usr/local/lib /usr/local/lib.moved
        

do your build, and then you can put /usr/local/include and /usr/local/lib back:

        sudo mv /usr/local/include.moved /usr/local/include
        sudo mv /usr/local/lib.moved /usr/local/lib
        

Q6.9: 当我构建一个软件包的时候,我碰到一个消息说 "table of contents" 已经过时。我需要怎么办?

A: 输出已经提示了该怎么办。消息通常是这样的:

ld: table of contents for archive: /opt/sw/lib/libintl.a is out of date; rerun ranlib(1) (can't load from it)

你需要(以 root 权限)运行 ranlib 处理引起问题的库。例如对上面的情况,你可以运行:

sudo ranlib /opt/sw/lib/libintl.a

Q6.10: 当我安装 atlas 时 Fink Commander 挂了。

A: 这原因时在构建 atlas 时,Fink Commander 遗漏了一个发向用户要求选择的信息。你需要使用 fink install atlas 命令来安装。

Q6.11: I get messages saying that I'm missing stddef.h | wchar.h | stdlib.h | crt1.o, or that my C compiler cannot create executables.

A: Both of these problems are typically due to the absence of essential headers that are provided by the DevSDK package of the Developer Tools. Check whether /Library/Receipts/DevSDK.pkg exists on your system. If not, then run the Dev Tools Installer again, and install the DevSDK package using a Custom Install.

The cannot create executables error can also occur when your Developer Tools version is for an earlier OS version.

Q6.12: 我无法升级,因为 Fink "unable to resolve version conflict on multiple dependencies"。

A: 要回避这个问题,尝试升级一个单独的软件包,然后再次尝试使用 "fink update-all"。如果你还碰到这个信息,重复这个过程。

Q6.13: 我不能安装任何东西,因为我碰到 "dpkg: parse error, in file `/opt/sw/var/lib/dpkg/status'" 错误!

A: This means that somehow your dpkg database got damaged, usually from a crash or some other unrecoverable error. This most often occurs with a buildlock, e.g:

package `fink-buildlock-foo-1.2.3-4':  missing version

(of course, replace foo-1.2.3-4 with the package name you are seeing).

When this happens, you should edit /opt/sw/var/lib/dpkg/status as a superuser. Then go near the line number which shows up in the error message. You should see a fink-buildlock-foo-1.2.3-4 package whose Status field is marked

install ok installed

Change that to

purge ok not-installed

Under other circumstances, there may be garbage in the file. You can fix this situation by copying the previous version of the database, like so:

sudo cp /opt/sw/var/lib/dpkg/status-old /opt/sw/var/lib/dpkg/status

You may need to re-install the last couple of packages you installed before the problem started occurring.

Q6.14: 我碰到一个涉及 freetype 的错误。

A: 这个错误有几种形式。If you get the following:

/usr/bin/ld: can't locate file for: -lfreetype

check whether you have an extraneous freetype-config excutable by running

where freetype-config

if you're using tcsh, or

type -a freetype-config

if you're using bash. The Mono Framework has been known to install a /usr/bin/freetype-config that is a symbolic link to a file in that framework.

如果你的错误是这样的:

/opt/sw/include/pango-1.0/pango/pangoft2.h:52: error: parse error before '*' token
/opt/sw/include/pango-1.0/pango/pangoft2.h:57: error: parse error before '*' token
/opt/sw/include/pango-1.0/pango/pangoft2.h:61: error: parse error before '*' token
/opt/sw/include/pango-1.0/pango/pangoft2.h:86: error: parse error before "pango_ft2_font_get_face"
/opt/sw/include/pango-1.0/pango/pangoft2.h:86: warning: data definition has no type or storage class
make[2]: *** [rsvg-gz.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2
### execution of make failed, exit code 2
Failed: compiling librsvg2-2.4.0-3 failed

In file included from vteft2.c:32:
vteglyph.h:64: error: parse error before "FT_Library"
vteglyph.h:64: warning: no semicolon at end of struct or union
vteft2.c: In function `_vte_ft2_get_text_width':
vteft2.c:236: error: dereferencing pointer to incomplete type
vteft2.c: In function `_vte_ft2_get_text_height':
vteft2.c:244: error: dereferencing pointer to incomplete type
vteft2.c: In function `_vte_ft2_get_text_ascent':
vteft2.c:252: error: dereferencing pointer to incomplete type
vteft2.c: In function `_vte_ft2_draw_text':
vteft2.c:294: error: dereferencing pointer to incomplete type
vteft2.c:295: error: dereferencing pointer to incomplete type
make[2]: *** [vteft2.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
### execution of make failed, exit code 2
Failed: compiling vte-0.11.10-3 failed

checking for freetype-config... /usr/X11R6/bin/freetype-config
checking For sufficiently new FreeType (at least 2.0.1)... no
configure: error: pangoxft Pango backend found but did not find freetype libraries
make: *** No targets specified and no makefile found.  Stop.
### execution of LD_TWOLEVEL_NAMESPACE=1 failed, exit code 2
Failed: compiling gtk+2-2.2.4-2 failed

问题发生在 freetypefreetype-hinting 软件包的头文件和包含在 X11 或 XFree86 中的 freetype2 头文件之间发生混淆。

fink remove freetype freetype-hinting

命令可以删除你安装的(导致问题的)变种。如果你的错误是这样的:

ld: Undefined symbols:
_FT_Access_Frame 

这通常是用于以前安装的 X11 的残余文件。你需要重新安装 X11 SDK。

Q6.15: 我碰到一个涉及 `Dl_info' 的编译错误。

A: 如果你的错误是这样的

unix_dl.c: In function `rep_open_dl_library':
unix_dl.c:328: warning: assignment discards qualifiers from pointer target type
unix_dl.c: In function `rep_find_c_symbol':
unix_dl.c:466: error: `Dl_info' undeclared (first use in this function)
unix_dl.c:466: error: (Each undeclared identifier is reported only once
unix_dl.c:466: error: for each function it appears in.)
unix_dl.c:466: error: parse error before "info"
unix_dl.c:467: error: `info' undeclared (first use in this function)
make[1]: *** [unix_dl.lo] Error 1

最可能是你有这样的一个头文件:/usr/local/include/dlfcn.h,它和 Panther 不兼容。

这一般是由 Open Office 所安装的,你应该通过符号链接把这个头文件和对应的 /usr/local/lib/libdl.dylib 库指向 Panther 的内置文件

sudo ln -s /usr/include/dlfcn.h /usr/local/include/dlfcn.h
sudo ln -s /usr/lib/libdl.dylib /usr/local/lib/libdl.dylib

Q6.16: Fink says I'm missing gcc2 or gcc3.1 but I can't seem to install it.

A: This is because gcc2 and gcc3.1 are virtual packages to indicate the presence of gcc-2.95 and gcc-3.1, respectively, on your system. Install the gcc2.95 and/or the gcc3.1 package from the XCode Tools (earlier OS versions have gcc-2.95 and gcc-3.1 as part of their main Developer Tools installation).

Note: Installing gcc2.95 and/or gcc3.1 will not interfere with your gcc3.3 compiler--they can all coexist.

Q6.17: Fink 提示说 Failed: Can't resolve dependency "system-java14-dev",但我却找不到有这个软件包。

A: 这是因为它是一个虚拟软件包。 这类错误在 Java 通过软件更新升级后造成的: 有关的头问题被删除了,引起不能生成 -dev 软件包。

你需要自己从苹果网站下载相应的Java 开发工具软件包。在本例的情况中,你需要Java 1.4.2 Developer Tools

Q6.18: 当我尝试安装东西的时候,我碰到 dpkg (subprocess): failed to exec dpkg-split to see if it's part of a multiparter: No such file or directory 这样的错误。我怎么修复它?

A: 通常来说,这可以通过正确设置你的环境变量来修复。参考 这个 FAQ 条目

Q6.19: 我碰到这个 configure: error: XML::Parser perl module is required for intltool 错误信息。我应该怎么办?

A: You need to make sure that you have the right variant of the xml-parser-pm package to match the Perl version for your system. For example, if you're on Panther you should have xml-parser-pm581 rather than xml-parser-pm560 (you may also have the xml-parser-pm placeholder), since you have Perl-5.8.1 rather than Perl-5.6.0. If you're on Jaguar, and are using the default system Perl version, you'll have the pm560 variant, and if you've installed Perl 5.8.0 you may have the pm580 variant.

Q6.20: I'm trying to download a package, but Fink goes to some weird site with distfiles in its name, and the file isn't there.

A: What's happened here is that Fink is trying to use one of it's so called Master mirrors. These were set up to makes sure that sources for Fink packages are available even when the upstream site has moved them around. Typically these errors occur when a new upstream version of a package is released, but hasn't made it to the Master mirrors yet.

To remedy this, run fink configure and set the search order to use Master mirrors last.

Q6.21: I want Fink to use different options in building a package.

A: The first thing to do is to contact the package maintainer to request a variant. It may be relatively easy to do it. If you don't hear from the maintainer or see the new packages, or want to try a different option yourself, check out the Packaging Tutorial and Packaging Manual.

Note: Fink is deliberately set up such that all official binaries are identical regardless of what machine they are built on, so things like G5 optimization won't happen with an official package. If you want them, you'll have to do it yourself.

Q6.22: Whenever I try to build from source, Fink keeps waffling between alternate versions of the same library.

A: Often, in a complicated build tree, you may find that some of the packages depend on a particular version of a library, and other depend on a different one (e.g. db47 vs. db44). Consequently, Fink may try to switch to whichever one isn't currently installed in order to satisfy the build dependency for the current package that you're trying to update.

Unfortunately, due to limitations in the build-dependency engine, you may wind up with the dreaded

Fink::SysState: Could not resolve inconsistent dependencies

message when trying a sufficiently complicated update-all. This generally gives you a command to try to resolve the issue:

fink scanpackages
sudo apt-get update
sudo apt-get install foo=1.23-4	
      

but this may not work for sufficiently complicated updates. You might need to update packages one-by-one, at least for a while.

Q6.23: I get errors involving MACOSX_DEPLOYMENT_TARGET when I try to build a Python module.

A: For errors that look like the following:

running build
running build_ext
Traceback (most recent call last):
  File "setup_socket_ssl.py", line 21, in ?
    depends = ['socketmodule.h'] )
  File "/opt/sw/src/root-python24-2.4.1-1/opt/sw/lib/python2.4/distutils/core.py", line 166, in setup
SystemExit: error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.4" but "10.3" during configure
### execution of /opt/sw/bin/python2.4 failed, exit code 1

the problem occurs because the python2* packages write the current MACOSX_DEPLOYMENT_TARGET to a configuration file when they're built and the python build utilities use this value when compiling modules. This means that if you have, for example, a python24 package on 10.4 that was built on 10.3, either by upgrading 10.3 => 10.4, or via the 10.4-transitional binary distribution, in which python24 wasn't rebuilt, there will be a mismatch between what python thinks MACOSX_DEPLOYMENT_TARGET should be (10.3) and what it actually is (10.4).

The fix is to rebuild the offending python package, e.g. fink rebuild python24 for the case above.

Q6.24: I get unrecognized option `-dynamic' errors from libtool.

A: This error:

 libtool: unrecognized option `-dynamic'

typically means that you've replaced Apple's /usr/bin/libtool with a GNU libtool. Unfortunately, the two libtools do not do the same thing.

The only way to solve this is to get a working Apple libtool from somewhere. It is installed as part of the DeveloperTools.pkg package of the XCode Tools, and you can reinstall that whole package if you first clear out its receipt in /Library/Receipts (drag it to the Trash for OS 10.4 and later, or use sudo rm -rf /Library/Receipts/DeveloperTools.pkg for 10.3).

7 编译问题-特定软件包

Q7.1: 一个软件包构建失败,错误和 sed 有关。

A: 如果你的登录脚本(例如 ~/.cshrc)向终端输出了些信息,比如 "echo Hello" 或 xttitle,可能会导致这个错误。要消除这个问题,最简单的办法是注释掉这些行。

如果你想保留这些回显信息,你可以这样做:

if ( $?prompt) then
echo Hello
endif

Q7.2: 我想改用 Fink 的 XFree86 软件包,但我不能安装 xfree86-basexfree86,因为它和 system-xfree86 冲突。

A: 很不幸,各种 X11 都不可避免地要安装在 /usr/X11R6 中。因此 Fink 的 xfree86-basexfree86-rootless 软件包也需要安装在那里。不过,由于 Fink 不会删除任何没有在它数据库里面的文件,它不会自动替换非 Fink 安装的 X11。

下面是应该怎么做:

注意:安装了新版(0.16.2 或更新)Fink 的 10.2.x 用户和 10.3.x 的用户应该跳过下面的步骤 1(事实上,他们也做不了步骤 1)。

1. 删除 system-xfree86。如果你暂时还没有依赖于 X11 的软件包,这很简单。但通常情况是,已经安装了需要依赖于 X11 的软件包。如果不想全部删除他们,你可以使用:

sudo dpkg --remove --force-depends system-xfree86

来进行删除,而保持其它软件包仍然存在。如果你没有安装 system-xfree86,那么跳到步骤 3。

2. 手工删除所有 XFree86。可以这么做:

sudo rm -rf /Applications/XDarwin.app /usr/X11R6 /etc/X11

如果你正在使用的是苹果的 X11,同时也删除 X11 程序。

3. 要获取 XFree86-4.2.1,用通常的办法安装 Fink 的 xfree86-basexfree86-rootless 软件包:对使用源代码安装的用户 "fink install";对二进制安装的用户 "apt-get install" 或 dselect

3a. 要获取 XFree86-4.3.x 或更高版本,使用 "fink install xfree86" 安装 Fink 的 xfree86 软件包,最新版本(2004年5月25日的 XFree86-4.4.x 版本)目前还没有二进制安装版发布,而且仅有未稳定的版本[参阅 how to install unstable package]。

Q7.3: 怎么把 Fink 的 XFree86 从非线程化的版本改为线程化的版本(或相反)?

A: 如果你正在使用 Fink 版本的 XFree86,并且你希望在线程化或非线程化的版本之间转换,你需要手工删除旧的版本,你可以用下面的命令行命令实现:

sudo dpkg -r --force-depends xfree86-base
sudo dpkg -r --force-depends xfree86-shlibs
sudo dpkg -r --force-depends xfree86-rootless
sudo dpkg -r --force-depends xfree86-rootless-shlibs
	

或者删除线程化的版本:

sudo dpkg -r --force-depends xfree86-base-threaded
sudo dpkg -r --force-depends xfree86-shlibs-threaded
sudo dpkg -r --force-depends xfree86-rootless-threaded
sudo dpkg -r --force-depends xfree86-rootless-threaded-shlibs
	

FinkCommander 也可以删除软件包。在源代码版本窗口,选择一个软件包,然后在 Source Menu 使用 "Force Remove"。

如果你正在使用 system-xfree86,查看前面关于删除它的问题。

安装你需要的 xfree86 版本:

xfree86-basexfree86-rootless

xfree86-base-threadedxfree86-rootless-threaded

你可以使用通常的办法:对源代码安装用户 "fink install";对二进制安装用户 "apt-get install" or dselect

Q7.4: "当我安装 KDE 的时候,我碰到下面的信息:'Can't resolve dependency "cctools (>= 446-1)"'

A: 这个晦涩的消息表明你需要安装 December 2002 开发工具。

Q7.5: I can't update libiconv.

A: If you get errors of the form:

libtool: link: cannot find the library `/opt/sw/lib/libiconv.la'

you can solve this problem by running

fink remove gettext-dev
fink install libiconv

Q7.6: i can't install a package because c++filt is missing. Where do I get it?

A: If you get errors of the form

xgcc: installation problem, cannot exec `c++filt': No such file or directory

since updating to Tiger, then you need to do the following:

You also might also need to make sure you don't have any ancient Developer/Xcode Tools stuff laying around:

1) Flush out your old 2) Reinstall BSD.pkg (from your main OS install)

Q7.7: Fink refuses to update the gettext package, complaining that the dependencies are in an inconsistent state.

A: After running fink selfupdate to be sure you have the latest versions, try fink update gettext-tools. An old version of the gettext-tools package may be preventing you from updating gettext.

Q7.8: I can't install gtk+2 on OS 10.5

A: Typically this involves missing libraries, such as: /usr/X11/lib/libXrandr.2.0.0.dylib or /usr/X11/lib/libXdamage.1.1.0.dylib (or other versions of libraries in /usr/X11/lib/).

The current wisdom on the best fix for such an issue is to install Xcode 3.1.3 or later.

Q7.9: I'm having issues with a package that isn't listed here.

A: Since package problems tend to be transient, we've decided to put them up on the Fink wiki. Check the Package issues page.

8 一般性软件包使用问题

Q8.1: 我碰到很多这样的消息:"locale not supported by C library"。有问题吗?

A: 没有什么问题,它只是表示程序会使用默认的英语信息提示,日期格式等。 程序其它的功能应该是正常的。 X11 文档有更多的细节

Q8.2: 我的系统上突然多很很多陌生的用户,名字象 "mysql","pgsql",和 "games"。 它们是哪来的?

A: 你用 Fink 安装了一些软件包,这些软件包依赖于另外一个叫 passwd 的软件包。passwd 出于安全的原因在你的系统上增加了一些额外的用户-Unix 系统上,文件和进程由一些(不同的) "owners" 所有,这可以使得系统管理员可以微调系统的权限和安全性设置。 象 Apache 和 MySQL 这样的程序需要有 "owner",把这些守护进程由 root 来运行是不安全的(想像一下如果 Apache 被攻破而它又有对系统所有文件的写权限的情况)。 因此,passwd 软件按照 Fink 软件包的需要建立了这些额外的用户。

如果在你的"系统预置:用户"(对 10.2)或"系统预置:帐号"(对 10.3)面板里面突然出现了这些用户,那么要警惕,但不要那么着急去删除它们:

Fink 在你安装 passwd 软件包的时候确实曾经向你要求安装这些额外用户的许可, 所以这些用户的存在本不应该觉得奇怪的。

Q8.3: 如何使用 Fink 安装的软件编译一些我自己的东西?

A: When compiling something yourself outside of Fink, the compiler and linker need to be told where to find the Fink-installed libraries and headers. It is also necessary to tell the compiler to use the appropriate target architecture. For a package that uses standard configure/make process, you need to set some environment variables:

-bash-

export CFLAGS=-I/opt/sw/include 
export LDFLAGS=-L/opt/sw/lib 
export CXXFLAGS=$CFLAGS 
export CPPFLAGS=$CXXFLAGS 
export ACLOCAL_FLAGS="-I /opt/sw/share/aclocal"
export PKG_CONFIG_PATH="/opt/sw/lib/pkgconfig"
export PATH=/opt/sw/var/lib/fink/path-prefix-clang:$PATH
export MACOSX_DEPLOYMENT_TARGET=10.9

-tcsh-

setenv CFLAGS -I/opt/sw/include 
setenv LDFLAGS -L/opt/sw/lib 
setenv CXXFLAGS $CFLAGS 
setenv CPPFLAGS $CXXFLAGS 
setenv ACLOCAL_FLAGS "-I /opt/sw/share/aclocal"
setenv PKG_CONFIG_PATH "/opt/sw/lib/pkgconfig"
setenv PATH /opt/sw/var/lib/fink/path-prefix-clang:$PATH
setenv MACOSX_DEPLOYMENT_TARGET 10.9

(assuming that the build system is running OS 10.9 or later)

通常最简单的办法是把这些东西加到你的启动脚本文件(比如 .cshrc.profile),这样他们就可以自动被设置。 如果一个软件包不使用这些环境变量,你需要自己添加 "-I/opt/sw/include" (对头文件) 和 "-L/opt/sw/lib" (对库文件) 到编译指令的一行。有些软件包会使用类似 EXTRA_CFLAGS 或 --with-qt-dir= 这样的非标准配置选项。 通常 "./configure --help" 会告诉你额外的编译选项。

另外,你也许需要安装那些你使用的软件包的开发版的头文件(例如 foo-1.0-1-dev),如果你还没有安装它们的话)。

Q8.4: 我不能在苹果的 X11 的应用程序菜单里面运行任何 Fink 安装的程序。

A: 苹果的 X11 不使用 Fink 的环境变量设置,这意味着应用程序菜单没有正确的环境变量设置来找到你的 Fink 程序。解决办法是在 Fink 安装的程序前面加上:

source /opt/sw/bin/init.sh ; 

例如,如果你希望运行 Fink 安装的 GIMP,那么填入

source /opt/sw/bin/init.sh ; gimp

到你 GIMP 项的命令一栏。

你也可以编辑你的 .xinitrc 文件(在你的用户目录中)并添加:

source /opt/sw/bin/init.sh

到第一行之后。

Q8.5: 我被 X11 的选择弄糊涂了:苹果 X11,XFree86,等等。我应该安装哪一个?

A: 这些都是 XFree86 的变种(它们都基于 XFree86 的代码),但相互之间有一些轻微的差别。对于在 Panther 和 Jaguar 下有不同的可选方式。在 Panther 下你可以选择:

在 Jaguar 下,多数的选择是通过 Fink 安装的:

还有另外一些选择。在 运行 X11 的文档里面有专门的叙述。

Q8.6: 当我试图运行一个程序,我碰到一个错误信息说: "cannot open display:"。我应该怎么办?

A: 这个错误意味着系统不能连接到你的 X 显示。确定你按下面的步骤处理:

1. 启动 X (苹果的 X11,XFree86,…)。

2. 确定你正确设置了 DISPLAY 环境变量。如果你使用 X 的默认设置,你应该这么做:

如果你使用 tcsh

setenv DISPLAY :0

或如果你使用 bash

export DISPLAY=:0

Q8.7: 我在 Fink 里面看不到我喜欢的那个程序。我应该怎么建议增加一个新的软件包到 Fink 里面?

A: 在 Fink 项目的软件包需求追踪器

注意你需要一个 SourceForge 帐号才可以添加。

Q8.8: 这些名为 system-* 的“虚拟软件包”有些时候会存在,但我却不能自己安装或删除它们?

A: 名为类似 system-perl 的软件包是占位软件包。它们不包含实际的文件,而仅仅作为 fink 识别在它之外手工安装的程序一种机制。

从 10.3 版本开始,多数软件包什么不是你可以安装或删除的实际软件包。 相反,它们是“虚拟软件包”,软件包数据由 fink 程序自身根据一个手工安装的程序的预配置清单来产生。 对每个虚拟软件包,fink 会检查特定位置的一些特定文件,如果找到这些文件,就会认为这个虚拟软件包“已经安装”。

你可以运行 fink-virtual-pkgs 程序(fink 软件包的一部分)来获取被检测到已经安装的虚拟软件包的清单。 使用 --debug 标志可以获取有关 fink 检查了哪些文件诊断信息。

不幸的是,没有办法让你自己安装任意的软件(在 fink 之外)并让 fink 识别到它,而不是 fink 自己的版本。 要通用地检查配置和编译标志,路径名等等参数太困难了。

下面是 fink 定义的最重要的一些虚拟软件包(对 fink-0.19.2):

9 特定软件包使用问题

Q9.1: 在 XMMS 中我听不到声音。

A: 确定你在 XMMS 的 preferences 中选择了 "eSound Output Plugin"。 由于一些很奇怪的原因,它默认选择 disk writer 插件。

如果还不行或 XMMS 提示说找不到你的声卡,尝试这个办法:

注意 esd 是设计为由普通用户运行,而不是 root。 它通常通过文件系统的套接字 /tmp/.esd/socket来通信。 如果你希望在网络上的另一台计算机上运行 esd 客户,你只需要添加 -tcp-port 开关。

还有一些报告说 XMMS 在 10.1 下会崩溃或挂掉。目前我们还没有分析或修正。

Q9.2: 在我用 nedit 编辑一个文件时,想要打开另外一个文件,但窗口出现了,却没有响应。

A: 这是 neditlesstif 的当前版本在所有平台上的已知问题。暂时的办法时用 File-->New 先打开一个窗口,然后打开你需要打开的另一个文件。

nedit-5.3-6 中这个问题得到修正,这个版本依赖于 openmotif3 而不是 lesstif

Q9.3: 求救!当我启动 XDarwin,它立刻就退出了!

A: 不要惊慌。 现在《运行 X11》文档有专门一部分《故障排除》针对这个常见问题。

Q9.4: 当我尝试启动 XDarwin 的时候,我碰到这个错误信息:"xinit: No such file or directory (errno 2): no server "/usr/X11R6/bin/X" in PATH"。

A: 首先,确定你在你的 X 启动文件 ~/.xinitrc 中引用了 init.sh 文件。

在 Jaguar 中,有时会构建了所有的 xfree86 软件包,但只有 xfree86-basexfree86-base-shlibs 被安装了。检查时候已经安装了 xfree86-rootlessxfree86-rootless-shlibs。如果没有,运行 fink install xfree86-rootless 应该可以解决问题。

如果你都安装了它们,那么尝试 fink rebuild xfree86-rootless。如果还不行,检查是否有把 /usr/bin/X11R6 包括在你的 PATH 中。

Q9.5: 我希望苹果 X11 里面删除键和 XDarwin 中的作用一样。

A: 有些用户报告说 XDarwin 和苹果 X11 中删除键的行为不一样。这可以通过在恰当的 X 启动文件中添加几行来修正:

.Xmodmap 里面:

keycode 59 = Delete

.Xresources 里面:

xterm*.deleteIsDEL: true
xterm*.backarrowKey: false
xterm*.ttyModes: erase ^?

.xinitrc 里面:

xrdb -load $HOME/.Xresources
xmodmap $HOME/.Xmodmap

Q9.6: 我从 GNOME 1.x 升级到 GNOME 2.x,现在gnome-session 不会打开一个窗口管理器。

A: 在 GNOME 1.x 下,gnome-session 自动调用 sawfish 窗口管理器;在 GNOME 2.x 下,你要在运行gnome-session之前在 ~/.xinitrc 启动窗口管理器:

...
exec metacity &
exec gnome-session

Q9.7: 我在 Panther 中升级到苹果 X11,现在看不到窗口的标题栏了。

A: 你还没有升级到与 Panther 一起提供的 X11 版本 "X11 1.0 - XFree86 4.3.0"。你可以在第三张光盘的 X11.pkg 安装 X11。

Q9.8: I'm having problems with X11 and Fink.

A: There are two possibilities to consider.

Q9.9: I'm still having problems with X11 and Fink.

A: If the hints in the Fink tries to install XFree86 or X.org or X11 and upgrade from 10.2 entries don't help, or aren't applicable to your situation, you may need to flush out your X11 installation and remove any old placeholders and partially/fully installed X11-related packages:

On Leopard, use

sudo pkgutil --forget com.apple.pkg.X11User
sudo pkgutil --forget com.apple.pkg.X11SDKLeo

Then, on either 10.4 or 10.5, run

sudo dpkg -r --force-all system-xfree86 system-xfree86-42 system-xfree86-43 \
xorg xorg-shlibs xfree86 xfree86-shlibs \
xfree86-base xfree86-base-shlibs xfree86-rootless xfree86-rootless-shlibs \
xfree86-base-threaded xfree86-base-threaded-shlibs \
xfree86-rootless-threaded xfree86-rootless-threaded-shlibs
rm -rf /Library/Receipts/X11SDK.pkg /Library/Receipts/X11User.pkg
fink selfupdate; fink index

(the first line may give you warnings about trying to remove nonexistent packages). Then, reinstall Apple's X11 (and the X11SDK, if needed), or, if you're on 10.4, an alternative X11 implementation, like XFree86 or X.org.

If you are still having problems then you can run

fink-virtual-pkgs --debug

to get information about what's missing.

If you are running an earlier version of fink, then there is a Perl script (courtesy of Martin Costabel) that you can download and run to get the same information.

Q9.10: After updating to Tiger (OS 10.4), whenever I use a GTK app, I get errors involving _EVP_idea_cbc.

A: This is caused by an apparent bug in Tiger's dynamic linker (current as of 10.4.1). You can work around this via prefixing the the name of you want as follows:

env DYLD_FALLBACK_LIBRARY_PATH=: 

E.g., if you want to use gnucash, you'd use

env DYLD_FALLBACK_LIBRARY_PATH=: gnucash

This method works for applications that are launched via the Application Menu in Apple's X11 as well as a terminal.

You may find it preferable to set this globally (e.g. in your startup script, and/or in your .xinitrc , which you may need to do to run GNOME). Put

export DYLD_FALLBACK_LIBRARY_PATH=:

in your .xinitrc (regardless of your login shell) or your .profile (or other startup script) for bash users and:

setenv DYLD_FALLBACK_LIBRARY_PATH :

is the corresponding command to use in e.g. your .cshrc file for tcsh users.

This will automatically be set if you install base-files-1.9.7-1 or later.

Q9.11: I can't get the help to work for any GNOME application.

A: You need to install the yelp package. This package was not placed within the GNOME bundle because it uses cryptography, and it was decided not to place all of GNOME in the crypto tree just to use the help system.


Copyright Notice

Copyright (c) 2001 Christoph Pfisterer, Copyright (c) 2001-2020 The Fink Project. You may distribute this document in print for private purposes, provided the document and this copyright notice remain complete and unmodified. Any commercial reproduction and any online publication requires the explicit consent of the author.


Generated from $Fink: faq.zh.xml,v 1.37 2023/08/04 04:42:29 nieder Exp $