Source string Read only

(itstool) path: sect1/para
144/1440
Context English State
Default Shell
<trademark class="registered">Linux</trademark> users are often surprised to find that <application>Bash</application> is not the default shell in FreeBSD. In fact, <application>Bash</application> is not included in the default installation. Instead, FreeBSD uses <citerefentry><refentrytitle>tcsh</refentrytitle><manvolnum>1</manvolnum></citerefentry> as the default root shell, and the <application>Bourne shell</application>-compatible <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry> as the default user shell. <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry> is very similar to <application>Bash</application> but with a much smaller feature-set. Generally shell scripts written for <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry> will run in <application>Bash</application>, but the reverse is not always true.
However, <application>Bash</application> and other shells are available for installation using the FreeBSD <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports.html">Packages and Ports Collection</link>.
After installing another shell, use <citerefentry><refentrytitle>chsh</refentrytitle><manvolnum>1</manvolnum></citerefentry> to change a user's default shell. It is recommended that the <systemitem class="username">root</systemitem> user's default shell remain unchanged since shells which are not included in the base distribution are installed to <filename>/usr/local/bin</filename>. In the event of a problem, the file system where <filename>/usr/local/bin</filename> is located may not be mounted. In this case, <systemitem class="username">root</systemitem> would not have access to its default shell, preventing <systemitem class="username">root</systemitem> from logging in and fixing the problem.
Packages and Ports: Adding Software in FreeBSD
FreeBSD provides two methods for installing applications: binary packages and compiled ports. Each method has its own benefits:
Binary Packages
Faster installation as compared to compiling large applications.
Does not require an understanding of how to compile software.
No need to install a compiler.
Ports
Ability to customize installation options.
Custom patches can be applied.
package
If an application installation does not require any customization, installing the package is sufficient. Compile the port instead whenever an application requires customization of the default options. If needed, a custom package can be compiled from ports using <command>make</command> <_:buildtarget-1/>.
A complete list of all available ports and packages can be found <link xlink:href="https://www.freebsd.org/ports/master-index.html">here</link>.
Packages
Packages are pre-compiled applications, the FreeBSD equivalents of <filename>.deb</filename> files on Debian/Ubuntu based systems and <filename>.rpm</filename> files on Red Hat/Fedora based systems. Packages are installed using <command>pkg</command>. For example, the following command installs <application>Apache 2.4</application>:
<prompt>#</prompt> <userinput>pkg install <replaceable>apache24</replaceable></userinput>
For more information on packages refer to section 5.4 of the FreeBSD Handbook: <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html">Using pkgng for Binary Package Management</link>.
The FreeBSD Ports Collection is a framework of <filename>Makefile</filename>s and patches specifically customized for installing applications from source on FreeBSD. When installing a port, the system will fetch the source code, apply any required patches, compile the code, and install the application and any required dependencies.
The Ports Collection, sometimes referred to as the ports tree, can be installed to <filename>/usr/ports</filename> using <citerefentry><refentrytitle>portsnap</refentrytitle><manvolnum>8</manvolnum></citerefentry> (if running FreeBSD 11.4 or 12.1) or Subversion (if running FreeBSD-CURRENT). Detailed instructions for installing the Ports Collection can be found in <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">section 5.5</link> of the FreeBSD Handbook.
To compile a port, change to the port's directory and start the build process. The following example installs <application>Apache 2.4</application> from the Ports Collection:
<prompt>#</prompt> <userinput>cd /usr/ports/www/apache24</userinput>
<prompt>#</prompt> <userinput>make install clean</userinput>
A benefit of using ports to install software is the ability to customize the installation options. This example specifies that the <application>mod_ldap</application> module should also be installed:
<prompt>#</prompt> <userinput>cd /usr/ports/www/apache24</userinput>
<prompt>#</prompt> <userinput>make WITH_LDAP="YES" install clean</userinput>
Refer to <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">Using the Ports Collection</link> for more information.
System Startup
Many <trademark class="registered">Linux</trademark> distributions use the SysV init system, whereas FreeBSD uses the traditional BSD-style <citerefentry><refentrytitle>init</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Under the BSD-style <citerefentry><refentrytitle>init</refentrytitle><manvolnum>8</manvolnum></citerefentry>, there are no run-levels and <filename>/etc/inittab</filename> does not exist. Instead, startup is controlled by <citerefentry><refentrytitle>rc</refentrytitle><manvolnum>8</manvolnum></citerefentry> scripts. At system boot, <filename>/etc/rc</filename> reads <filename>/etc/rc.conf</filename> and <filename>/etc/defaults/rc.conf</filename> to determine which services are to be started. The specified services are then started by running the corresponding service initialization scripts located in <filename>/etc/rc.d/</filename> and <filename>/usr/local/etc/rc.d/</filename>. These scripts are similar to the scripts located in <filename>/etc/init.d/</filename> on <trademark class="registered">Linux</trademark> systems.
The scripts found in <filename>/etc/rc.d/</filename> are for applications that are part of the <quote>base</quote> system, such as <citerefentry><refentrytitle>cron</refentrytitle><manvolnum>8</manvolnum></citerefentry>, <citerefentry><refentrytitle>sshd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, and <citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The scripts in <filename>/usr/local/etc/rc.d/</filename> are for user-installed applications such as <application>Apache</application> and <application>Squid</application>.
Since FreeBSD is developed as a complete operating system, user-installed applications are not considered to be part of the <quote>base</quote> system. User-installed applications are generally installed using <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/ports-using.html">Packages or Ports</link>. In order to keep them separate from the base system, user-installed applications are installed under <filename>/usr/local/</filename>. Therefore, user-installed binaries reside in <filename>/usr/local/bin/</filename>, configuration files are in <filename>/usr/local/etc/</filename>, and so on.

Loading…

No matching activity found.

Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/para
Flags
read-only
Source string location
article.translate.xml:136
String age
a year ago
Source string age
a year ago
Translation file
articles/linux-users.pot, string 31