Ubuntu9.10安装全攻略

需要面对面帮助?请寻求当地校园社团支持!
回复
头像
netstat
帖子: 104
注册时间: 2009-09-11 13:10
联系:

Ubuntu9.10安装全攻略

#1

帖子 netstat »

如今自己已经安装了十几次ubuntu,每次的基本过程都类似,所以总结出一些经验供大家参考,而且自己写了几个脚本方便大家安装时少走些弯路,说些题外话吧,经过自己的大力推广,班上1/4的同学安装了ubuntu9.10,可见如果大家只要稍稍了解ubuntu,都会有想安装的冲动,也就此给出一种方法:
针对的是Intel的CPU,而GPU无论是ATI还是Nvidia无关紧要。
基本的操作系统安装好了之后的第一件事(初始的前提是网络是通畅的)是更新apt-get的源,由于默认的更新源的速度不怎么快,所以推荐加入163的更新源(当然啊只是在电信网络下很快,教育网就不清楚了),因此自己写了个脚本,update_apt-get_sources.sh ,然后在终端下

代码: 全选

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
cd /etc/apt/
sudo echo "
#deb cdrom:[Ubuntu 9.10 _Karmic Koala_ - Release i386 (20091028.2)]/ karmic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ karmic-backports main restricted universe multiverse

deb http://tw.archive.ubuntu.com/ubuntu/ karmic main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ karmic-updates universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ karmic-proposed universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ karmic-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ karmic-backports main multiverse restricted universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-proposed universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ karmic-backports universe main multiverse restricted

deb http://cn.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic main restricted

## Major bug fix updates produced after the final release of the
## distribution.

deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://cn.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic universe
deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://cn.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://cn.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ karmic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu karmic partner
# deb-src http://archive.canonical.com/ubuntu karmic partner

deb http://security.ubuntu.com/ubuntu karmic-security main restricted
deb-src http://security.ubuntu.com/ubuntu karmic-security main restricted
deb http://security.ubuntu.com/ubuntu karmic-security universe
deb-src http://security.ubuntu.com/ubuntu karmic-security universe
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb-src http://security.ubuntu.com/ubuntu karmic-security multiverse
" >sources.list
sudo apt-get update
于是第一件事就完成了。
然后,知道要做什么吗,个人觉得就是为firefox安装flash插件了,现在哪个网页不用flash技术,于是就写了第二个脚本

代码: 全选

#!/bin/sh

cd /tmp
wget -c http://archive.ubuntu.com/ubuntu/pool/multiverse/f/flashplugin-nonfree/flashplugin-nonfree_10.0.32.18ubuntu1_i386.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/multiverse/f/flashplugin-nonfree/flashplugin-installer_10.0.32.18ubuntu1_i386.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/main/g/gsfonts-x11/gsfonts-x11_0.21_all.deb
sudo dpkg -i gsfont*.deb
sudo dpkg -i flash*.deb
echo "安装flash插件完成"
cd /etc/fonts/conf.d/
sudo echo "<?xml version=\"1.0\"?>
<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">
<fontconfig>
<!--
  If the font still has no generic name, add sans-serif
 -->
	<match target=\"pattern\">
		<test qual=\"all\" name=\"family\" compare=\"not_eq\">
			<string>sans-serif</string>
		</test>
		<test qual=\"all\" name=\"family\" compare=\"not_eq\">
			<string>serif</string>
		</test>
		<test qual=\"all\" name=\"family\" compare=\"not_eq\">
			<string>monospace</string>
		</test>
		<edit name=\"family\" mode=\"append_last\">
			<string>sans</string>
		</edit>
	</match>
</fontconfig>" >49-sansserif.conf
echo "配置flash插件完成"
,这个脚本同时把另一个严重的问题解决了,那就是浏览器下flash出现乱码的情况。
还有几件重要的事需要解决,显卡的驱动,能不能装成功真的要看人品了,有人把系统装崩了,而自己是基本上成功,用起来没啥问题。再就是开特效,进入“系统 》首选项 》外观 》视觉效果 》扩展”,就好了,在关这个窗口的瞬即,你就会感受到效果的震撼,同时推荐一款ubuntu下的管理软件 Ubuntu Tweak ,自己也写了个脚本,直接

代码: 全选

cd /tmp
wget -c http://launchpad.net/ubuntu-tweak/0.4.x/0.4.9.2/+download/ubuntu-tweak_0.4.9.2-1~karmic1_i386.deb
sudo dpkg -i ubuntu-tweak_0.4.9.2-1~karmic1_i386.deb
echo "Ubuntu Tweak 安装完成"
安装好了ubuntu tweak 之后,可以在应用程序中打开它,在其中你可以做很多配置上的个性化,只要你喜欢,找到CompizConfig,也就可以更改桌面特效了。
再就是安装mplayer,如果不介意可以把下面作为一个脚本运行,

代码: 全选

#!/bin/bash

