[[PageOutline]] = Ubuntu tips = * [http://www.ubuntulinux.jp/products/JA-Localized Ubuntuの日本語環境 | Ubuntu Japanese Team] * [https://wiki.ubuntulinux.jp/UbuntuTips/Others/BootOptions 起動オプションの設定方法 - Ubuntu Japanese Wiki] * [http://tobysoft.net/wiki/index.php?Ubuntu%2F%BC%AB%C6%B0%A5%A2%A5%C3%A5%D7%A5%C7%A1%BC%A5%C8%A4%B5%A4%BB%A4%EB Ubuntu/自動アップデートさせる - TOBY SOFT wiki] * [https://help.ubuntu.com/10.04/serverguide/C/automatic-updates.html Automatic Updates] * [https://help.ubuntu.com/community/PinningHowto PinningHowto - Community Ubuntu Documentation] * [http://netlog.jpn.org/r271-635/2009/03/linux_ubuntusysvrcinit.html (Linux) Ubuntuで不要なサービスをsysv-rc-initで無効化する (r271-635)] * [http://superuser.com/questions/86347/whats-difference-between-group-admin-and-adm ubuntu - What's difference between group admin and adm? - Super User] > The adm group is only good for viewing all the log files in /var/log (which historically used to be called /var/adm). It has no relation to sudo or root. * [http://upstart.ubuntu.com/cookbook/ Upstart Intro, Cookbook and Best Practises] * upstartのログ(実行時のconsoleログ)は /var/log/upstart/ に保存される * [http://askubuntu.com/questions/89710/how-do-i-free-up-more-space-in-boot disk usage - How do I free up more space in /boot? - Ask Ubuntu] > {{{ > sudo aptitude purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')") > }}} * 現在使用しているカーネル以外の古いカーネルを削除し、/bootの空きを増やす * update-notifier-common * ログイン時に以下の様なmotdを表示する * $ /usr/lib/update-notifier/apt-check --human-readable {{{ 0 packages can be updated. 0 updates are security updates. }}} * {{{/etc/update-motd.d/}}}以下にも追加される * [http://freearc.org/ FreeArc archiver] (i386)をUbuntu 12.04で利用する * {{{aptitude install -R ia32-libs libgmp3c2:i386}}} == インストール時に全体的に参考になるサイト == * [http://wiki.yulii.net/Ubuntu Ubuntu - RyoWiki] = hardy backports = * sudo vi /etc/apt/sources.list.d/backports.list {{{ # hardy deb http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe }}} = check update with cron = == cron-apt == * 設定が煩雑 * confが長い * 複雑なことをするには向いている * デフォルトでは、パッケージの自動ダウンロードを行うが、対象がdist-upgradeになっていて良くない == apticron == * cron-aptに比べて設定項目はかなり少ない * メール本文が冗長 == 解法 == * 参考 => [http://www.jp-z.jp/linux/apt_auto.html apt 更新通知 Debian Linux Server] * 以下のようなスクリプトを作成してcron.daily対応 => source:/lab.git/TipAndDoc/cron.daily/apt-cron {{{ #!/bin/sh set -e /usr/bin/aptitude update > /dev/null 2>&1 if [ `/usr/bin/aptitude -s -y safe-upgrade | /bin/grep -c ^0` -eq 0 ]; then /usr/bin/aptitude -s -y safe-upgrade | /bin/grep '^[ T0-9]' fi }}} * 以下のようなメールが来る {{{ /etc/cron.hourly/apt-cron: The following packages have been kept back: linux-image-server linux-server ntfs-3g The following packages will be upgraded: cron ntp ntpdate 3 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded. }}} = poweroff with power button = * [http://www.watanet.org/~chihiro/index.cgi/linux/ubuntu/20090210_ubuntu-powerbtn-hibernate.html wps-B - Ubuntuで電源ボタンを押してハイバーネーションさせる - ubuntu acpid] 1. install package => acpid 1. 必要に応じて /etc/acpi/events/powerbtn を編集 {{{ event=button[ /]power action=/etc/acpi/powerbtn.sh }}} = Wubi = * #25 * NTFS上に仮想ディスクを作り、UbuntuとWindowsをデュアルブート出来るようにするツール * https://wiki.ubuntulinux.jp/UbuntuTips/Install/WubiGuide * 「Windowsを「休止状態」->再起動->Ubuntu」は不可 * 「休止状態」にあることをWindows側のbootloaderが検知して、問答無用で休止状態から復旧するためと思われる = search header files = * [http://www1.ubuntuforums.org/showthread.php?p=1484520 Location of header file - Ubuntu Forums] > One very nice tool for finding a package for certain file is '''apt-file''' 1. $ sudo aptitude install -R apt-file {{{ apt-file curl{a} libapt-pkg-perl{a} libconfig-file-perl{a} libcurl3{a} liblist-moreutils-perl{a} }}} 1. $ sudo apt-file update {{{ Downloading complete file http://jp.archive.ubuntu.com/ubuntu/dists/lucid/Contents-i386.gz (snip) }}} 1. $ apt-file search ncurses.h {{{ doc-linux-ja-html: /usr/share/doc/HOWTO/ja-html/LFS-BOOK/appendixa/ncurses.html doc-linux-ja-html: /usr/share/doc/HOWTO/ja-html/LFS-BOOK/chapter05/ncurses.html doc-linux-ja-html: /usr/share/doc/HOWTO/ja-html/LFS-BOOK/chapter06/ncurses.html libncurses5-dev: /usr/include/ncurses.h libncursesw5-dev: /usr/include/ncursesw/ncurses.h }}} = 11.04 Natty Narwhal = == tty7 == * install from https://help.ubuntu.com/community/Installation/MinimalCD * http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/mini.iso sha1: 971f67b98323f090f3609f5c7fe78478d564122d * no login prompt[[br]][[Image(11.04-no_login_prompt.png,33%)]] * Ctrl+Alt+F1~F6でtty7以外に移れば良い * [https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/695658 Bug #695658 in grub2 (Ubuntu): “grub2 configuration has vt.handoff=7 even when X11 is not installed”] > The following line in /etc/grub.d/10_linux is present in Natty but not Maverick: > {{{ > GRUB_CMDLINE_EXTRA="$GRUB_CMDLINE_EXTRA vt.handoff=7" > }}} > And then these were the steps I took, to confirm my analysis of the bug: > 1. (1) Edit /etc/grub.d/10_linux (e.g. "sudo nano -w /etc/grub.d/10_linux") and comment out the line containing "vt.handoff", or change the number from 7 to some lower number. (I tried it both ways; they both worked.) > 1. (2) Run "sudo update-grub" to apply the new configuration. > 1. (3) Reboot. A usable virtual terminal with a login prompt comes up automatically. * [https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/761830 Bug #761830 in grub2 (Ubuntu): “grub2 still hands off to blank tty7 on non-Server command-line-only systems”] * https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/761830/comments/16 > After reading this bug I've commented out the "for word in $GRUB_CMDLINE_LINUX_DEFAULT; do" clause in /etc/grub.d/10_linux, and also changed GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub to "noplymouth" instead of "quiet splash", and now my boot is working great and I get the expected login prompt. * /etc/grub.d/10_linux {{{ for word in $GRUB_CMDLINE_LINUX_DEFAULT; do if [ "$word" = splash ]; then GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT vt.handoff=7" fi done }}} * /etc/default/grub {{{#!diff --- /etc/default/grub.bak 2011-06-01 10:28:41.785538530 +0900 +++ /etc/default/grub 2011-06-01 11:47:23.218729090 +0900 @@ -8,7 +8,7 @@ GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` -GRUB_CMDLINE_LINUX_DEFAULT="splash quiet" +GRUB_CMDLINE_LINUX_DEFAULT="noplymouth" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs }}} = 12.04 = * tasksel でsshdのみ選択した際に、追加で入れておいた方が良さそうなパッケージ * acpid ethtool git gdisk htop screen smartmontools subversion vim * locate は /usr/bin/locate -> /etc/alternatives/locate -> /usr/bin/mlocate とmlocateで提供されている * manage /etc/network/interfaces with NetworkManager * [http://www.sitepoint.com/ubuntu-12-04-lts-precise-pangolin-networking-tips-and-tricks/ Ubuntu 12.04 LTS Precise Pangolin: Networking tips and tricks - SitePoint] * [https://help.ubuntu.com/community/NetworkManager#Disabling_NetworkManager NetworkManager - Community Ubuntu Documentation] > According to [https://launchpad.net/bugs/82335 this bug] here's how to disable Network Manager without uninstalling it: > {{{ > echo "manual" | sudo tee /etc/init/network-manager.override > }}} * gnome classic (no effect) * Ubuntu Software Center から The GNOME Desktop Environment, with extra componentsをインストールする * no effectが無いgnome classicだと、ウィンドウのタイトルバーが表示されない・ウィンドウをリサイズできない・ウィンドウを移動できない、などの問題が発生した * [http://askubuntu.com/questions/131694/cannot-resize-windows-at-lower-right-corner 12.04 - Cannot resize windows at lower right corner? - Ask Ubuntu] * [http://ubuntuforums.org/showthread.php?t=1975121 (gnome) 12.04 upgrade now problems with windows and gui - Ubuntu Forums] * indicator-messages * SNSクライアントのempathyなどを起動出来る、画面右上に封筒のアイコン * ibus-mozc * [http://kronus9.sblo.jp/article/60175944.html Ubuntu 12.04のUIをGNOME Classicへ変更する: 黄昏てなんかいられない] > aptitude install gnome-panel gnome-tweak-tool > gnome-tweak-toolパッケージの追加後に、[Applications]>[System Tools]>[Preferences]>[Advanced Settings]メニューを開き、[Desktop]カテゴリ画面内の下の4つのオプションをONに変更する必要がある。 * 12.10では[Advanced Settings]の代わりに[Tweak Tool]となっている模様 == interfaces == * http://manpages.ubuntu.com/manpages/precise/man8/resolvconf.8.html * http://manpages.ubuntu.com/manpages/precise/man5/resolv.conf.5.html * [http://anonscm.debian.org/gitweb/?p=resolvconf/resolvconf.git;a=blob;f=README;hb=HEAD anonscm.debian.org Git - resolvconf/resolvconf.git/blob - README] > {{{ > * For each inet static logical interface through which a nameserver is > accessible, add lines like the following to /etc/network/interfaces . > > dns-nameservers 11.22.33.44 55.66.77.88 > dns-search foo.org bar.com > > Other recognized option words are 'dns-domain' and 'dns-sortlist'. > }}} * [http://blog.libero-tecnologia.net/?p=6 さくらのVPSでubuntu12.04にアップデートしたら、resolv.confの中身が空っぽになった件 - 流浪のプログラマのブログ] > /etc/resolvconf/resolv.conf.d/base = 12.10 = * eth0, eth1 などが無くなり、em1などとなっている * デスクトップ版をクリーンインストールした時のみ?