本文转载自: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html
Prev | Chapter 11 Linux® Binary Compatibility | Next |
11.2 Installation
Linux® libararies are not installed on FreeBSD by default and Linux binary compatibility is not enabled by default. Linux libraries can be installed using the FreeBSD Ports Collection. Alternately, Linux libraries can be installed manually.
Using the Ports Collection is by far the easiest way to install Linux libraries:
# cd /usr/ports/emulators/linux_base-f10# make install distclean
Once the port is installed, enable Linux binary compatibility by loading the linux module. Type the following as root:
# kldload linux
In order for Linux compatibility to always be enabled at boot time, add the following line to /etc/rc.conf:
linux_enable="YES"
To verify that the module is loaded, use kldstat(8):
% kldstat Id Refs Address Size Name 1 2 0xc0100000 16bdb8 kernel 7 1 0xc24db000 d000 linux.ko
Users who prefer to statically link Linux binary compatibility into the kernel should add options COMPAT_LINUX to the custom kernel configuration file. Compile and install the new kernel as described in .
11.2.1 Installing Libraries Manually
While using the Ports Collection is recommended, Linux libraries can be installed manually. The Linux shared libraries required by a program and the runtime linker should be copied to /compat/linux. Any shared libraries opened by Linux programs run under FreeBSD will look in this directory first. For example, if a Linux program loads /lib/libc.so, FreeBSD will first try to open /compat/linux/lib/libc.so, and if that does not exist, it will then try /lib/libc.so. Shared libraries should be installed to /compat/linux/lib rather than to the paths that the Linux ld.so reports.
Generally, one will need to look for the shared libraries that Linux binaries depend on only the first few times that a Linux program is installed on FreeBSD. After a while, there will be a sufficient set of Linux shared libraries on the system to be able to run newly imported Linux binaries without any extra work.
11.2.1.1 How to Install Additional Shared Libraries
If the linux_base port is installed and an application still complains about missing shared libraries, there are two methods root can use to determine which shared libraries the Linux binaries need.
If a Linux system is available, determine which shared libraries the application needs, and copy them to the FreeBSD system.
In this example, FTP was used to download the Linux binary of Doom on a Linux system . To check which shared libraries it needs, run ldd linuxdoom:
% ldd linuxdoom libXt.so.3 (DLL Jump 3.1) => /usr/X11/lib/libXt.so.3.1.0 libX11.so.3 (DLL Jump 3.1) => /usr/X11/lib/libX11.so.3.1.0 libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29
Copy all the files in the last column into /compat/linux on the FreeBSD system, with the names in the first column as symbolic links pointing to them. This example will result in the following files on the FreeBSD system:
/compat/linux/usr/X11/lib/libXt.so.3.1.0 /compat/linux/usr/X11/lib/libXt.so.3 -> libXt.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3.1.0 /compat/linux/usr/X11/lib/libX11.so.3 -> libX11.so.3.1.0 /compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29
Note: If a Linux shared library already exists with a matching major revision number to the first column of the ldd output, it does not need to be copied to the file named in the last column, as the existing library should work. It is advisable to copy the shared library if it is a newer version, though. The old one can be removed, as long as the symbolic link points to the new one. For example, these libraries exist on the system:
/compat/linux/lib/libc.so.4.6.27 /compat/linux/lib/libc.so.4 -> libc.so.4.6.27and a binary claims to require a later version according to the output of ldd:
libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29If it is only one or two versions out of date in the trailing digit, do not worry about copying /lib/libc.so.4.6.29, because the program should work fine with the slightly older version. However, it is safe to replace the libc.so:
/compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29
Note: The symbolic link mechanism is only needed for Linux binaries as the FreeBSD runtime linker takes care of looking for matching major revision numbers.
11.2.2 Installing Linux® ELF Binaries
ELF binaries sometimes require an extra step of “branding”. If an unbranded ELF binary is executed, it will generate an error message like the following:
% ./my-linux-elf-binary ELF binary type not known Abort
To help the FreeBSD kernel distinguish between a FreeBSD ELF binary and a Linux binary, use brandelf(1):
% brandelf -t Linux my-linux-elf-binary
Since the GNU toolchain places the appropriate branding information into ELF binaries automatically, this step is usually not necessary.
11.2.3 Installing a Linux RPM Based Application
FreeBSD uses its own package database to track all software installed from the Ports Collection. However, the Linux RPM database is not supported.
In order to install a Linux RPM-based application, first install the archivers/rpm2cpio package or port. Once installed, root can use this command to install a .rpm as follows:
# cd /compat/linux# rpm2cpio -q < /path/to/linux.archive.rpm | cpio -id
If necessary, brandelf the installed ELF binaries, but not the libraries. Note that this will prevent a clean uninstall.
11.2.4 Configuring the Hostname Resolver
If DNS does not work or this error appears:
resolv+: "bind" is an invalid keyword resolv+: "hosts" is an invalid keyword
Configure /compat/linux/etc/host.conf as follows:
order hosts, bind multi on
This order specifies that /etc/hosts is searched first and DNS is searched second. When /compat/linux/etc/host.conf does not exist, Linux applications use /etc/host.conf and complain about the incompatible FreeBSD syntax. Remove bind if a name server is not configured using /etc/resolv.conf.
Prev | Home | Next |
Linux® Binary Compatibility | Up | Installing Mathematica® |
相关推荐
Xsystems宣布与Adobe Systems达成协议,允许下一版本...PCBSD将使用FreeBSD的Linux兼容层来运行Linux版本的Flash播放器。 PC-BSD是在去年被iXsystems收购,PC-BSD有个很特别的PBI软件安装程序,免去了麻烦的依赖关系。
Gentoo 最初由Daniel Robbins(前Stampede Linux和FreeBSD的开发者之一)创建。由于开发者对FreeBSD的熟识,所以Gentoo拥有媲美FreeBSD的广受美誉的ports系统 ——portage。(Ports和Portage都是用于在线更新软件的...
这个是FreeBSD的官方指导手册.详细描述了安装,使用。Linux兼容模式。X使用,ssh,故障处理,硬件配置。
它与Bash兼容性不符,后者可以提高可用性,并且需要一些习惯。 一旦您拥有了它,就真正感觉就像它声称的90年代命令行外壳一样。 fish还为脚本编写提供了一些极大的简化。 对于临时脚本,我几乎只使用它。 显然,您...
它提供LINUX兼容模式,可以使用linux中优秀的媒体工具、办公软件,你可以像linux桌面版一样使用它。主要开发者是Kris Moore,与freebsd的区别:PCBSD主要面向桌面应用,而freebsd主要针对服务器。PCBSD基于FREEBSD...
FreeBSD安装后配置:别名,apcupsd,授权密钥,cron,devfs,fstab,组,hostapd,主机名,主机,libmap,linux兼容性,login.conf,loader.conf,make.conf,motd,nfsd,ntpd, ntpdate,procmail,resolvconf....
它是一个Windows兼容层,用通俗的话说,就是一个Windows模拟器,这个层即提供了一个用来从Windows源进出到UNIX的开发工具包(Winelib),也提供了一个程序加载器,该加载器允许不用任何修改Windows 3.1/95/NT的二进制文件,...
注意:32位版本与Windows XP兼容。 支持: 如果您想付啤酒: 要么 如何编译 Linux 依存关系 与OpenGL的支持(qtbase,qtsvg和qttools) (可选) 如果要视频和音频记录支持)(libavcodec,libavformat,...
Wine可以工作在绝大多数的UNIX版本下、包括Linux、 FreeBSD 和 Solaris。Wine不需要Microsoft Windows, 因为这是一个完全由免费代码组成的,但是它却可以随意地使用本地系统的DLLs,如果它们是可以被利用的话。Wine...
Novell SLES现已发展成为最受业内瞩目的、发展最为迅猛的主流服务器操作系统之一,也是全球唯一能与微软操作系统兼容的Linux操作系统。 RHEL ES(RedHat Enterprise Linux Entry Server)中型操作系统方案给市面上...
OwnTone服务器(以前为fork-daapd) OwnTone服务器是Linux / FreeBSD DAAP(iTunes),MPD(音乐播放器守护程序)和RSP(Roku)媒体服务器。 它支持AirPlay设备/扬声器,Apple Remote(和兼容产品),MPD客户端,...
3、改进了在linux环境下不能运行的一些问题,使得系统完成兼容Linux/FreeBSD php,windows php系统. 4、缓存技术进一步加强同时新增了首页缓存功能,使得运行速度大大提高。 5、修正了伪静态页面的一些BUG,以及博客...
3、改进了在linux环境下不能运行的一些问题,使得系统完成兼容Linux/FreeBSD php,windows php系统. 4、缓存技术进一步加强同时新增了首页缓存功能,使得运行速度大大提高。 5、修正了伪静态页面的一些BUG,以及博客...
3、改进了在linux环境下不能运行的一些问题,使得系统完成兼容Linux/FreeBSD php,windows php系统. 4、缓存技术进一步加强同时新增了首页缓存功能,使得运行速度大大提高。 5、修正了伪静态页面的一些BUG,以及博客...
3. 兼容性特强,windows, linux, freebsd, arm64 主流系统,都满足运行条件 4. 软件大小相对比较小,即使是嵌入式设备也能满足布署 5. 支持 web 开发接口 6. 支持集群,级联 支持的系统有: 1. Windows 2. Linux ( ...
p9fs:一个用于FreeBSD的9P2000.U内核文件... 此实现的目标是9P2000.u,但如果可行,也可能主要出于兼容性目的而支持9P2000.L。 其他参考 其他一些实现提供有用的文档和提示: 提供了Python的通用实现。 很有帮助。
forked-daapd is a Linux/FreeBSD DAAP (iTunes), MPD (Music Player Daemon) and RSP (Roku) media server. It supports AirPlay devices/speakers, Apple Remote (and compatibles), MPD clients, Chromecast, ...
Wine(最初是“ Wine不是模拟器”的缩写)是一个兼容层,能够在多个POSIX兼容操作系统(例如Linux,macOS和BSD)上运行Windows应用程序。 Wine不会像虚拟机或仿真器那样模拟内部Windows逻辑,而是将Windows API调用...
如果在Linux上使用软件包,则可以在/etc/sd-agent/config.cfg找到主配置文件。 每次检查配置文件位于/etc/sd-agent/conf.d 。 我们在可以用作模板的目录中提供了一个示例。 安装插件 请参阅。 编写自定义插件 查看。...
iODBC驱动程序管理器 ...All Rights Reserved. 执照 版权所有1996-2019 该软件根据GNU库通用公共许可证(请参阅 )或BSD许可证(请参阅 )发布。... 该工具包将为您提供在Unix下开发与ODBC兼容的应用程序