Ubuntu10.04重装注意事项
李顺亮
2011年2月14日12:00
虽然Ubuntu10.04非常稳定,但是我们总有受到诱惑、塞翁失马的时候。我就因为要在Ubuntu10.04中,把pdf文件转换成swf文件,冒失安装swftools,于是下了一个tar.gz包,自行在终端里编译,结果在开机时进不了密码登录窗口。尝过了信心十足带来的悲剧之后,最终决定求人不如求己,选择以速度最快的方式——重装,来解决自己的烦恼。
先来一番感叹好了。在ubuntu的世界里,还是deb包是我们的最爱。虽然自觉已经有些老练,但是自行编译总是难免出现这样那样的问题,主要根源在于缺少这个那个依赖。可是,我们安上这个依赖,那个依赖之后,仍然无法确保安装成功,那又是软件本身有缺陷的问题了。于是,重启电脑之后,一旦出了问题,我们似乎很难回头。
在电脑的世界里,追新总要付出代价,这是没有办法的事。可是,在linux的世界里,deb包仍然不是那么普遍,甚至可以说不受重视。随便举个例子吧,火狐的每日版,就没有deb包。当然,火狐选择一解压就可以使用的压缩包,也有它出于方便网友的考虑。另外,用源来安装火狐每日版,也很方便。而fcitx居然不出deb包了,这是我最气愤的。
fcitx官方说因为推出了ppa源,可是我们加上源后,发现这个源似乎有问题。于是,只好转向下了tar.gz安装包自行编译,又说缺少zlib依赖,缺少另一个什么依赖,在新利得软件包管理器里搞定依赖之后,最后总算编译安装了fcitx。可一重启电脑,又是一个悲剧,直接一夜回到解放前,进入了无图的终端时代。
重装吧,还给自己一个清静而美丽的世界。这是全面告别微软系统后,早已久违的事情。对本次重装的注意事项,专程记录如下:
一、保留/home分区数据重装系统
Windows系统可以在重装时只格式化C盘,从而保留其他分区的数据。Ubuntu系统也可以,只要你原来在安装系统时,曾经单独分出过一个/home分区。你可以把Ubuntu的“/”分区看为Windows的C盘,重装Ubuntu时只格式化“/”分区,不格式化“/home”,这样就可以保留“/home”中的数据了。
1、备份数据。虽然这样重装理论上不会破坏你的文件,但有时候一些意外的情况(比如误操作或系统有bug)会导致数据丢失。所以还是强烈建议备份你的如下重要文件:
a、主文件夹里的文件(包括视频、图片、文档、音乐等文件夹)。
主文件夹里有很多以“.”开头的隐藏文件夹和隐藏文件(按Ctrl+H键即可显示),这些是系统和各个应用程序的配置信息,如果你想重装系统后使用原来的配置的话,把这些隐藏文件夹和隐藏文件一起备份即可。
b、存在桌面的文件。
c、Firefox、Chrome、Opera等浏览器的书签。
d、VirtualBox等虚拟机软件的设置。
e、电子邮件和通讯簿(Evolution或Mozilla Thunderbird的)。
f、网络设置(如ADSL用户名和密码、网卡属性的Internet协议(TCP/IP)的IP地址和DNS服务器地址设置、浏览器的局域网设置或代理服务器设置)。
g、聊天记录(QQ、MSN......的)。
h、其他你觉得需要备份的数据。
注意:备份数据后,请立刻把移动硬盘从电脑上拔出,以免在安装系统时对移动硬盘进行误操作!
2、删除旧的配置文件
Ubuntu的配置信息存放在用户的主文件夹里,是一些以“.”开头的文件夹或文件,按“Ctrl+H”键即可显示。
不想保留旧的系统设置和软件设置,想安装一个全新的系统,就要删除旧的配置文件。如果你想保留以前的设置,就省略此步骤。
删除配置文件的方法是:
a、用光盘或u盘启动系统,进入Live CD。
b、先从Places菜单访问一下本地硬盘,否则就不能在文件管理器中看到本地硬盘。
c、在终端里执行命令“sudo nautilus”,以管理员身份打开文件浏览器。
d、按“Ctrl+H”键显示隐藏文件。
f、删除硬盘/home分区里的“lost+found”和“.Trash-0”文件夹。
g、删除“username”(即你的用户名)文件夹里所有以“.”开头的文件夹及文件。
3、重装系统
前面几个步骤和常规安装一样,直到分区这步。在“预备硬盘空间”里,务必选择“手动指定分区(高级)”。
a、先根据分区大小判断,每一个分区是原来的什么分区。
b、千万不能改变原来的分区容量!千万不能更改文件系统!原来是什么文件系统,现在还是选什么文件系统。
c、原来swap分区设定:点“更改...”按钮,不能改变原来的分区容量,选择用于“交换空间”。格式化和挂载点不用选。
d、原来的“/”分区设定:点“更改...”按钮,不能改变原来的分区容量,在“用于”右边的下拉列表中,选择原来所用的文件系统。然后,选中“格式化此分区”,“挂载点”选“/”,最后点“确定”。
e、原来的usr等其他分区设定:请严格上述“原来的‘/’分区设定”操作。
f、原来的“/home”分区设定:点“更改...”按钮。不能改变原来的分区容量,在“用于”右边的下拉列表中,选择原来所用的文件系统,挂载点选择“/home”。但是,千万不能选中“格式化此分区”!最后点“确定”。
g、回到在分区主界面后,请务必再检查一次!“/home”后面一定不能勾选格式化,所使用的文件系统(类型)一定要和原来的一样。确保无误之后,大胆点“前进”。
h、后面的步骤也是跟常规安装一样,按屏幕提示操作即可。要注意的地方是:填写身份时,名字可以随便填;但登录名要和以前一样。
安装需要一段时间,如果屏幕变黑,那可能是因为键盘和鼠标长时间没动作而启动的屏幕保护,动动鼠标就恢复了,不要紧张。务必记住更不能强行关机!
安装完成后,按提示重启电脑。/home里的文件将完好无损。
(本段参考了http://ubuntuabc.com/123/?p=23,在此向原作者Jandy表示万分的感谢。)
二、更换软件源
先在ubuntu软件中心里,删除你所不需要的如openoffice等东西,以免浪费无用的更新时间,但这时请不要安装自己想要的东西,因为换个源,加快系统更新速度,是大事。
Ubuntu10.04系统安装后,自带的有一个源,源文件内容如下:
#deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-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/ lucid universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid universe
deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-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/ lucid multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-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/ lucid-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ lucid-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 lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
由于我们需要选择一个下载速度快的源,另外安装别的一些软件还需要有特殊的源,所以需要修改一下源。
操作步骤:
1. 进入终端,并输入
sudo gedit /etc/apt/sources.list
2. 按回车后,输入自己用户的密码即可打开sources.list文件
3. 删除文件里原来的所有内容,并且复制粘贴伟大的骨头源到文件中
deb http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-security main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-updates main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-proposed main restricted universe multiverse
deb-src http://ubuntu.srt.cn/ubuntu/ lucid-backports main restricted universe multiverse
4. 保存修改后的文件,然后关闭
5. 使用修改后的源对系统进行更新。有两种方法:
方法一、点击系统——系统管理——更新管理器,检查并输入密码后更新。
方法二、在刚才打开的终端里面输入:
sudo apt-get update && sudo apt-get upgrade
按回车后,根据提示输入自己的密码即可。
新安上的系统在网络的帮助下,就可以迅速更新到最新的状态。之后,就可以通过软件中心,安装自己想要的东西了。
三、安装最新的内核kernel 2.6.38
kernel 2.6.37尤其是2.6.38,能够给系统带来性能的飞跃,不是原来的2.6.32所能比的。但追新2.6.38也许会让你付出代价,不过我更新到了最新的2.6.38-3-generic,系统仍然稳定。方法如下:
打开终端,先后输入
sudo add-apt-repository ppa:kernel-ppa/ppa
sudo apt-get update
sudo apt-get install linux-headers-generic-lts-backport-natty linux-image-generic-lts-backport-natty
重启电脑,点击系统——系统监视器,在系统监视器里确认一下是否用上了新的内核。
如果你想清掉旧的内核,请在新利得中输入2.6.32查找,找到已安装的旧内核,确认无误之后,标记并应用彻底删除。
四、安装最新版的wine1.3
Ubuntu软件中心里的是wine1.2, 如果安上它,当然就会稳定压倒一切。或许你是追新族,那么我们就来安装最新版的wine1.3,虽然据说还是beta版,但我以为已经够稳定的了。
安装方法如下:
打开终端,先后输入
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.3
五、安装最新版的Firefox4.0
用添加PPA源的方法,可以实现每日同步更新火狐。
打开终端,输入
sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa
sudo apt-get update
sudo apt-get install firefox-4.0
虽然这是每天编译的版本,但火狐4.0的开发已经接近尾声,也就是说相当稳定,到了值得追新的时候了。 |