在广阔的数字环境中,网络浏览器是通往互联网的门户。Firefox是由Mozilla开发的开源和注重隐私的浏览器,由于其用户友好的界面和强大的功能而获得了忠实的追随者。如果您是 Debian 12(代号为“书虫”)用户并希望体验 Firefox 的强大功能,本综合指南将引导您完成使用命令行安装浏览器的各种方法。
在 Debian 12 书虫上安装 Firefox 浏览器
第 1 步。在我们安装任何软件之前,通过在终端中运行以下命令来确保您的系统是最新的非常重要:apt
<span class="pln">sudo apt update sudo apt install apt</span><span class="pun">-</span><span class="pln">transport</span><span class="pun">-</span><span class="pln">https curl gnupg</span>
此命令将刷新存储库,允许您安装最新版本的软件包。
第 2 步。在 Debian 12 上安装 Firefox 浏览器。
- A. 方法1:使用Debian存储库安装Firefox
更新软件包列表后,您可以通过在终端中运行以下命令来安装 Firefox:
<span class="pln">sudo apt install firefox</span>
- 方法2:使用Snap安装火狐浏览器
如果未安装 Snapd,请使用以下命令:
<span class="pln">sudo apt install snapd</span>
使用以下命令从 Snap 安装 Firefox:
<span class="pln">sudo snap install firefox</span>
- C. 方法3:手动安装火狐浏览器
前往 Mozilla 网站并下载最新的 Firefox 版本:
<span class="pln">cd </span><span class="pun">~/</span><span class="typ">Downloads</span><span class="pln"> wget </span><span class="pun">-</span><span class="pln">O firefox</span><span class="pun">.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">bz2 </span><span class="str">"https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US"</span>
使用以下命令解压缩下载的软件包:
<span class="pln">tar </span><span class="pun">-</span><span class="pln">xf firefox</span><span class="pun">.</span><span class="pln">tar</span><span class="pun">.</span><span class="pln">bz2</span>
将解压缩的 Firefox 文件夹移动到 /opt 目录:
<span class="pln">sudo mv firefox </span><span class="pun">/</span><span class="pln">opt</span><span class="pun">/</span>
创建一个指向 Firefox 可执行文件的符号链接,以便于访问:
<span class="pln">sudo ln </span><span class="pun">-</span><span class="pln">s </span><span class="pun">/</span><span class="pln">opt</span><span class="pun">/</span><span class="pln">firefox</span><span class="pun">/</span><span class="pln">firefox </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">bin</span><span class="pun">/</span><span class="pln">firefox</span>
接下来,创建一个桌面条目以从应用程序菜单启动 Firefox:
<span class="pln">cat </span><span class="pun"><<</span><span class="pln">EOF </span><span class="pun">|</span><span class="pln"> sudo tee </span><span class="pun">/</span><span class="pln">usr</span><span class="pun">/</span><span class="pln">share</span><span class="pun">/</span><span class="pln">applications</span><span class="pun">/</span><span class="pln">firefox</span><span class="pun">.</span><span class="pln">desktop </span><span class="pun">[</span><span class="typ">Desktop</span> <span class="typ">Entry</span><span class="pun">]</span> <span class="typ">Name</span><span class="pun">=</span><span class="typ">Firefox</span> <span class="typ">Comment</span><span class="pun">=</span><span class="typ">Web</span> <span class="typ">Browser</span> <span class="typ">Exec</span><span class="pun">=</span><span class="str">/opt/</span><span class="pln">firefox</span><span class="pun">/</span><span class="pln">firefox </span><span class="pun">%</span><span class="pln">u </span><span class="typ">Terminal</span><span class="pun">=</span><span class="kwd">false</span><span class="pln"> X</span><span class="pun">-</span><span class="typ">MultipleArgs</span><span class="pun">=</span><span class="kwd">false</span> <span class="typ">Type</span><span class="pun">=</span><span class="typ">Application</span> <span class="typ">Icon</span><span class="pun">=</span><span class="pln">firefox</span><span class="pun">-</span><span class="pln">esr </span><span class="typ">Categories</span><span class="pun">=</span><span class="typ">Network</span><span class="pun">;</span><span class="typ">WebBrowser</span><span class="pun">;</span> <span class="typ">MimeType</span><span class="pun">=</span><span class="pln">text</span><span class="pun">/</span><span class="pln">html</span><span class="pun">;</span><span class="pln">text</span><span class="pun">/</span><span class="pln">xml</span><span class="pun">;</span><span class="pln">application</span><span class="pun">/</span><span class="pln">xhtml</span><span class="pun">+</span><span class="pln">xml</span><span class="pun">;</span> <span class="typ">StartupNotify</span><span class="pun">=</span><span class="kwd">true</span><span class="pln"> EOF</span>
第 3 步:在 Debian 上启动 Firefox。
安装完成后,您可以通过在应用程序菜单中搜索或在终端中运行以下命令来启动 Firefox:
<span class="pln">firefox</span>
为了使 Firefox 保持最新的安全补丁和错误修复,建议定期更新它。您可以通过在终端中运行以下命令来执行此操作:
<span class="pln">sudo apt upgrade firefox</span>
感谢您使用本教程在 Debian 12 书虫上安装最新版本的 Firefox 浏览器。如需其他帮助或有用信息,我们建议您查看 Firefox 官方网站。