📄 00000031.htm
字号:
/compat/linux/etc for a system config file, and then fall back to <BR> /etc. <BR> <BR> Linux Distributions and Emulation <BR> <BR> At the moment, FreeBSD's Linux mode is based on Red Hat 5.2. (RedHat <BR> 6.0 emulation is in -current, and should be backported to -stable by <BR> the time you read this.) This doesn't mean that you can't use software <BR> designed for other distributions, however. <BR> <BR> Using a particular Red Hat distribution simply indicates the level of <BR> Linux kernel and userland library support available in your FreeBSD <BR> system. Red Hat 5.2 uses libc5, glibc2, and Linux kernel 2.0.36. <BR> RedHat 6.0 uses glibc2.1 and kernel 2.2.5. Linux software that will <BR> run under these libraries, and this kernel will work in FreeBSD's <BR> Linux mode. <BR> <BR> Running Linux Apps <BR> <BR> When you have the linux_base port installed, and kldstat -v shows the <BR> Linux module is running, just run your Linux program from a command <BR> prompt. <BR> <BR> Adding Linux Libraries <BR> <BR> FreeBSD's install routines and ports system take care of almost all <BR> the ugly details of configuring shared libraries, insulating the <BR> administrator from the majority of these issues. This system does not <BR> cover software from other operating systems running under kernel <BR> modules. Linux systems tend to accumulate shared libraries like pocket <BR> lint. Eventually, you'll need to add additional Linux shared libraries <BR> to your system. <BR> <BR> The Linux emulator has its own ldconfig, /compat/linux/sbin/ldconfig, <BR> and its own ld.so.conf file, /compat/linux/etc/ld.so.conf. If you look <BR> at this file, you'll see: <BR> <BR>#more ld.so.conf <BR>/usr/X11R6/lib <BR>/usr/i486-linux-libc5/lib <BR># <BR> <BR> These are the directories where the module will look for Linux <BR> libraries, in addition to /lib and /usr/lib. Despite the initial <BR> slash, these directory names are all under /compat/linux. I recommend <BR> installing additional libraries under /compat/linux/usr/local/lib. <BR> Edit /compat/linux/etc/ldconfig.conf to add this path. When you have <BR> large programs that include many libraries of their own, you might <BR> wish to create new directories for those shared libraries. My <BR> /compat/linux/etc/ld.so.conf looks like: <BR> <BR>#more ld.so.conf <BR>/usr/local/lib <BR>/usr/local/lib/soffice <BR>/usr/X11R6/lib <BR>/usr/i486-linux-libc5/lib <BR>/usr/openwin/lib <BR># <BR> <BR> Whenever you add new libraries, rerun /compat/linux/sbin/ldconfig. <BR> This rereads the directories in the configuration file and updates the <BR> list of available libraries. Be sure you run <BR> /compat/linux/sbin/ldconfig, and not FreeBSD's /sbin/ldconfig. Not <BR> only will the FreeBSD ldconfig not accomplish what you want, you'll <BR> find yourself either digging through /etc/rc.* scripts to learn how to <BR> properly reconfigure your shared library cache or simply rebooting in <BR> annoyance. <BR> <BR> When a Linux program fails because it cannot find a library, check to <BR> be sure you have the library. If you don't have it, call up your <BR> favorite Internet search engine and fetch a copy. Install it in <BR> /compat/linux/usr/local/lib, run Linux ldconfig, and you'll be up and <BR> running. <BR> <BR> Alternately, you can use the environment variable LD_LIBRARY_PATH to <BR> tell a shell to check a particular directory for libraries (see man 8 <BR> ldconfig). Many problems can be caused by the indiscriminate use of <BR> LD_LIBRARY_PATH, however, so you're better off editing <BR> /usr/compat/linux/etc/ld.so.conf. <BR> <BR> Installing Linux Software as FreeBSD Ports <BR> <BR> Some Linux software packages are available via FreeBSD's ports system. <BR> One well-known example is WordPerfect 8. If you become root, cd <BR> /usr/ports/editors/wordperfect, and type make, you will get: <BR> <BR>#make <BR>===> wordperfect-8.0 'The source to this <BR>port may not be automatically fetched due <BR>to licensing restrictions. You MUST fetch <BR>the source manually after reading and <BR>agreeing to the license at: <BR><A HREF="http://linux.corel.com/linux8/download.htm">http://linux.corel.com/linux8/download.htm</A> <BR>Once GUILG00.GZ has been downloaded, move <BR>it to /usr/ports/distfiles and then restart <BR>this build.'. <BR># <BR> <BR> In this case, FreeBSD's automatic fetch mechanism won't work - <BR> WordPerfect's distribution terms require the user to agree to a <BR> license before downloading. Go to the Web page, accept their terms, <BR> and download WordPerfect. Install the file in /usr/ports/distfiles, <BR> return to /usr/ports/editors/wordperfect, and type make. The port will <BR> automatically install WordPerfect for you. <BR> <BR> Linux Packages <BR> <BR> One of the tools linux_base installs is Red Hat's RPM. You can use <BR> this to install RPMs on your FreeBSD machine. When using RPMs, you <BR> will want to be certain to install the software under /compat/linux. <BR> Because of FreeBSD's monolithic upgrade procedure (see my article <BR> "Maintaining Patch Levels in Open-Source BSDs, Sys Admin, September <BR> 1999), any RPM components that overwrite system components will be <BR> blown away the next time you upgrade. If you overwrite the wrong <BR> files, your system might even become unbootable. To install an RPM, <BR> do: <BR> <BR>rpm -i -ignoreos -dbpath /var/lib/rpm -root \ <BR> /compat/linux [package] <BR> <BR> Add other RPM flags as desired. Of course, RPM packages are completely <BR> separate from FreeBSD's usual package system. Do not expect to be able <BR> to pkg_delete these; you will need to use rpm to handle them. <BR> <BR> Be very careful in your use of RPM; if you accidentally overwrite part <BR> of your FreeBSD installation with Linux binaries, you can expect to <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -