FreeBSD6.2架设之服务器系统升级 FreeBSD6.2 Configure HowTo |
Mongolia |
简介 |
本文目标 |
Step 1 FreeBSD下安装软件包. |
cd /root ls .cshrc .k5login .profile .history .login lsof-4.79D.tbz |
cd /root pkg_add -v lsof-4.79D.tbz |
cd /root pkg_add -r wget Fetching ftp://ftp.cn.freebsd.org/pub/Fre ... /Latest/wget.tbz... Done. Fetching ftp://ftp.cn.freebsd.org/pub/Fre ... lease/All/libiconv-1.9.2_2.tbz... Done. Fetching ftp://ftp.cn.freebsd.org/pub/Fre ... elease/All/gettext-0.14.5_2.tbz... Done. rehash |
whereis wget wget: /usr/local/bin/wget /usr/local/man/man1/wget.1.gz /usr/ports/ftp/wget |
cd /usr/ports/ make search key=fastest_cvsup Port:fastest_cvsup-0.2.9_4 Path:/usr/ports/sysutils/fastest_cvsup Info:Finds fastest CVSup server Maint:nivo+kw+ports.bfa274@is-root.com B-deps: perl-5.8.8 R-deps: perl-5.8.8 |
cd /usr/ports/sysutils/fastest_cvsup/ make install clean rehash |
Options for fastest_cvsup 0.2.9_4 | |||
|
cd /usr/ports/sysutils/fastest_cvsup/ make showconfig ===> The following configuration options are available for fastest_cvsup-0.2.9_4: ROUNDTRIP=on "Build with round-trip patch" ===> Use 'make config' to modify these settings |
cd /usr/ports/sysutils/fastest_cvsup/ make config |
Options for fastest_cvsup 0.2.9_4 | |||
|
cd /usr/ports/sysutils/fastest_cvsup/ make clean |
whereis fastest_cvsup fastest_cvsup: /usr/local/bin/fastest_cvsup /usr/ports/sysutils/fastest_cvsup |
wget http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz --11:56:40-- http://apache.mirror.phpchina.com/httpd/httpd-2.2.6.tar.gz => `httpd-2.2.6.tar.gz' Resolving apache.mirror.phpchina.com... 60.195.249.77 Connecting to apache.mirror.phpchina.com|60.195.249.77|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 6,028,951 (5.7M) [application/x-gzip] 100%[====================================>] 6,028,951 366.54K/s ETA 00:00 11:56:48 (403.81 KB/s) - `httpd-2.2.6.tar.gz' saved [6028951/6028951] ls httpd-2.2.6.tar.gz |
tar -zxvf httpd-2.2.6.tar.gz x httpd-2.2.6/test/test_select.c x httpd-2.2.6/test/time-sem.c x httpd-2.2.6/test/zb.c x httpd-2.2.6/VERSIONING ls httpd-2.2.6.tar.gz httpd-2.2.6 lsof-4.79D.tbz cd httpd-2.2.6 ./configure --prefix=/usr/local/apache22 --enable-so --enable-ssl make make install |
/usr/local/apache22/bin/apachectl start 如果出现: [Wed Nov 21 13:15:50 2007] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter kldload accf_http /usr/local/apache22/bin/apachectl restart |
It works! |
Step 2 FreeBSD下的下载程序. |
pkg_add -r axel Fetching ftp://ftp.cn.freebsd.org/pub/Fre ... /Latest/axel.tbz... Done. rehash |
whereis axel axel: /usr/local/bin/axel /usr/local/man/man1/axel.1.gz /usr/ports/ftp/axel |
axel ftp://ftp.freebsd.org/pub/FreeBS ... nese/zh-scim-fcitx-3.1.1.tbz Initializing download: ftp://ftp.freebsd.org/pub/FreeBS ... nese/zh-scim-fcitx-3.1.1.tbz File size: 1403252 bytes Opening output file zh-scim-fcitx-3.1.1.tbz Starting download [ 0%] .......... .......... .......... .......... .......... [ 18.0KB/s] |
cd /usr/ports/ make search name=wget cd /usr/ports/ftp/wget make install clean |
cd /root/ wget ftp://ftp.freebsd.org/pub/FreeBS ... nese/zh-scim-fcitx-3.1.1.tbz |
Step 3 升级Ports-tree. |
cp /etc/make.conf /root/make.conf.bak |
vi /etc/make.conf |
FETCH_CMD=axel FETCH_BEFORE_ARGS= -n 10 -a FETCH_AFTER_ARGS= DISABLE_SIZE=yes MASTER_SITE_OVERRIDE?=\ http://ports.hshh.org/${DIST_SUBDIR}/\ ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ ftp://ftp.jp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/\ ftp://ftp.freeBSDchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ ftp://ftp.twaren.net/BSD/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp12.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp9.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp5.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/ MASTER_SITE_OVERRIDE?=${MASTER_SITE_BACKUP} WITHOUT_X11=yes |
pkg_add -r cvsup-without-gui rehash |
cd /root mkdir /root/scripts |
cd /root/scripts/ vi /root/scripts/ports-update.sh |
#!/bin/sh # updating port echo "Beginning Ports Update" /usr/local/bin/cvsup -g -L 2 /etc/ports-supfile echo "Ports Update Complete" |
cd /root/scripts/ chmod +x /root/scripts/ports-update.sh |
cd /root cp /usr/share/examples/cvsup/ports-supfile /root/ |
fastest_cvsup -c CN >> Speed Daemons: - 1st: cvsup4.cn.freebsd.org 32.98 ms - 2st: cvsup.cn.freebsd.org 35.68 ms - 3st: cvsup5.cn.freebsd.org 50.18 ms |
cd /root vi /root/ports-supfile |
修改前: *default host=CHANGE_THIS.FreeBSD.org 修改后: *default host=cvsup4.cn.FreeBSD.org 修改前: # collections, ports-all 修改后: # collections, #ports-all #ports-audio #ports-games #ports-graphics #ports-x11 #ports-x11-clocks #ports-x11-fm #ports-x11-fonts #ports-x11-servers #ports-x11-themes #ports-x11-toolkits #ports-x11-wm |
cd /root cp /root/ports-supfile /etc/ports-supfile chmod 640 /etc/ports-supfile |
/root/scripts/ports-update.sh Beginning Ports Update Parsing supfile "/etc/ports-supfile" Shutting down connection to server Finished successfully Ports Update Complete |
Step 4 FreeBSD升级系统源代码. |
cd /root/scripts/ vi /root/scripts/src-update.sh |
#!/bin/sh # updating source echo "Beginning Source Update" /usr/local/bin/cvsup -g -L 2 /etc/stable-supfile echo "Source Update Complete" |
cd /root/scripts/ chmod +x /root/scripts/src-update.sh |
cd /root cp /usr/share/examples/cvsup/stable-supfile /root/ |
cd /root vi /root/stable-supfile |
修改前: *default host=CHANGE_THIS.FreeBSD.org 修改后: *default host=cvsup4.cn.FreeBSD.org 修改前: *default release=cvs tag=RELENG_6 修改后: *default release=cvs tag=RELENG_6_2 |
cd /root cp /root/stable-supfile /etc/stable-supfile chmod 640 /etc/ stable-supfile |
/root/scripts/src-update.sh Beginning Source Update Parsing supfile "/etc/stable-supfile" Connecting to cvsup4.cn.FreeBSD.org Shutting down connection to server Finished successfully Source Update Complete |
Step 5 FreeBSD下的软件包管理. |
pkg_info cvsup-without-gui-16.1h_2 General network file distribution system optimized for CVS fastest_cvsup-0.2.9_4 Finds fastest CVSup server gettext-0.14.5_2 GNU gettext package libiconv-1.9.2_2 A character set conversion library linux_base-fc-4_9 Base set of packages needed in Linux mode (for i386/amd64) lsof-4.79D Lists information about open files (similar to fstat(1)) perl-5.8.8 Practical Extraction and Report Language wget-1.10.2 Retrieve files from the Net via HTTP and FTP |
cd /root/ pkg_info > pkg_list.txt less /root/pkg_list.txt cvsup-without-gui-16.1h_2 General network file distribution system optimized for CVS fastest_cvsup-0.2.9_4 Finds fastest CVSup server gettext-0.14.5_2 GNU gettext package libiconv-1.9.2_2 A character set conversion library linux_base-fc-4_9 Base set of packages needed in Linux mode (for i386/amd64) lsof-4.79D Lists information about open files (similar to fstat(1)) perl-5.8.8 Practical Extraction and Report Language wget-1.10.2 Retrieve files from the Net via HTTP and FTP |
pkg_delete wget-1.10.2 |
pkg_version -v axel-1.0b = up-to-date with port cvsup-without-gui-16.1h_2 < needs updating (port has 16.1h_3) db41-4.1.25_4 = up-to-date with port fastest_cvsup-0.2.9_4 < needs updating (port has 0.2.9_5) gettext-0.14.5_2 < needs updating (port has 0.16.1_3) libiconv-1.9.2_2 < needs updating (port has 1.11_1) linux_base-fc-4_9 < needs updating (port has 4_10) lsof-4.79D = up-to-date with port perl-5.8.8 < needs updating (port has 5.8.8_1) portupgrade-2.3.1,2 = up-to-date with port ruby-1.8.5_3,1 < needs updating (port has 1.8.6.111,1) ruby18-bdb-0.6.2 = up-to-date with port |
cd /usr/ports make search name=portupgrade cd /usr/ports/ports-mgmt/portupgrade/ make install clean;rehash |
Options for portupgrade 2.3.1,2 | |||
|
pkgdb -F |
portupgrade -ai |
portupgrade -R ruby |
portupgrade -P cvsup-without-gui |
pkg_info -L axel-1.0b | less Information for axel-1.0b: Files: /usr/local/man/man1/axel.1.gz /usr/local/bin/axel /usr/local/etc/axelrc /usr/local/share/locale/de/LC_MESSAGES/axel.mo /usr/local/share/locale/nl/LC_MESSAGES/axel.mo |
pkg_info | grep -i axel axel-1.0b A download accelerator |
portsclean -C Cleaning out /usr/ports/*/*/work... portsclean -DD Detecting unreferenced distfiles... [Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 22 packages found (-1 +1) (...). done] Delete /usr/ports/distfiles/automake-1.4-p6.tar.gz Delete /usr/ports/distfiles/ezm3/ezm3-1.2-FreeBSD4-boot.tar.bz2 Delete /usr/ports/distfiles/ezm3/ezm3-1.2-src.tar.bz2 Delete /usr/ports/distfiles/rpm-3.0.6.tar.gz Delete /usr/ports/distfiles/ezm3 |
Step 6 F.A.Q. |
Links to other sources |
原帖由 d4rkl0rd 于 2007-11-26 11:22 发表
(备注:修改为# ports-all之后,下面的哪个被加#表示要同步升级,没有加#的就表示不同步不升级)
加了#表示不同步吧,没加#表示要同步吧,是不是搞反了?
原帖由 2599qiang 于 2007-12-3 21:47 发表
说说源代码安装后的软件卸载怎么办啊?。。。一个一个的删?我好像就是这么做的。。有的软件有写好的。SH文件运行就可以删。。有的没有啊。。。。
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |