【zz】Ubuntu Installation

【zz】http://hi.baidu.com/jmlover/blog/item/1a24314e482153cbd1c86a0a.html
【ref】 http://hi.baidu.com/flyship163/blog/item/d24ca72f9f53743b1f3089f7.html


my

http://ppa.launchpad.net/

my

从硬盘安装DVD版ubuntu-8.04.1-dvd-i386.iso

root (hd0,4)
kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu-8.04.1-dvd-i386.iso [ quiet splash ro automatic-ubiquity locale=zh_CN.UTF-8 ]
initrd /initrd.gz

my

克隆wubi安装的ubuntu系统
(1)安装两个软件以增强硬件检测能力
         sudo apt-get install discover1 xresprobe
(2)将“ubuntu”文件夹复制到目标机某分区根目录。
(3)设置启动。修改 menu.lst 中的 UUID ,一个获得 UUID 的方法:在目标机上启动 ubuntu live cd ,运行命令 sudo ls -l /dev/disk/by-uuid ,即可看到各分区对应的 UUID 。
         实际上下面两种写法是等价的:
           root=UUID=13A0842F0E3C67D1
           root=/dev/sda6

my
Ubuntu Installation

Last updated $Date: 2007-05-22 07:21:52 $

Martti Kuparinen <>

http://www.iki.fi/kuparine/comp/ubuntu/install.html

Abstract

This is how I installed and configured my PC running Ubuntu 6.06.1 LTS. With this setup I was able remove Windows XP partition from my PC. The few programs which require a real Windows (e.g. program to update Topfield 5100 PVR’s firmware can’t be run with Wine) are executed inside VMware.


[ Please note that this page is also available in Finnish ]

[ See also My Ubuntu Server Installation with VMware Server and Encrypted directories with EncFS in My Ubuntu Installation ]


Table of Contents
1. Introduction
2. Initial install
3. Adding more software repositories
4. Installing applications
5. Installing and configuring SSH server
6. Configuring X
7. Installing VMware Workstation
8. Installing VMware Server
9. Installing VMware Player
10. DMA settings
11. Configuring firewall
12. Useful links

1. Introduction

This document and the installation helper script applies to Ubuntu 6.06.1 LTS (also known as Dapper Drake). The script also works in the newer Ubuntu 6.10 (Edgy Eft) and 7.04 (Feisty Fawn).

2. Initial install

Start by fetching the installation CD image from the Ubuntu download page. Personally I want to use the text-based installation so I used the "Alternate install CD" image. Make sure the MD5 checksum matches with the published value before burning the ISO file or the installation may fail. Reboot with the new installation CD and follow the instructions to install Ubuntu.

Before installing think few minutes how to divide the hard disk into multiple filesystems. In my opinion it’s important to have a separate filesystem for /home so it’s even possible to reinstall the whole system without moving your personal data to some temporary location before reinstall. I have two identical 250 GB SATA disks. See this page how I configured RAID-1 to have some protection agaist disk failures.

Most the following steps can be performed automatically by saving this install.sh script on your Desktop and running it inside a terminal (Applications > Accessories > Terminal). It is safe to run the script multiple times if you need to abort it at some point.

# sh ~/Desktop/install.sh

Currently the install.sh script does not install and/or configure the following applications so these must be done manually by following this document:

  • applications using Wine
  • firewall
  • VMware Workstation
  • VMware Server
3. Adding more software repositories

Login to the newly installed Ubuntu system and select Applications > Accessories > Terminal. Modify /etc/apt/sources.list and update your newly installed system. With these settings you have more applications available for download and install. Replace fi with your country code (fi = Finland, se = Sweden, …) in the following example to access the closest national mirror.

# sudo gedit /etc/apt/sources.list

deb http://fi.archive.ubuntu.com/ubuntu dapper main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu dapper main restricted

## MAJOR BUG FIX UPDATES produced after the final release
deb http://fi.archive.ubuntu.com/ubuntu dapper-updates main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu dapper-updates main restricted

## UBUNTU SECURITY UPDATES
deb http://fi.archive.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu dapper-security main restricted

## UNIVERSE AND MULTIVERSE REPOSITORY
deb http://fi.archive.ubuntu.com/ubuntu dapper universe multiverse
deb http://fi.archive.ubuntu.com/ubuntu dapper-security universe multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu dapper universe multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu dapper-security universe multiverse

## BACKPORTS REPOSITORY
deb http://fi.archive.ubuntu.com/ubuntu dapper-backports main restricted
deb http://fi.archive.ubuntu.com/ubuntu dapper-backports universe multiverse
deb-src http://fi.archive.ubuntu.com/ubuntu dapper-backports main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu dapper-backports universe multiverse

