[FreeBSD] Day 2: Install and update the package and FreeBSD system

Source: Internet
Author: User

After the network is connected, the required package is installed.

1. Where does the pkg_add command download the package?

It is stored in/var/DB/PKG by default, but some people on the Internet say that the downloaded package can be saved through the-K option, which is saved in the current directory by default, you can also change it by defining the environment variable pkgdir.

Reference:

[1] http://www.freebsdchina.org/forum/viewtopic.php? T = 27653 & START = 0

2. Update the port and package.

Preliminary consideration: the local ADSL Network speed is too slow. Configure the multi-thread download tool and domestic source according to the reference document [1 ].

Several sources with fast updates

EE/etc/make. conf
MASTER_SITE_BACKUP= \ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://202.113.12.9/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\http://ports.hshh.org/${DIST_SUBDIR}/\ftp://ftp2.tsinghua.edu.cn/mirror/FreeBSD/distfiles/${DIST_SUBDIR}/\ftp://ftp2.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://ftp.jp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\ftp://ftp3.jp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/MASTER_SITE_OVERRIDE= ${MASTER_SITE_BACKUP}

Reference:

[1] http://www.bignote.cn /? P = 8

[2] http://www.cnblogs.com/apexchu/archive/2010/10/15/1852629.html

Configure the above, compare the portsnap and CVSup (refer to the http://hi.baidu.com/lssbing/blog/item/19442631052106a45edf0ecb.html)

We decided to use portsnap to update the port. Portsnap is used as follows:

First use: portsnap fetch Extract
Reuse later: portsnap fetch update
You can also perform regular upgrade in cron: portsnap cron update
Enter portsnap fetch extract and press enter for the first time. Because dozens of megabytes of files need to be downloaded, it takes some time.
If you have not installed ports, this command is invalid and you need to install ports through sysinstall.
Modify and update the server address: Change servername = [server address or domain name] in/etc/portsnap. conf

Note that the combination of portsnap and CVSup is not recommended.

3. Install xfce4

Pkg_add-r xfce is also available. After installation, it is found to be version 3.8. *, dizzy.

Run pkg_add-r xfce4 and run startxfce... Make install clean

It took me about 8 hours to install it by compiling the source code. I will not install it again in the future. It is recommended that you do not select any unused items for the first time, for example, print related. Install some basic things first.

The same error is returned when startxfce4 is installed. I checked it carefully and estimated that Xorg was not installed.

Install Xorg and execute startxfce4. It's really a tragedy. Compilation wasted so much time all night .... You need to carefully read the error information in the future.

If no. xinitrc file exists in a common account, startx reports an error and cannot start X. Therefore, copy/root/. xinitrc to the Current Account.

Reference:

[1] FreeBSD official documentation, http://www.freebsd.org/doc/zh_CN/books/handbook/x11-wm.html

4. continue setting

From [1]:

After installing xfce, enter xfce to find that the mouse and keyboard are unavailable (virtualbox may simulate USB ports). You need to configure the following:

1. Enable the USB mouse.
Use VI to open the/etc/rc. conf file and add the following at the end:

Hald_enable = "yes"
Dbus_enable = "yes"
Fusefs_enable = "yes"
# This is the package that enables Xorg dependency

Restart the computer after saving:
Reboot

2. Run the following command after restart:
Xorg-configure

Generate configuration file

Reference: [1] http://www.followstars.cn/article.asp? Id = 218

5. Modify the startup wait time

After the system is installed, wait 10 s by default in the Start Menu, which is too long.

Edit/boot/loader. conf (not on my machine, create it) and add the following sentence:
Autoboot_delay = "X"
X indicates the number of seconds you want to stay.

Reference:
[1] http://my.chinaunix.net/space.php? Uid = 21782158 & Do = Blog & id = 11006

6. Install the Chinese Input Method fcitx

I think fcitx is suitable for me [1]. Although I often see that ibus is good, I don't like things implemented in Python very much and it feels slow.

The following is taken from [2]. In theory, fcitx is similar.

After the installation is complete, perform the following Configuration:

Open the/root/. cshrc file with VI (because the root shell is CSH ):

VI/root/. cshrc

Add:

Setenv Lang zh_cn.euccn
Setenv lc_lang zh_cn.euccn
Setenv xmodifers @ im = scim
Setenv lc_ctype zh_cn.euccn

Add the following content to the/home/sky/. profile file:

Lang = zh_cn.euccn; export Lang
Lc_lang = zh_cn.euccn; export lc_lang
Xmodifers = @ im = scim; export xmodifers
Lc_ctype = zh_cn.euccn; export lc_ctype

Add the following at the top of the. xinitrc file in the user directory of all accounts:

Exec scim &
# Run scim in the background

Reference:

[1] Ubuntu Chinese Pinyin input method summary, http://wowubuntu.com/pinyin.html

[2] http://www.followstars.cn/article.asp? Id = 218

7. After installation, clean up

Run to the/usr/ports/directory and make clean.

8. Install the enhanced functions of the virtualbox Virtual Machine

Follow [1. For make install, kernel sources may be required.

Reference:

[1] http://wiki.freebsdchina.org/software/v/virtualbox-additions

2. Update the port and package.

Preliminary consideration: the local ADSL Network speed is too slow. Configure the multi-thread download tool and domestic source according to the reference document [1 ].

Several sources with fast updates

EE/etc/make. conf
MASTER_SITE_BACKUP= \ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://202.113.12.9/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\http://ports.hshh.org/${DIST_SUBDIR}/\ftp://ftp2.tsinghua.edu.cn/mirror/FreeBSD/distfiles/${DIST_SUBDIR}/\ftp://ftp2.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ftp://ftp.jp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\ftp://ftp3.jp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/MASTER_SITE_OVERRIDE= ${MASTER_SITE_BACKUP}

Reference:

[1] http://www.bignote.cn /? P = 8

[2] http://www.cnblogs.com/apexchu/archive/2010/10/15/1852629.html

Configure the above, compare the portsnap and CVSup (refer to the http://hi.baidu.com/lssbing/blog/item/19442631052106a45edf0ecb.html)

We decided to use portsnap to update the port. Portsnap is used as follows:

First use: portsnap fetch Extract
Reuse later: portsnap fetch update
You can also perform regular upgrade in cron: portsnap cron update
Enter portsnap fetch extract and press enter for the first time. Because dozens of megabytes of files need to be downloaded, it takes some time.
If you have not installed ports, this command is invalid and you need to install ports through sysinstall.
Modify and update the server address: Change servername = [server address or domain name] in/etc/portsnap. conf

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.