关于FreeBSD安装软件包出错的解决

# pkg_add -r abc
Error: FTP Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-release/Latest/abc.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6-release/Latest/abc.tbz' by URL

出现这种情况,请修改安装源为FreeBSD最新版本的源,请注意系统amd64 i386版本

In this case, the system is using packages-6-release/Latest which contains the 6.9 version of xorg instead of packages-6-stable which contains the latest or 7.2 version of xorg. Take a peek in both directories on the ftp site, you'll see for yourself.

You can ask pkg_add to go to a different location by modifying the PACKAGESITE environmental variable by typing this as one line:

# setenv PACKAGESITE http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/amd64/8.4-RELEASE/packages/Latest/

Don't forget the trailing slash at the end and make sure you choose a directory meant for your operating system's branch. For example, you don't want current which is the unstable testing version of 7.0 anymore than you want the 4.x version of packages on a 6.x system. Typing that setenv command at the command line will only work for that one session; if you wish to change permanently, add that line to the setenv section of /root/.cshrc .

This trick is also handy if you want to change to a faster, geographically closer mirror or if you have your own repository of packages on another system in your network.

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注