[分享]安装FireFox 2.0

上网、浏览、聊天、下载等
回复
Venusxx
帖子: 91
注册时间: 2006-12-08 23:11

[分享]安装FireFox 2.0

#1

帖子 Venusxx » 2006-12-27 10:41

我的Ubuntu是6.06(Draper)+Gnome+FireFox1.5.0.8
主要参考资料:
http://help.ubuntu.com/community/FirefoxNewVersion
viewtopic.php?t=35132
First, back up your bookmarks and settings:
cd ~/.mozilla/firefox/*.default
mkdir ~/Desktop/ffsettings
cp bookmarks.html cert8.db cookies.txt formhistory.dat hostperm.1 key3.db signons.txt history.dat mimeTypes.rdf ~/Desktop/ffsettings
1、备份你的书签和设置:
cd ~/.mozilla/firefox/*.default
mkdir ~/Desktop/ffsettings
cp bookmarks.html cert8.db cookies.txt formhistory.dat hostperm.1 key3.db signons.txt history.dat mimeTypes.rdf ~/Desktop/ffsettings
Download Firefox from the Firefox website, and change to the directory you downloaded it to. Install it to /opt/firefox:
# extract tar into /opt (you should make sure /opt already exists)
sudo tar xzvf firefox-2.0.tar.gz -C /opt
# remove the package if you no longer require it
rm firefox-2.0.tar.gz
2、然后下载FF2.0并解压缩到/opt/firefox目录。(一般软件装在/opt目录下,当然你也可以用其他目录)
sudo tar xzvf firefox-2.0.tar.gz -C /opt
Link to your plugins and remove totem-mozilla as it doesn't seem to work with Firefox 1.5.x or 2.x:
sudo mv /opt/firefox/plugins /opt/firefox/plugins.bak
sudo ln -s /usr/lib/firefox/plugins /opt/firefox/plugins
sudo rm /usr/lib/firefox/plugins/libtotem_mozilla.*
3、将你原来的插件链接到FF2.0中,并移除totem-mozilla插件。(如果你原来是FF1.5的话,移除totem-mozilla插件这步好像不用了,因为根本就没包含,至少我是这样。)
sudo mv /opt/firefox/plugins /opt/firefox/plugins.bak
sudo ln -s /usr/lib/firefox/plugins /opt/firefox/plugins
Change to your home directory, and rename your old profile, leaving it as a backup (using the existing profile may cause problems with Firefox 2.x):
cd
mv ~/.mozilla/firefox ~/.mozilla/firefox1.x.ubuntu
4、关键步骤1
将系统原来的FF改名(备份)成其他名字(这里是从firefox改成了firefox1.x.ubuntu,你也可以改成任何你喜欢的)
cd
mv ~/.mozilla/firefox ~/.mozilla/firefox1.x.ubuntu
To ensure it is used as the default version, modify the symbolic link in /usr/bin:
# First, /usr/bin/firefox
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
sudo ln -s /opt/firefox/firefox /usr/bin/firefox
# Then, /usr/bin/mozilla-firefox, used as the default gnome browser
sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
#The dpkg-divert command will move the original system-wide /usr/bin/firefox to a new name. The ln command will place a symlink to the newly installed Firefox in /usr/bin.
4、关键步骤2
首先,将你原来的firefox包改成其他名字,并将系统的firefox链接到FF2.0(--divert是更改一般不让改名的程序/文件等时使用的参数)
sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
sudo ln -s /opt/firefox/firefox /usr/bin/firefox

然后,将FF2.0设置成Gnome的默认浏览器
sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
Try it out:
firefox
#Running Firefox in terminal may cause errors to show but don't worry about that, it will still work once Firefox is restarted. The reason for these errors is because Firefox 2.0 is checking for updates, which is not abnormal activity. Also, running this command make take a some time to execute, please be patient.
5、启动FF2.0
如果你和我一样使用SCIM作为默认中文输入法,FF2.0会有错误提示。那么执行以下操作(貌似和SCIM有冲突的程序都可以这么解决?):
sudo gedit /usr/bin/firefox
export GTK_IM_MODULE=xim
Restore your old data:
cd ~/Desktop/ffsettings
mv * ~/.mozilla/firefox/*.default
6、恢复你的FF设置和书签等
cd ~/Desktop/ffsettings
mv * ~/.mozilla/firefox/*.default

下面是恢复你的搜索引擎,一些调试,故障说明,删除FF2.0的信息,就不翻译了,大家自己琢磨琢磨(闪走!)

Restore your search plugins:
sudo cp -i --reply=no /usr/lib/mozilla-firefox/searchplugins/* /opt/firefox/searchplugins/
sudo cp -i --reply=no ~/.mozilla/firefox1.x.ubuntu/*.default/search/* /opt/firefox/searchplugins/
#Some users are having a problem with the --reply=no flag, if you get output saying the --reply option is deprecated; use -i or -f instead remove the --reply=no flag and type no in the terminal for each plug-in.

If you want to keep the original Ubuntu icon for Firefox, enter this command:
sudo cp /usr/share/pixmaps/firefox.xpm /opt/firefox/chrome/icons/default/default.xpm

Some users may find the icon with a different extension, they should use this command:
sudo cp /usr/share/pixmaps/firefox.png /opt/firefox/chrome/icons/default/default.xpm

To ensure that other programs use version 2.0 of Firefox and not the old 1.x version, go to Preferences -> Preferred Applications in the System menu. For the "Web Browser" tab, choose "Custom" and then enter the command:
firefox %s
#Firefox 2 should now be installed and working properly. If for whatever reason you become unhappy with Firefox 2 and would like to remove it, see the "Removing" section below for directions.

Restoring Extensions and Themes
In addition to restoring your settings, you can also restore your themes and extensions. As indicated above, this should only be done after running Firefox at least once and fully closing it.

Backup the new profile (just in case):
cd ~/.mozilla/firefox
mkdir ff2
mv profiles.ini *.default ff2/
Restore your previous profile:

# Shutdown firefox
cp ~/.mozilla/firefox1.x.ubuntu/profiles.ini .
cp -r ~/.mozilla/firefox1.x.ubuntu/*.default .
Start Firefox and try it out.

A dialog may appear indicating that one or more extensions and/or themes are not compatible. This is normal and Firefox may be able to find the updates for you.

Updating from 2.0 to a later version
Backup your profile with:

cp -R ~/.mozilla ~/.mozilla.backup.20x
(You may also want to consider backing up the profiles of other users on the system as they will be affected by the upgrade too).

There are two ways you can update Firefox to the newest version:

The first way is to close Firefox and give your user (yourself) file ownership: sudo chown -R ${USER}:${USER} /opt/firefox Start Firefox normally and update (Help -> Check for updates...)

Once the update is completed, close Firefox and then restore ownership to root:
sudo chown -R root:root /opt/firefox
#Do NOT browse other sites while firefox has these elevated permissions, that is without changing back the ownership of /opt/firefox over to root. Such a practice is not safe.

Note that the following alternative method may give some files in your home directory root ownership and cause problems. The first method above is safer. To update firefox you can run Firefox from the terminal with gksudo firefox . Be sure to close any running version of Firefox first. Enter your password where prompted. Then check update (Help -> Check for updates...). If updates are found, apply the update and when it asks to restart, use the "Later" option. If "Restart" is chosen, it can result in Firefox launching again with non-root privileges, causing the update to fail. After choosing "Later", close Firefox normally and relaunch with gksudo firefox . When Firefox starts you should see a Mozilla page confirming that you're using the latest version. Close Firefox and open it as a normal user (the way you usually open it). Firefox should now be updated to the newest version for all users. This way you don't have to change any file permissions and you won't forget to not change them back.

Removing
If for some reason you want to undo the installation and revert back to the standard Firefox 1.0.7, here's how:

Restore the symbolic links:

# First, /usr/bin/firefox
sudo rm /usr/bin/firefox
sudo dpkg-divert --rename --remove /usr/bin/firefox
# Then, /usr/bin/mozilla-firefox, used as the default gnome browser
sudo rm /usr/bin/mozilla-firefox
sudo dpkg-divert --rename --remove /usr/bin/mozilla-firefox
Restore your old profile:

cd
mv .mozilla .mozilla-20
mv .mozilla.ubuntu .mozilla
(optional) Delete the firefox directory:

sudo rm -r /opt/firefox

First, back up your firefox profile to your own dictionary. Then chose a dicitonar
无论多么艰难的现在,终是记忆和过去
feng3243
帖子: 210
注册时间: 2006-08-29 23:08
来自: 广东茂名

#2

帖子 feng3243 » 2007-02-05 12:23

好,我也试试
做一个精通linux的高手--不易;
做一个熟练的linux使用者--不难。
feng3243
帖子: 210
注册时间: 2006-08-29 23:08
来自: 广东茂名

#3

帖子 feng3243 » 2007-02-06 17:34

按上面方法可以安装上2.0,也可以很好了使用。但不知好不好。
我不经意间发现了三次更新系统的结果。

每次,我都是用下列命令更新系统:

sudo aptitude update && sudo aptitude dist-upgrade


第一次,是在按上方法安装FireFox 2.0之前:


正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取扩展状态文件
正在初始化软件包状态... 完成
创建标签数据库... 完成
忽略 http://static.audacious-media-player.org dapper Release.gpg
忽略 http://static.audacious-media-player.org dapper Release

错误 http://cn.archive.ubuntu.com dapper-updates/main Packages
子进程 gzip 返回了一个错误号 (1)
已下载 4965kB,耗时 39m38s (2087B/s)
正在读取软件包列表... 完成
W: Duplicate sources.list entry http://ubuntu.beryl-project.org dapper/main Packages (/var/lib/apt/lists/ubuntu.beryl-project.org_dists_dapper_main_binary-i386_Packages)
W: 您可能需要运行 apt-get update 来解决这些问题
Password:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取扩展状态文件
正在初始化软件包状态... 完成
创建标签数据库... 完成
下列软件包是“破损”的:
libcairo2
下列软件包将被升级:
app-install-data-commercial gtk2-engines-pixbuf libc6 libc6-dev
libc6-i686 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common synaptic
10 个软件包被升级,新安装 0 个, 0 个将被删除, 同时 0 个将不升级。
需要获取 15.7MB 的存档。 解包后将释放 12.3kB。
下列软件包存在未满足的依赖关系:
libcairo2: 依赖: libfreetype6 (>= 2.2) 但是 2.1.10-1ubuntu2.2 已安装。
Resolving dependencies...
下列动作将解决这些依赖关系:

保持 下列软件包于其当前版本:
libcairo2 [1.0.4-0ubuntu1 (dapper, dapper, dapper, dapper, dapper, now)]

分数是 0

是否接受该解决方案?[Y/n/q/?]


第二次,在安装FireFox 2.0之后:


已下载 3065kB,耗时 10m45s (4746B/s)
正在读取软件包列表... 完成
W: Duplicate sources.list entry http://ubuntu.beryl-project.org dapper/main Packages (/var/lib/apt/lists/ubuntu.beryl-project.org_dists_dapper_main_binary-i386_Packages)
W: 您可能需要运行 apt-get update 来解决这些问题
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取扩展状态文件
正在初始化软件包状态... 完成
创建标签数据库... 完成
下列软件包是“破损”的:
libcairo2
1 个软件包被升级,新安装 0 个, 0 个将被删除, 同时 0 个将不升级。
需要获取 229kB 的存档。 解包后将释放 16.4kB。
下列软件包存在未满足的依赖关系:
libcairo2: 依赖: libfreetype6 (>= 2.2) 但是 2.1.10-1ubuntu2.2 已安装。
Resolving dependencies...
打开:5326;关闭;4990;defer: 0; 冲突;34 o在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]y
Resolving dependencies...
打开:13761;关闭;9984;defer: 0; 冲突;35 o在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]y
Resolving dependencies...
打开:21073;关闭;14999;defer: 0; 冲突;39 o在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]y
Resolving dependencies...
打开:26307;关闭;19994;defer: 0; 冲突;40 o在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]y
Resolving dependencies...
打开:32227;关闭;24998;defer: 0; 冲突;40 o在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]y
Resolving dependencies...
打开:38945;关闭;29999;defer: 0; 冲突;41 O在分配的时 间内未找到解决方案。加把劲再试试?[Y/n]


第三次,是在删除了FireFox 2.0安装文件夹之后:
已下载 12.9kB,耗时 8m20s (26B/s)
正在读取软件包列表... 完成
W: Duplicate sources.list entry http://ubuntu.beryl-project.org dapper/main Packages (/var/lib/apt/lists/ubuntu.beryl-project.org_dists_dapper_main_binary-i386_Packages)
W: 您可能需要运行 apt-get update 来解决这些问题
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取扩展状态文件
正在初始化软件包状态... 完成
创建标签数据库... 完成
下列软件包是“破损”的:
libcairo2
下列软件包将被升级:
bind9-host dnsutils libbind9-0 libdns21 libisc11 libisccc0 libisccfg1
liblwres9
9 个软件包被升级,新安装 0 个, 0 个将被删除, 同时 0 个将不升级。
需要获取 1554kB 的存档。 解包后将释放 16.4kB。
下列软件包存在未满足的依赖关系:
libcairo2: 依赖: libfreetype6 (>= 2.2) 但是 2.1.10-1ubuntu2.2 已安装。
Resolving dependencies...
下列动作将解决这些依赖关系:

保持 下列软件包于其当前版本:
libcairo2 [1.0.4-0ubuntu1 (dapper, dapper, dapper, dapper, dapper, now)]

分数是 0



那突然出现的冲突应该是FireFox 2.0的,因为这三次更新之间 ,就只是安装了2.0。
当然,有这冲突好像也不大关系,2.0还是很好用的,如果不是意外更新了一下,也不知有这冲突,好像也不怎样影响系统。用不用呢?

而建议想装系统是6.06的想装FireFox 2.0的,不妨考虑下这个swiftfox,它是针对不同cpu进行的编译和优化,速度更快的FireFox 2.0的优化版,可以使用firefox的所有兼容插件以及所有的设置(共享同一个配置文件夹 ~/.mozilla)。不必删除原有的firefox,没有冲突。 我使用它的感觉和FireFox 2.0完全一样。


安装方法在这里:
viewtopic.php?t=39838
做一个精通linux的高手--不易;
做一个熟练的linux使用者--不难。
头像
TheThirdGhost
帖子: 1592
注册时间: 2006-07-23 16:25
来自: 南京

#4

帖子 TheThirdGhost » 2007-02-06 19:57

help上写的很清楚,按此贴不用(实际是不要)删掉原来的ff。
贴子的做法是简单的,根本没有增减deb包,只是将原来的ff重新命名而已,楼主的错误估计和此贴方法无关,或者是操作上的错误。别处我个人觉得用apt-get 好了,aptitude每次都说一堆话,也没个干脆的。
Venusxx
帖子: 91
注册时间: 2006-12-08 23:11

#5

帖子 Venusxx » 2007-02-09 20:28

3楼的朋友,我并没有遇到你描述的问题哦。
无论多么艰难的现在,终是记忆和过去
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#6

帖子 BigSnake.NET » 2007-02-09 21:29

我接着翻译。。。

。。。。。
下面是恢复你的搜索引擎,一些调试,故障说明,删除FF2.0的信息,就不翻译了,大家自己琢磨琢磨(闪走!)

好。。。go on

还原你的搜索插件
sudo cp -i --reply=no /usr/lib/mozilla-firefox/searchplugins/* /opt/firefox/searchplugins/
sudo cp -i --reply=no ~/.mozilla/firefox1.x.ubuntu/*.default/search/* /opt/firefox/searchplugins/

有的用户可能遇到选项 --reply=no 引起的问题,如果你得到 --reply 选项不支持的提示,就用 -i 或 -f,对于每个插件在终端命令中移去 --reply=no 选项并输入 no

如果你想保持Ubuntu的FF图标
sudo cp /usr/share/pixmaps/firefox.xpm /opt/firefox/chrome/icons/default/default.xpm

有些用户可能会找到不同扩展名的图标,这时应该。。
sudo cp /usr/share/pixmaps/firefox.png /opt/firefox/chrome/icons/default/default.xpm

要保证其他程序使用的是2.0版的FF而不是1.×版的,就 系统菜单 -》首选项 -》 首选应用程序 ,点“Web浏览器”标签页,选“自定义”然后输入
firefox %s

现在FF2应该安装好了。如果想卸载。。请看下面的 “卸载”一节

###############
还原扩展和主题
##############
除了还原设置,你还可以还原主题和扩展。就像上面所指出的,以下步骤只应该在运行FF至少一次然后完全关掉后再做

备份新的profile(如果需要的话)
cd ~/.mozilla/firefox
mkdir ff2
mv profiles.ini *.default ff2/
然后还原你以前的profile
关掉FF
cp ~/.mozilla/firefox1.x.ubuntu/profiles.ini .
cp -r ~/.mozilla/firefox1.x.ubuntu/*.default .
然后启动FF试验一下。。


如果某些插件或主题不兼容,会有个对话框出现。。这是正常的,还可以帮你升级

###############
从2.0升到更高版本
###############
老规矩。。备份设置
cp -R ~/.mozilla ~/.mozilla.backup.20x
(你也许需要备份其他用户的东西,因为升级将会影响所有用户)

第一种方法是关掉ff然后设置所有者为自己
sudo chown -R ${USER}:${USER} /opt/firefox
然后启动FF。。升级。。
当然升完后要把权限改回去
sudo chown -R root:root /opt/firefox

##不要在FF有这些提升的权限后(就是没有将/opt/firefox所有者改回root时)浏览其他站点,这是不安全的。

注意下面的另一种方法可能在你的home目录下弄出一些root所有的文件并引起问题。第一种方法比较安全。
首先关掉所有FF窗口
然后
gksudo firefox
然后更新(Help -> Check for updates...)
注意!!!升级完后会问你是不是重启FF,切记选“稍后”(Later)。。如果选“重新启动”的话,会导致FF在没有root权限的条件下再运行,这样升级就失败了。
选“稍后”之后,正常的关掉FF,然后再来一次
gksudo firefox
当FF启动时你应该看见一个Mozilla的页面,证实你使用最新版。然后就可以关掉并以平常方式启动。更新应该对所有用户都有效。
这个方法的好处是你不需要更改任何权限然后又把他们改回来。。

##############
卸载
##############
如果你想撤销这个安装并恢复到原先的版本(1.×××××):

还原符号链接
#首先干掉/usr/bin/firefox
sudo rm /usr/bin/firefox
sudo dpkg-divert --rename --remove /usr/bin/firefox
#然后就是用作gnome默然浏览器的usr/bin/mozilla-firefox
sudo rm /usr/bin/mozilla-firefox
sudo dpkg-divert --rename --remove /usr/bin/mozilla-firefox

还原旧的profile
cd
mv .mozilla .mozilla-20
mv .mozilla.ubuntu .mozilla

删除FF目录(可选)
sudo rm -r /opt/firefox


#这句不知干什么的。。。
#First, back up your firefox profile to your own dictionary. Then chose a dicitonar
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
Venusxx
帖子: 91
注册时间: 2006-12-08 23:11

#7

帖子 Venusxx » 2007-02-09 22:44

感谢楼上的达人啊!
#这句不知干什么的。。。
#First, back up your firefox profile to your own dictionary. Then chose a dicitonar
这句……你就看成是我CTRL+C CTRL+V时候的错误好了:P
无论多么艰难的现在,终是记忆和过去
回复