sudo apt-get install mplayer mplayer-fonts
cd /etc/mplayer/
sudo cp mplayer.conf mplayer.conf.backup
sudo echo "
#
# MPlayer configuration file
#
# Configuration files are read system-wide from /etc/mplayer/mplayer.conf
# and per user from ~/.mplayer/config, where per-user settings override
# system-wide settings, all of which are overrriden by the command line.
#
# The configuration file settings are the same as the command line
# options without the preceding '-'.
#
# See the CONFIGURATION FILES section in the man page
# for a detailed description of the syntax.


##################
# video settings #
##################

# Specify default video driver (see -vo help for a list).
vo=xv,x11

# FBdev driver:
#
# mode to use (read from fb.modes)
#fbmode = 640x480-120
#
# location of the fb.modes file
#fbmodeconfig = /etc/fb.modes

# Specify your monitor timings for the vesa and fbdev video output drivers.
# See /etc/X11/XF86Config for timings. Be careful; if you specify settings
# that exceed the capabilities of your monitor, you may damage it.
#
# horizontal frequency range (k stands for 1000)
#monitor-hfreq = 31.5k-50k,70k
#
# vertical frequency range
#monitor-vfreq = 50-90
#
# dotclock (or pixelclock) range (m stands for 1000000)
#monitor-dotclock = 30M-300M

# Start in fullscreen mode by default.
#fs=yes

# Change to a different videomode when going fullscreen.
#vm=yes

# Override the autodetected color depth, may need 'vm=yes' as well.
#bpp=0

# Enable software scaling (powerful CPU needed) for video output
# drivers that do not support hardware scaling.
zoom=yes

# standard monitor size, with square pixels
#monitoraspect=4:3

# Use this for a widescreen monitor, non-square pixels.
#monitoraspect=16:9

# Keep the player window on top of all other windows.
#ontop=yes


##################
# audio settings #
##################

# Use pulse, then alsa, then SDL video with the aalib subdriver by default.
ao=alsa,pulse,sdl:aalib

# Use SDL audio driver with the esd subdriver by default.
#ao = sdl:esd

# Specify the mixer device.
mixer = /dev/mixer

# Resample the sound to 44100Hz with the lavcresample audio filter.
af=lavcresample=44100


##################
# other settings #
##################

stop-xscreensaver=yes

# Pretend to be Window Media Player.
# Fixes playback when playlist and media file use the same URL.
#user-agent=NSPlayer/4.1.0.3856

# Drop frames to preserve audio/video sync.
#framedrop = yes

# Specify your preferred skin here (skins are searched for in
# /usr/local/share/mplayer/skins/<name> and ~/.mplayer/skins/<name>).
#skin = Abyss

# Resample the font alphamap.
# 0     plain white fonts
# 0.75  very narrow black outline (default)
# 1     narrow black outline
# 10    bold black outline
#ffactor = 0.75

# cache settings
#
# Use 8MB input cache by default.
cache = 8192
#
# Prefill 20% of the cache before starting playback.
cache-min = 20.0
#
# Prefill 50% of the cache before restarting playback after the cache emptied.
cache-seek-min = 50

# DVD: Display English subtitles if available.
#slang = en

# DVD: Play English audio tracks if available.
#alang = en

###################
# DVDNAV Settings #
###################
#vc=ffmpeg12,

# You can also include other configuration files.
#include = /path/to/the/file/you/want/to/include
" >mplayer.conf
cd /tmp/
wget -c ftp://ftp.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
wget -c http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
tar jxvf essential-20071007.tar.bz2
tar jxvf all-20071007.tar.bz2
sudo mkdir /usr/lib/codecs/
sudo mv essential*/* /usr/lib/codecs/
sudo mv all-2007*/* /usr/lib/codecs/
sudo apt-get install mozilla-mplayer
echo "安装结束"

如果这时候播放视频还有问题,那么只要配置一下mplayer的preferences中的Audio或者Video,大多数问题可能是没有声音,那么就在Audio的选项中切换,完后重新打开mplayer 就没什么问题了。
再就是播放音乐,请参阅http://wiki.ubuntu.org.cn/index.php?tit ... iant=zh-cn中的信息。
还要说明一下自动挂载硬盘的事,先

代码: 全选

ls -al /dev/disk/by-uuid
查看硬盘上各个分区的UUID,再在/etc/fstab中进行修改,那么开机时就自动加载了,最后是美化grub(只要你喜欢,可以改变grub启动的背景)http://www.zhanggy.com/blog/grub2%E9%85 ... 6%E8%A7%A3
华科一小生
头像
netstat
帖子: 104
注册时间: 2009-09-11 13:10
联系:

Re: Ubuntu9.10安装全攻略

#2

帖子 netstat »

好的技术,需要顶起来
华科一小生
头像
netstat
帖子: 104
注册时间: 2009-09-11 13:10
联系:

Re: Ubuntu9.10安装全攻略

#3

帖子 netstat »

有机会 了 :em11
华科一小生
回复