当前位置:网站首页>FreeBSD 12 installing RPM packages
FreeBSD 12 installing RPM packages
2022-07-19 07:25:00 【sayang_ shao】
Article from Freebsd 12 The official manual https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-lbc-install.html
By default, Linux libraries are not installed and Linux binary compatibility is not enabled. Linux libraries can either be installed manually or from the FreeBSD Ports Collection.
Before attempting to build the port, load the Linux kernel module, otherwise the build will fail:
#kldload linuxFor 64-bit compatibility:
#kldload linux64To verify that the module is loaded:
%kldstatId Refs Address Size Name1 2 0xc0100000 16bdb8 kernel 7 1 0xc24db000 d000 linux.ko
The emulators/linux_base-c6 package or port is the easiest way to install a base set of Linux libraries and binaries on a FreeBSD system. To install the port:
#pkg install emulators/linux_base-c6For Linux compatibility to be enabled at boot time, add this line to /etc/rc.conf:
linux_enable="YES"
On 64-bit machines, /etc/rc.d/abi will automatically load the module for 64-bit emulation.
Since the Linux binary compatibility layer has gained support for running both 32- and 64-bit Linux binaries (on 64-bit x86 hosts), it is no longer possible to link the emulation functionality statically into a custom kernel.
10.2.1. Installing Additional Libraries Manually
If a Linux application complains about missing shared libraries after configuring Linux binary compatibility, determine which shared libraries the Linux binary needs and install them manually.
From a Linux system, ldd can be used to determine which shared libraries the application needs. For example, to check which shared libraries linuxdoom needs, run this command from a Linux system that has Doom installed:
%ldd linuxdoomlibXt.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.29Then, copy all the files in the last column of the output from the Linux system into /compat/linux on the FreeBSD system. Once copied, create symbolic links to the names in the first column. 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
If a Linux shared library already exists with a matching major revision number to the first column of the lddoutput, 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 already exist on the FreeBSD system:
/compat/linux/lib/libc.so.4.6.27 /compat/linux/lib/libc.so.4 -> libc.so.4.6.27
and ldd indicates that a binary requires a later version:
libc.so.4 (DLL Jump 4.5pl26) -> libc.so.4.6.29
Since the existing library is only one or two versions out of date in the last digit, the program should still work with the slightly older version. However, it is safe to replace the existing libc.so with the newer version:
/compat/linux/lib/libc.so.4.6.29 /compat/linux/lib/libc.so.4 -> libc.so.4.6.29
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 installed Linux binaries without any extra work.
10.2.2. Installing Linux ELF Binaries
ELF binaries sometimes require an extra step. When an unbranded ELF binary is executed, it will generate an error message:
%./my-linux-elf-binary
ELF binary type not known
AbortTo help the FreeBSD kernel distinguish between a FreeBSD ELF binary and a Linux binary, use brandelf(1):
%brandelf -t Linux my-linux-elf-binarySince the GNU toolchain places the appropriate branding information into ELF binaries automatically, this step is usually not necessary.
10.2.3. Installing a Linux RPM Based Application
To install a Linux RPM-based application, first install the archivers/rpm4 package or port. Once installed, root can use this command to install a .rpm:
#cd /compat/linux#rpm2cpio < /path/to/linux.archive.rpm | cpio -id
If necessary, brandelf the installed ELF binaries. Note that this will prevent a clean uninstall.
10.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 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.
边栏推荐
- AB Testing Review
- m基于matlab的超宽带MIMO雷达对目标的检测仿真,考虑时间反转
- MySql02 函数substr mod 视图view
- 【量化笔记】波动volatility相关技术指标以其含义
- Crawler foundation - Web page Foundation
- Pychart installation tutorial
- Paper reading: deep residual shrink networks for fault diagnosis
- 基于simulink的转速反馈单闭环直流调速系统
- Component emit Foundation
- Pytorch learning diary (II)
猜你喜欢

m基于MATLAB-GUI的GPS数据经纬度高度解析与kalman分析软件设计

m在VBLAST协作MIMO系统分部使用LDPC,Turbo,卷积三种信道编译码进行误码率matlab仿真

4. Installation and use of idea

Pytorch learning diary (II)

m基于Simulink的高速跳频通信系统抗干扰性能分析

MySQL正则表达式^和$用法

网络知识-04 网络层-ICMP协议

IP103.53.125. XXX IP address segment details

MySQL regular expression ^ and $usage

Product Case Interviews
随机推荐
Network knowledge-03 data link layer PPP
wcdma软切换性能matlab仿真m,对比平均激活集数(MASN)、激活集更新率(ASUR)及呼叫中断概率(OP)三个性能指标
TypeScript(ts-loader,tsconfig.json及lodash)
Review of Linear Algebra
Hypothesis testing
Class and super, inheritance
My world 1.18.1 forge version open service tutorial, can install mod, with panel
爬虫基础—爬虫的基本原理
MySql02 函数substr mod 视图view
Crawler foundation - Web page Foundation
剑指Offer刷题记录——Offer 06.从尾到头打印链表
Hypothesis testing
IP103.53.125. XXX IP address segment details
Cracking Metric/Business Case/Product Sense Problems
How does the advanced anti DDoS server confirm which are malicious ip/ traffic? ip:103.88.32. XXX
Use of urllib Library
Network knowledge-04 network layer IPv6
PyTorch学习笔记(一)
PyTorch学习日记(四)
Network knowledge-05 transport layer TCP