{{outline}} !!Links * http://www.freebsd.org/ ** 現在はFreeBSD 9.0-RELEASEが最新 //** 開発版は 9.0-RC2: ftp://ftp8.jp.freebsd.org/pub/FreeBSD/releases/amd64/amd64/ISO-IMAGES/9.0/ (ISOイメージディレクトリ例) ** ftp://ftp.jp.freebsd.org/pub/FreeBSD/releases/ISO-IMAGES/9.0/ *[FreeBSD 基本設定|http://www.db.is.kyushu-u.ac.jp/computer/freebsd/FreeBSD_setup.html] *[FreeBSDをlaptopで使うなら|http://trombik.mine.nu/~cherry/w/index.php/2007/09/20/1076/freebsd-laptop] *http://jp.youtube.com/bsdconferences *http://yyokota.jp/ub2/search.cgi?query=freebsd&button=search !!cvsup -> csup / portsnap 現在ではcvsupは使う必要は無くなった. *kernel関係: csup へ移行 *ports関係: portsnap へ移行 !! OS update ! ソースアップデート (using csup, cvsup) ソースからコンパイルする方法. 昔は cvsup で /usr/src を更新していたが,現在は csup を用いるようになった. csup は FreeBSD 6 以降 base system に含まれている.使い方は cvsup と同じ. *http://mu.org/~mux/csup.html *http://www.seichan.org/wiki/index.php?FreeBSD-CVSup * メジャーバージョンを2つ以上上げたい場合 ** 基本的に,一気にメジャーバージョンを2つ以上上げようとすると失敗する.例えば,Version 6.x -> 8.x と更新したい場合は,6.x -> 7.x -> 8.x の順に更新する. *http://www.mail-archive.com/freebsd-questions@freebsd.org/msg225203.html cd /usr/src make buildworld make buildkernel KERNCONF=??? make installkernel KERNCONF=??? shutdown -r now cd /usr/src make installworld mergemaster shutdown -r now ! バイナリアップデート (using freebsd-update) バイナリアップデートの方法. 基本パターン freebsd-update -r 8.0-RELEASE upgrade freebsd-update install shutdown -r now freebsd-update install (これ以降は検討の余地あり) portsnap fetch portsnap update portupgrade -afP --batch --results-file /tmp/ports.results.txt *参考:[FreeBSD 7.0 へようこそ:第3回 freebsd-updateで楽々リリースサーフィン|gihyo.jp … 技術評論社|http://gihyo.jp/admin/feature/02/freebsd-7/0003] *最後にパッケージ全入れ替えが必須になるので注意. !!/etc/rc.conf keymap="jp.106x" sendmail_enable="NO" saver="logo" !!wlan kldload wlan_wep ifconfig wi0 authmode open wepmode on ssid xxx wepkey xxx weptxkey 1 dhclient wi0 !!ports ! 更新作業 (using portsnap) * portsnapの利用 portsnap fetch portsnap update * References ** http://journal.mycom.co.jp/articles/2005/11/07/freebsd/002.html ** http://wiki.fdiary.net/BSDmad/?portsnap ! 設定 (/etc/make.conf) * /etc/make.conf MASTER_SITE_BACKUP?=ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ MASTER_SITE_OVERRIDE?=ftp://ftp.jp.FreeBSD.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ * この作業をしておかないとダウンロード先が近場にならず,時間がかかるようになる. !最初にインストールするもの *sudo, screen, unzip, fd *kterm, mlterm, rxvt, pkg_replace, portupgrade, wget, ncftp *ja-lynx, ja-ng *emacs, ja-ddskk, ja-dbskkd-cdb, ja-skk-jisyo, mew, emacs-w3m (w3m-m17n が依存で入る) *rdesktop, tightvnc *icewm, tgif, xfig *ja-less, lv *ja-tetex, ja-platex-jsclasses, latex-mathabx, yatex, texmacs, cjk-lyx, tgif2tex, detex, ja-latex2html, dvipdfmx, ja-dvi2tty, ghostview, gv, psutils-a4 *fget, pdumpfs *screenはpackageにできないのでportsからインストール *ja-plain2はgcc 4.2でコンパイルできない *cjk-lyxはpackagesに含まれない? //*emacs22を入れるとmew, auctexが対応していない→mewについては6.1を手動インストール //**http://www.mew.org/ ! Apache apache の更新は apr まわりでトラブルが発生しやすいように思われる. * apr の更新 cd /usr/ports/devel/apr1 make config (LDAPまわりでエラーが出るときなどはLDAPのオプションを有効にする) make pkg_deinstall <古いapr> (パッケージ名の変更により make deinstall できない場合あり) make install clean * mod_ldap (in httpd.conf) LoadModule ldap_module libexec/apache22/mod_ldap.so * References ** http://wiki.livedoor.jp/repeatedly/d/FreeBSD/Apache ! phpPgAdmin PHPのバージョンとphpPgAdminが想定しているPHPのバージョンの違いによるトラブルあり. * References ** http://d.hatena.ne.jp/takuya6/20091116/1258345082 !rdesktop うまくportupgradeできない場合下記のようにする portupgrade -M 'CPPFLAGS=-I/usr/local/include' rdesktop *参考: http://lists.freebsd.org/pipermail/freebsd-ports/2005-May/023385.html !portaudit (security) * [ttt: (FreeBSD) portauditでportsのセキュリティチェック|http://nhh.mo-blog.jp/ttt/2006/03/freebsd_portaud_9a59.html] ** excerpts *** portauditをインストールすると、/usr/local/etc/periodic/security/410.portaudit というファイルが作られ、これにより、cronでdailyが実行されるときに、ついでにportauditも実行されるようになります。 *** portauditでプロキシーサーバを指定する *[portauditの警告を無視してportsをインストールする|http://masken.jp/archives/000170.html] **make -DDISABLE_VULNERABILITIES // setenv DISABLE_VULNERABILITIES **pkg_replace -m -DDISABLE_VULNERABILITIES foo !memo *[Speed up installing from ports (howto) | FreeBSD - the unknown Giant|http://www.freebsdnews.net/2008/11/24/speed-installing-ports-howto/] *checksum無視 **make NO_CHECKSUM=yes *ftp/ftpcube (FTP client with GUI) *graphics/zphoto (写真一覧WWWページ作成) *deskutils/alexandria (ISBN等で図書管理) **devel/ruby-zoom (http://ruby-zoom.rubyforge.org/ ) に依存しているが Makefile に記述されていないようなので手動で別途インストールする必要あり *multimedia/vlc (Video LAN client) **依存関係たくさんあり *www/youtube_dl *LaTeX情報 **http://oku.edu.mie-u.ac.jp/~okumura/texwiki/?FreeBSD **上記ページの内容は少々古いので注意. !!X Window customization ! xorg.conf *Swap CTRL-CAPS **Option "XkbOptions" "ctrl:swapcaps" *Japanese keyboard **Option "XkbModel" "jp106" **Option "XkbLayout" "jp" *wheel mouse Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/sysmouse" Option "ZAxisMapping" "4 5 6 7" EndSection *[【FreeBSD】Matrox Millennium G550をX.org 7.2で利用する|http://www.kishiro.com/FreeBSD/workaround_mgag550_xorg7.html] **/usr/local/lib/modules/drivers/{mga_drv.so,mga_hal_drv.so} **/usr/local/lib/xorg/modules/drivers ! xmodmap (keyboard) * cf. [X Windowのキーバインドをカスタマイズ | Linuxで自宅サーバ構築|http://linuxserver.jp/Linux/%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E7%94%A8%E9%80%94/X%20Window%E3%81%AE%E3%82%AD%E3%83%BC%E3%83%90%E3%82%A4%E3%83%B3%E3%83%89%E3%82%92%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BA.php] !!Setup !gdm /etc/rc.conf: gdm-enable=YES !clips [FreeBSD-users-jp 89010] 無線 LAN 接続不可 /etc/rc.conf の ifconfig_wi0 の指定で ifconfig の起動時指定ができるの で,/etc/rc.conf で ifconfig_wi0="inet 192.168.0.100/24 ssid ESSID weptxkey 1 wepkey 1:WEPKEY wepmode on" とした方が設定が分散せずメンテしやすいかと思います. !!admin !lsof *http://gihyo.jp/admin/clip/01/fdt/200902/03 **lsof alternatives on FreeBSD ***オープンされているファイル,ソケット,パイプの上表を表示するツールにlsof(sysutils/lsof)があります。lsof alternatives on FreeBSDにおいてLevent Serinol氏が,FreeBSDはデフォルトインストールでfstat(1)とsockstat(1)がインストールされておりツールとして使える旨が報告されています。 !swap file *http://www.jp.freebsd.org/QandA/HTML/2441.html !Disk copy 故障したハードディスクのデータをコピー *recoverdisk (/sbin/recoverdisk) **FreeBSD LiveCDから利用可能 *ddrescue (sysutils/ddrescue) *dd_rescue(sysutils/dd_rescue) !Disk backup *http://www.freebsd.org/doc/ja/books/handbook/backup-basics.html **15.9. バックアップの基本 # /sbin/dump -0uan -f - /usr | gzip -2 | ssh1 -c blowfish \ targetuser@targetmachine.example.com dd of=/mybigfiles/dump-usr-l0.gz *ports/sysutils/ufs_copy + Freesbie **http://people.freebsd.org/~simokawa/ufs/ //*http://www.drive.ne.jp/iMA/showmail.pl?FreeBSD-users-jp=72376 **http://groups.google.com/group/ml.freebsd-users/msg/f6fe54630f09367a?dmode=source&output=gplain !Disk replacement *[FreeBSD QandA 1859|http://www.jp.freebsd.org/QandA/HTML/1859.html] **Q. FreeBSDのインストールが終った HDD を まるごとコピーしたいのですが、具体的な手順を教えてください。 !CPU調査・管理 *sysutils/cpuburn *sysutils/fvcool (i386 only) *sysutils/x86info *misc/cpuid *man cpufreq (sysutils/est) !!using USB-Serial cable (ELECOM UC-SGT) !/boot/loader.conf ucom_load="YES" uplcom_load="YES" !dmesg ucom0: on uhub0 ucom0: vendor 0x056e product 0x5003, rev 1.10/0.01, addr 2 !access % sudo cu -l /dev/cuaU0 *cuの終了: ~. !References *http://home.jp.freebsd.org/cgi-bin/showmail/FreeBSD-users-jp/80725 !!Japanese !xpdf *japanese/xpdf *print/adobe-cmaps /usr/local/etc/xpdfrc に下記を追加しないと日本語表示ができない cMapDir Adobe-Japan1 /usr/local/share/fonts/adobe-cmaps/aj16/CMap/ cMapDir Adobe-Japan1 /usr/local/share/fonts/adobe-cmaps/aj20/CMap/ *参考 **http://hsdiary.blogspot.com/2006/10/ja-xpdf-font-problem-2.html **http://www.int.otaru-uc.ac.jp/lyx-howto/writing/pdf *pdftotext **http://www.atmarkit.co.jp/flinux/rensai/linuxtips/745textfpdf.html !!Misc. !xz trouble portsでコンパイルするとxzのメモリ制限関係のエラーが出ることがある.xzのオプション設定で対処可能だが,setenv XZ_OPT ではなぜかうまくいかないので, /usr/ports/Mk/bsd.commands.mk を直接編集するのがとりあえずの対処. (http://forums.freebsd.org/showthread.php?t=15522 から抜粋) * /usr/ports/Mk/bsd.commands.mk ... .if exists(/usr/bin/xz) XZ_CMD?= /usr/bin/xz -Mmax .else XZ_CMD?= ${LOCALBASE}/bin/xz -Mmax .endif ... !trace tools *truss *ktrace *strace (ports) !pkgdel echo sudo pkg_delete -f `pkg_info | awk '{print $1}' | egrep $1` !pkgver pkg_version -v | egrep -v up-to-date awk 'BEGIN {print "sudo portupgrade -pO \\"} \!/^#/ {print $1 " \\"}' awk 'BEGIN {print "sudo portupgrade -pO \\"} \!/^#/ {if ($1 != "") {print $1 " \\"}}' !dmesg /var/run/dmesg.boot !Xinput *http://xjman.dsl.gr.jp/XF32/RELNOTE-3.html *http://www2.tky.3web.ne.jp/~mizk/xinput/XInput-HOWTO-3.html *http://www.gtk.org/~otaylor/xinput/ *http://ftp.x.org/pub/X11R7.1/doc/RELNOTES3.html#7 !USB Camera *http://www.medias.ne.jp/~takam/bsd/NetBSD.html !sendmail */etc/mail/freebsd.mc をコピー *cp freebsd.mc foo.mc *dnl define(`SMART_HOST', `your.isp.mail.server') の行を有効化,SMTPサーバ名記入 *make foo.cf *cp foo.cf sendmail.cf */etc/rc.d/sendmail stop */etc/rc.d/sendmail start */etc/hosts, /etc/mail/local-host-names を適宜修正 **http://www.fmmc.or.jp/~fm/nwts/rh_linux/ch3/3_2_2_3.html **ローカル宛メール対策 *esmtpの利用も検討 (flexibility) **http://esmtp.sourceforge.net/ **http://esmtp.sourceforge.net/manual.html#id47331 !USB-serial *ELECOM UC-SGT **man 4 uplcom **http://www.mail-archive.com/freebsd-users-jp@jp.freebsd.org/msg00925.html !updating gnome /usr/X11R6/lib/libgtk-x11-2.0.la: No such file or directory *http://pc8.2ch.net/test/read.cgi/unix/1161524086/177-179 /usr/ports/UPDATING 見て下さい。 gnome 2.16 になって、/usr/X11R6 から/usr/local と GNOME components が移動しています。 真っ当な対処法は時間はかかりますが pkgdb -Ff portupgrade -rf pkg-config\* ===================================== 20061014: AFFECTS: All GTK+2 and GNOME users AUTHOR: gnome@FreeBSD.org GNOME has been updated to 2.16. All GTK+2 and GNOME components have been moved from X11BASE (/usr/X11R6) to LOCALBASE (/usr/local). To upgrade your GNOME desktop or/and other applications you will need to use either sysutils/portupgrade or sysutils/portmaster. To use portmaster, make sure you have least 1.9 version to have the upgrade succeed. Portupgrade users: pkgdb -Ff portupgrade -rf pkg-config\* Portmaster users: portmaster -r pkg-config\* !ezjail *[google|http://www.google.co.jp/search?q=ezjail&lr=lang_ja&ie=utf-8&oe=utf-8&rls=org.mozilla:ja:official&client=firefox] *[void GraphicWizardsLair( void ); // ezjailを使った時の/usr/ports共有設定メモ|http://www.otsune.com/diary/2006/11/13/2.html#200611132] !時計問題 *[ttt: (VMware) FreeBSD 6.1-RELEASEをアップグレード・インストール|http://nhh.mo-blog.jp/ttt/2006/05/vmware_freebsd__f627.html] /boot/loader.conf hint.apic.0.disabled="1" /etc/sysctl.conf kern.timecounter.hardware=i8254 FIVA102S + FreeBSD-6.2-RELEASE では時計が進む問題があったが,上記2点とも設定しないと改善しなかった(sysctl.confのみのケースは試していない). FIVA206 + FreeBSD-7.0-CURRENT でも同様の問題があったが,sysctl.confのみ設定してみたところ症状が治まった.102Sでもloader.confの設定は無くても大丈夫かもしれない. !PPTP client http://seclan.dll.jp/ccilmyip.htm !screen .screenrc escape ^z^z *最近はtmuxらしい !tmux (sysutils/tmux) *http://tmux.sourceforge.net/ *[時代はGNU screenからtmuxへ|http://d.hatena.ne.jp/tmatsuu/20090709/1247150771] **キーマップ一覧あり !IPv6 related *[FreeBSD で IPv6 |http://www.exp.org/ipv6/freebsd.html] **/etc/rc.conf ipv6_enable="YES" ipv6_network_interfaces="fxp0" *[Invalid argument or cannot assign requested address|http://highbridge.air-nifty.com/blog/2006/03/invalid_argumen.html] **keywords: Java, IPv6, JDBC -Djava.net.preferIPv4Stack=true !Linux watch command /usr/ports/sysutils/cmdwatch が同じ機能 * http://lists.freebsd.org/pipermail/freebsd-chat/2005-February/003122.html