## dapper-commercial by Canonical
deb http://archive.canonical.com/ubuntu dapper-commercial main

## WINE
deb http://wine.budgetdedicated.com/apt dapper main
deb-src http://wine.budgetdedicated.com/apt dapper main

## Finnish spelling checker for OpenOffice.org
deb http://www.lemi.fi/voikko/ubuntu dapper/
deb-src http://www.lemi.fi/voikko/ubuntu dapper/

## MEDIBUNTU REPOSITORY
deb http://medibuntu.sos-sts.com/repo/ dapper free non-free
deb-src http://medibuntu.sos-sts.com/repo/ dapper free non-free

Now launch System > Administration > Synaptic Package Manager. Type your password if prompted. Press the Reload button. You will see a warning about missing repositories, this okay during the first time. Press Mark All Upgrades and press Apply if it’s enabled. You should now have the latest version of all packages. If the Apply button is not enabled it means you have nothing to upgrade, in other words you already have the latest versions installed.

4. Installing applications

Next install the following programs. The following commands should be executed on a terminal window (Applications > Accessories > Terminal).

## Some public keys
# cd /tmp
# wget http://medibuntu.sos-sts.com/repo/medibuntu-key.gpg
# sudo apt-key add medibuntu-key.gpg

# cd /tmp
# wget http://www.lemi.fi/voikko/archive-key-1.asc
# sudo apt-key add archive-key-1.asc
#
# cd /tmp
# wget http://wine.budgetdedicated.com/apt/387EE263.gpg
# sudo apt-key add 387EE263.gpg

## Language support (fi = Finnish, se = Swedish, …)
# sudo apt-get install language-pack-fi language-support-fi
# sudo apt-get install language-pack-gnome-fi

## Finnish spelling checker for OpenOffice.org
# sudo apt-get install openoffice.org-voikko

## Flash
# sudo apt-get install flashplugin-nonfree

## RealPlayer
# sudo apt-get install realplay
or
# sudo apt-get install helix-player mozilla-helix-player

## Acroread
# sudo apt-get install acroread
# sudo apt-get install mozilla-acroread
# sudo apt-get install acroread-plugins

## Java
# sudo apt-get install sun-java5-jre sun-java5-fonts sun-java5-plugin
# sudo update-alternatives –set java /usr/lib/jvm/java-1.5.0-sun/jre/bin/java

## Multimedia Codecs
# sudo apt-get install w32codecs
# sudo apt-get install gstreamer0.10-plugins-base
# sudo apt-get install gstreamer0.10-plugins-good
# sudo apt-get install gstreamer0.10-plugins-ugly
# sudo apt-get install gstreamer0.10-plugins-ugly-multiverse
# sudo apt-get install gstreamer0.10-plugins-bad
# sudo apt-get install gstreamer0.10-plugins-bad-multiverse
# sudo apt-get install gstreamer0.10-pitfdll
# sudo apt-get install gstreamer0.10-gl
# sudo apt-get install gstreamer0.10-ffmpeg
# sudo apt-get install vorbis-tools
# sudo apt-get install lame
# sudo apt-get install sox
# sudo apt-get install ffmpeg
# sudo apt-get install mjpegtools

## DVD playback
# sudo apt-get install libdvdcss2
# sudo apt-get install libdvdread3
# sudo apt-get install libdvdplay0
# sudo apt-get install libdvdnav4
# sudo apt-get install totem-xine
# sudo apt-get install libxine-extracodecs
# sudo apt-get install totem-xine-firefox-plugin
# sudo apt-get install vlc
# sudo apt-get install mplayer

## CD/DVD burning
# sudo apt-get install gnomebaker
# sudo apt-get install k3b
# sudo apt-get install k3b-i18n
#
# cd /tmp
# wget ftp://ftp4.usw.nero.com/nerolinux-2.1.0.4b-x86.deb
# sudo apt-get install libgtk1.2
# sudo dpkg -i nerolinux-2.1.0.4b-x86.deb

## Thunderbird
# sudo apt-get install mozilla-thunderbird
# sudo apt-get install mozilla-thunderbird-enigmail

## Wine
# sudo apt-get install wine msttcorefonts

## Compilers and manual pages
# sudo apt-get install build-essential manpages-dev

## serveral games
# sudo apt-get install btanks
# sudo apt-get install gnome-games sgt-puzzles

## Opera
# sudo apt-get install opera

