wiki:TipAndDoc/Linux/Ubuntu

Version 28 (modified by mitty, 11 years ago) (diff)

--

Ubuntu tips

インストール時に全体的に参考になるサイト

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に比べて設定項目はかなり少ない
  • メール本文が冗長

解法

  • 以下のようなスクリプトを作成してcron.daily対応 => source:/trunk/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

  1. install package => acpid
  2. 必要に応じて /etc/acpi/events/powerbtn を編集
    event=button[ /]power
    action=/etc/acpi/powerbtn.sh
    

Wubi

  • 「Windowsを「休止状態」->再起動->Ubuntu」は不可
    • 「休止状態」にあることをWindows側のbootloaderが検知して、問答無用で休止状態から復旧するためと思われる

search header files

  • 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}
      
    2. $ sudo apt-file update
      Downloading complete file http://jp.archive.ubuntu.com/ubuntu/dists/lucid/Contents-i386.gz
      
      (snip)
      
    3. $ 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

  • /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
    • /etc/default/grub

      old new  
      88GRUB_HIDDEN_TIMEOUT_QUIET=true 
      99GRUB_TIMEOUT=10 
      1010GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` 
      11 GRUB_CMDLINE_LINUX_DEFAULT="splash quiet" 
       11GRUB_CMDLINE_LINUX_DEFAULT="noplymouth" 
      1212GRUB_CMDLINE_LINUX="" 
      1313 
      1414# Uncomment to enable BadRAM filtering, modify to suit your needs 

12.04

interfaces

12.10

  • eth0, eth1 などが無くなり、em1などとなっている

Attachments (1)

Download all attachments as: .zip