[Tutorials] deepin 中安装最新国际版 firefox
Tofloor
poster avatar
thepoy
deepin
2021-02-02 01:48
Author

写在前面的话:

deepin 商店里或默认安装的firefox是中国特色过的firefox,不太干净,所以本文是针对不想使用中国特色过的firefox的用户。

 

 

0、删除或卸载deepin自带的firefox

在程序列表里右击Firefox图标就能卸载了,不再赘述。

1、下载需要的版本

https://www.mozilla.org/zh-CN/firefox/all/#product-desktop-release

2、解压并放到任何位置

尽量放在当前用户工作目录中,放在root目录中虽然可以使用,但因为权限问题不能自动更新。

下面以放到~/Applications为例,目录不存在的话,先创建mkdir ~/Applications

tar -C ~/Applications -jxvf ~/Downloads/firefox-85.0.tar.bz2

3、添加到程序列表

linux发行版的程序列表有两个目录,一个是/usr/share/applications,一个是~/.local/share/applications

第一个是系统级程序快捷方式目录,放到此处后,firefox 会出现在所有用户的程序菜单里。

第二个是用户的程序快捷方式目录,放到此处后,firefox 只会列在当前用户的程序菜单里。

不过上面既然已经将 firefox 放到了用户目录下,这里也就将快捷方式放到~/.local/share/applications里了。

执行命令:

vim ~/.local/share/applications/firefox.desktop

将下面的内容复制进去,注意里面的Exec路径需要根据你安装的目录进行修改:

[Desktop Entry]
Version=1.0
Name=Firefox
GenericName=Web Browser
GenericName[zh_CN]=网络浏览器
GenericName[zh_TW]=網路瀏覽器
Comment=Browse the World Wide Web
Comment[zh_CN]=浏览互联网
Comment[zh_TW]=瀏覽網際網路
Keywords=Internet;WWW;Browser;Web;Explorer
Keywords[zh_CN]=Internet;WWW;Browser;Web;Explorer;网页;浏览;上网;火狐;Firefox;ff;互联网;网站;
Keywords[zh_TW]=Internet;WWW;Browser;Web;Explorer;網際網路;網路;瀏覽器;上網;網頁;火狐
# firefox可执行文件的绝对路径,可以是任何目录,替换掉下面的$HOME/Applications
Exec=$HOME/Applications/firefox/firefox %u
Icon=firefox
Terminal=false
Type=Application
MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json;
StartupNotify=true
StartupWMClass=firefox
Categories=Network;WebBrowser;
Actions=new-window;new-private-window;
[Desktop Action new-window]
Name=New Window
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
# firefox可执行文件的绝对路径,可以是任何目录,替换掉下面的$HOME/Applications
Exec=$HOME/Applications/firefox/firefox --new-window %u
[Desktop Action new-private-window]
Name=New Private Window
Name[zh_CN]=新建隐私浏览窗口
Name[zh_TW]=新增隱私視窗
# firefox可执行文件的绝对路径,可以是任何目录,替换掉下面的$HOME/Applications
Exec=$HOME/Applications/firefox/firefox --private-window %u

保存退出后,程序列表会自动更新,就能看见新添加的firefox了。

不过此时可能部分用户还会遇到一个小问题,就是快捷方式的图标不正常,这是因为你的/usr/share/icons里没有默认的firefox.svgfirefox.png图标,需要手动添加或者将Icon参数修改为你下载的firefox图标的绝对路径。

说白了,Icon的图标就是icons目录里的firefox图标的文件名或者是某个图片的绝对路径。

Reply Favorite View the author
All Replies
SamLukeYes
deepin
2021-02-02 01:56
#1

用 root 放进 /opt 里面,更新会比较麻烦吧

Reply View the author
Comments
Fredoong
2021-02-02 06:46
给Firefox的目录写入(write)权限就行了,我几乎所有的app都放在 /opt
thepoy
deepin
2021-02-02 01:59
#2
SamLukeYes

用 root 放进 /opt 里面,更新会比较麻烦吧

更新只需要再执行一次

sudo tar -C /opt/custom -jxvf ~/Downloads/firefox-new-version.tar.bz2

就可以了啊,直接覆盖旧版本。

是比直接在商店更新麻烦一些。

Reply View the author
Feng Yu
deepin
2021-02-02 02:06
#3
thepoy

更新只需要再执行一次

sudo tar -C /opt/custom -jxvf ~/Downloads/firefox-new-version.tar.bz2

就可以了啊,直接覆盖旧版本。

是比直接在商店更新麻烦一些。

放在有权限的目录,firefox会自动更新,根本不用执行命令

Reply View the author
thepoy
deepin
2021-02-02 02:52
#4
Feng Yu

放在有权限的目录,firefox会自动更新,根本不用执行命令

把firefox放到/opt里,updater 文件的用户组和用户也是root,普通用户调用 firefox 时,会影响 updater 执行吗?

还是说 即使放到了 /opt 里,updater 也是普通用户权限?

Reply View the author
安洛
deepin
2021-02-02 03:09
#5
thepoy

把firefox放到/opt里,updater 文件的用户组和用户也是root,普通用户调用 firefox 时,会影响 updater 执行吗?

还是说 即使放到了 /opt 里,updater 也是普通用户权限?

之前试过会影响,不知道现在怎么样了。

Reply View the author
thepoy
deepin
2021-02-02 03:21
#6
安洛

之前试过会影响,不知道现在怎么样了。

刚刚试过了,普通用户执行firefox,firefox会在普通用户权限下执行updater,导致updater不是以root权限执行,所以不能自动更新。

只有把firefox放在普通用户目录,才能正确执行updater。

Reply View the author
Feng Yu
deepin
2021-02-02 04:10
#7
thepoy

把firefox放到/opt里,updater 文件的用户组和用户也是root,普通用户调用 firefox 时,会影响 updater 执行吗?

还是说 即使放到了 /opt 里,updater 也是普通用户权限?

如果你放到了/opt,需要手工给当前用户赋权限

参考:

 

sudo chown -R ${USER} /opt/firefox
Reply View the author
Comments
liveup
2021-02-02 14:56
这个方法好,就是商城安装了firefox国际版,再用这个方法可以自动升级。超级方便。
smalldimples
deepin
2021-02-02 18:18
#8

这个方法可以用在mips架构的电脑上吗?

 

Reply View the author
thepoy
deepin
2021-02-02 22:52
#9
smalldimples

这个方法可以用在mips架构的电脑上吗?

 

如果firefox支持的话就可以,可能需要下载源码自己编绎。

Reply View the author