## NFS, NIS and NTP
# sudo apt-get install nfs-common
# sudo apt-get install nis
# sudo apt-get install ntp

## NTFS filesystem with read/write support
# sudo apt-get install ntfs-config
# sudo ntfs-config

## Rootkit detection
# sudo apt-get install chkrootkit rkhunter
# chkrootkit
# rkhunter –checkall5. Installing and configuring SSH server

Next install and configure SSH server to allow only your normal users to login. If your system has usernames jane and john make sure /etc/ssh/sshd_config has these lines. Launch Applications > Accessories > Terminal. Modify the settings and restart the SSH server.

# sudo apt-get install openssh-server
# sudo gedit /etc/ssh/sshd_config

Protocol 2

PermitRootLogin no

AllowUsers jane john

# sudo /etc/init.d/ssh restart6. Configuring X

If you have an NVIDIA graphics card (I have GeForce FX 5200) it might be a good idea to install the accelerated driver for X. Otherwise the screen might be the bottleneck when using graphics intensive applications like DVD players and games.

# sudo apt-get install nvidia-glx nvidia-kernel-common
# sudo nvidia-glx-config enable

For ATI cards, type the following commands:

# sudo apt-get install xorg-driver-fglrx
# sudo dpkg-reconfigure xserver-xorg
## Select the "fglrx" driver instead of "ati"

# sudo gedit /etc/X11/xorg.conf
## Make sure you have the following settings
Section "Device"
Identifier "ATI Graphics Adapter"
Driver fglrx"
Option "VideoOverlay" "on"
BusID "PCI:1:0:0"
EndSection

After reboot you can test that the accelerated driver is really used with the following command:

# glxinfo | grep -i direct
direct rendering: Yes

At work I also have NVIDIA GeForce FX 5200 (with one DVI and one VGA connector) and two 20" Dell 2007FP TFTs. As I write code during day time it’s nice to have two monitors side by side forming a big desktop, one for writing code and compiling the code, and the other for debugging with DDD and network monitoring with wireshark. I got TwinView working with this xorg.conf file.

7. Installing VMware Workstation

VMware Workstation is a commercial virtualization software which enables you to run Windows on your Linux PC.

# sudo apt-get install build-essential linux-headers-uname -r

# tar xzf VMware-workstation-6.0.0-45731.i386.tar.gz -C /tmp
# cd /tmp/vmware-distrib
# sudo ./vmware-install.pl8. Installing VMware Server

VMware Server is a free software which enables you to run Windows on your Linux PC. See a separate document how I installed VMware Server. Please note that unlike with VMware Player, you can create virtual machines with VMware Server.

9. Installing VMware Player

VMware Player is a free software which enables you to run Windows on your Linux PC. This needs an existing virtual machine which can be created with the non-free VMware Workstation, with the free QEMU and with the free VM Builder.

Note: VMware Workstation installs also the VMware Player so these steps are only needed if you don’t have a VMware Workstation license.

# sudo apt-get install vmware-player10. DMA settings

IDE hard disk and IDE CD-ROM

# sudo gedit /etc/hdparm.conf

# In this example /dev/hda is the hard disk
/dev/hda {
io32_support = 1
dma = on
}

# In this example /dev/hdc is the CD-ROM
/dev/hdc {
io32_support = 1
dma = on
}

# sudo /etc/init.d/hdparm restart

SATA hard disk and IDE CD-ROM

# sudo gedit /etc/hdparm.conf

# In this example /dev/hdc is the CD-ROM
/dev/hdc {
io32_support = 1
dma = on
}

# sudo /etc/init.d/hdparm restart

Test the DMA settings with

# sudo hdparm /dev/hdc

/dev/hdc:
IO_support = 1 (32-bit)
unmaskirq = 0 (off)
using_dma = 1 (on)
keepsettings = 0 (off)
readonly = 0 (off)
readahead = 256 (on)
HDIO_GETGEO failed: Invalid argument11. Configuring firewall

Even though Ubuntu does not listen to any non-localhost ports by default I want to limit how my PC is visible to others. This is done by using the standard iptables firewall which is included in the Ubuntu installation. You could of course install Firestarter or GuardDog from the Synaptic package manager but I prefer a simple textfile-based solution.

Download this firewall script to your Desktop and modify it according to your network settings.

# gedit ~/Desktop/firewall

# sudo cp ~/Desktop/firewall /etc/init.d/firewall
# sudo chmod 755 /etc/init.d/firewall
# sudo ln -sf ../init.d/firewall /etc/rcS.d/S42firewall
# sudo /etc/rcS.d/S42firewall restart12. Useful links