Debian 10(Buster)安装后要做的前8件事

Debian 10(Buster)安装后要做的前8件事

Debian 10 的代号是 Buster,它是来自 Debian 家族的最新 LTS 发布版本,并包含大量的特色功能。因此,如果你已经在你的电脑上安装了 Debian 10,并在思考接下来该做什么,那么,请继续阅读这篇文章直到结尾,因为我们为你提供在安装 Debian 10 后要做的前 8 件事。对于还没有安装 Debian 10 的人们,请阅读这篇指南 图解 Debian 10 (Buster) 安装步骤。 让我们继续这篇文章。

1) 安装和配置 sudo

在设置完成 Debian 10 后,你需要做的第一件事是安装 sudo 软件包,因为它能够使你获得管理员权限来安装你需要的软件包。为安装和配置 sudo,请使用下面的命令:

变成 root 用户,然后使用下面的命令安装 sudo 软件包,

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">su</span><span class="pln"> </span><span class="pun">-</span>
  2. <span class="typ">Password</span><span class="pun">:</span>
  3. <span class="pln">root@linuxtechi</span><span class="pun">:~#</span><span class="pln"> apt install </span><span class="kwd">sudo</span><span class="pln"> </span><span class="pun">-</span><span class="pln">y</span>

添加你的本地用户到 sudo 组,使用下面的 usermod 命令,

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~#</span><span class="pln"> </span><span class="kwd">usermod</span><span class="pln"> </span><span class="pun">-</span><span class="pln">aG </span><span class="kwd">sudo</span><span class="pln"> pkumar</span>
  2. <span class="pln">root@linuxtechi</span><span class="pun">:~#</span>

现在验证是否本地用户获得 sudo 权限:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">id</span>
  2. <span class="pln">uid</span><span class="pun">=</span><span class="lit">1000</span><span class="pun">(</span><span class="pln">pkumar</span><span class="pun">)</span><span class="pln"> gid</span><span class="pun">=</span><span class="lit">1000</span><span class="pun">(</span><span class="pln">pkumar</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">groups</span><span class="pun">=</span><span class="lit">1000</span><span class="pun">(</span><span class="pln">pkumar</span><span class="pun">),</span><span class="lit">27</span><span class="pun">(</span><span class="kwd">sudo</span><span class="pun">)</span>
  3. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> </span><span class="kwd">vi</span><span class="pln"> </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">hosts</span>
  4. <span class="pun">[</span><span class="kwd">sudo</span><span class="pun">]</span><span class="pln"> password </span><span class="kwd">for</span><span class="pln"> pkumar</span><span class="pun">:</span>
  5. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

2) 校正日期和时间

在你成功配置 sudo 软件包后,接下来,你需要根据你的位置来校正日期和时间。为了校正日期和时间,

转到系统 设置 –> 详细说明 –> 日期和时间 ,然后更改为适合你的位置的时区。

Debian 10(Buster)安装后要做的前8件事

一旦时区被更改,你可以看到时钟中的时间自动更改。

3) 应用所有更新

在 Debian 10 安装后,建议安装所有 Debian 10 软件包存储库中可用的更新,执行下面的 apt 命令:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt update</span>
  2. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt upgrade </span><span class="pun">-</span><span class="pln">y</span>

注意: 如果你是 vi 编辑器的忠实粉丝,那么使用下面的 apt 命令安装 vim

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install </span><span class="kwd">vim</span><span class="pln"> </span><span class="pun">-</span><span class="pln">y</span>

4) 安装 Flash 播放器插件

默认情况下,Debian 10(Buster)存储库不包含 Flash 插件,因此,用户需要遵循下面的介绍来在他们的系统中查找和安装 flash 播放器。

为 Flash 播放器配置存储库:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">echo</span><span class="pln"> </span><span class="str">"deb http://ftp.de.debian.org/debian buster main contrib"</span><span class="pln"> </span><span class="pun">|</span><span class="pln"> </span><span class="kwd">sudo</span><span class="pln"> </span><span class="kwd">tee</span><span class="pln"> </span><span class="pun">-</span><span class="pln">a </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="kwd">list</span>
  2. <span class="pln">deb http</span><span class="pun">:</span><span class="com">//ftp.de.debian.org/debian buster main contrib</span>
  3. <span class="pln">root@linuxtechi</span><span class="pun">:~</span>

现在使用下面的命令更新软件包索引:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt update</span>

使用下面的 apt 命令安装 Flash 插件:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install pepperflashplugin</span><span class="pun">-</span><span class="pln">nonfree </span><span class="pun">-</span><span class="pln">y</span>

一旦软件包被成功安装,接下来,尝试播放 YouTube 中的视频:

Debian 10(Buster)安装后要做的前8件事

5) 安装软件,如 VLC、Skype、FileZilla 和截图工具

如此,现在我们已经启用 Flash 播放器,是时候在我们的 Debian 10 系统中安装所有其它的软件,如 VLC、Skype,Filezilla 和截图工具(flameshot)。

安装 VLC 多媒体播放器

为在你的系统中安装 VLC 播放器,使用下面的 apt 命令:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install vlc </span><span class="pun">-</span><span class="pln">y</span>

在成功安装 VLC 播放器后,尝试播放你喜欢的视频。

Debian 10(Buster)安装后要做的前8件事

安装 Skype

首先,下载最新的 Skype 软件包:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">wget</span><span class="pln"> https</span><span class="pun">:</span><span class="com">//go.skype.com/skypeforlinux-64.deb</span>

接下来,使用 apt 命令安装软件包:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install </span><span class="pun">./</span><span class="pln">skypeforlinux</span><span class="pun">-</span><span class="lit">64.deb</span>

在成功安装 Skype 后,尝试访问它,并输入你的用户名和密码。

Debian 10(Buster)安装后要做的前8件事

安装 Filezilla

为在你的系统中安装 Filezilla,使用下面的 apt 命令,

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install filezilla </span><span class="pun">-</span><span class="pln">y</span>

一旦 FileZilla 软件包被成功安装,尝试访问它。

Debian 10(Buster)安装后要做的前8件事

安装截图工具(flameshot)

使用下面的命令来安装截图工具:flameshot,

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install flameshot </span><span class="pun">-</span><span class="pln">y</span>

注意: Shutter 工具在 Debian 10 中已被移除。

Debian 10(Buster)安装后要做的前8件事

6) 启用和启动防火墙

总是建议启动防火墙来使你的网络安全。如果你希望在 Debian 10 中启用防火墙, UFW(简单的防火墙)是最好的控制防火墙的工具。UFW 在 Debian 存储库中可用,它非常容易安装,如下:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install ufw</span>

在你安装 UFW 后,接下来的步骤是设置防火墙。因此,设置防火墙,通过拒绝端口来禁用所有的传入流量,并且只允许需要的端口传出,像 ssh、http 和 https。

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw </span><span class="kwd">default</span><span class="pln"> deny incoming</span>
  2. <span class="typ">Default</span><span class="pln"> incoming policy changed to </span><span class="str">'deny'</span>
  3. <span class="pun">(</span><span class="pln">be sure to update your rules accordingly</span><span class="pun">)</span>
  4. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw </span><span class="kwd">default</span><span class="pln"> allow outgoing</span>
  5. <span class="typ">Default</span><span class="pln"> outgoing policy changed to </span><span class="str">'allow'</span>
  6. <span class="pun">(</span><span class="pln">be sure to update your rules accordingly</span><span class="pun">)</span>
  7. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

允许 SSH 端口:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw allow </span><span class="kwd">ssh</span>
  2. <span class="typ">Rules</span><span class="pln"> updated</span>
  3. <span class="typ">Rules</span><span class="pln"> updated </span><span class="pun">(</span><span class="pln">v6</span><span class="pun">)</span>
  4. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

假使你在系统中已经安装 Web 服务器,那么使用下面的 ufw 命令来在防火墙中允许它们的端口:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw allow </span><span class="lit">80</span>
  2. <span class="typ">Rules</span><span class="pln"> updated</span>
  3. <span class="typ">Rules</span><span class="pln"> updated </span><span class="pun">(</span><span class="pln">v6</span><span class="pun">)</span>
  4. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw allow </span><span class="lit">443</span>
  5. <span class="typ">Rules</span><span class="pln"> updated</span>
  6. <span class="typ">Rules</span><span class="pln"> updated </span><span class="pun">(</span><span class="pln">v6</span><span class="pun">)</span>
  7. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

最后,你可以使用下面的命令启用 UFW:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw enable</span>
  2. <span class="typ">Command</span><span class="pln"> may disrupt existing </span><span class="kwd">ssh</span><span class="pln"> connections</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Proceed</span><span class="pln"> </span><span class="kwd">with</span><span class="pln"> operation </span><span class="pun">(</span><span class="pln">y</span><span class="pun">|</span><span class="pln">n</span><span class="pun">)?</span><span class="pln"> y</span>
  3. <span class="typ">Firewall</span><span class="pln"> </span><span class="kwd">is</span><span class="pln"> active </span><span class="kwd">and</span><span class="pln"> enabled on system startup</span>
  4. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

假使你想检查你的防火墙的状态,你可以使用下面的命令检查它:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> ufw status</span>

7) 安装虚拟化软件(VirtualBox)

安装 Virtualbox 的第一步是将 Oracle VirtualBox 存储库的公钥导入到你的 Debian 10 系统:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">wget</span><span class="pln"> </span><span class="pun">-</span><span class="pln">q https</span><span class="pun">:</span><span class="com">//www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -</span>
  2. <span class="pln">OK</span>
  3. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">wget</span><span class="pln"> </span><span class="pun">-</span><span class="pln">q https</span><span class="pun">:</span><span class="com">//www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -</span>
  4. <span class="pln">OK</span>
  5. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

如果导入成功,你将看到一个 “OK” 显示信息。

接下来,你需要添加存储库到仓库列表:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> add</span><span class="pun">-</span><span class="pln">apt</span><span class="pun">-</span><span class="pln">repository </span><span class="str">"deb http://download.virtualbox.org/virtualbox/debian buster contrib"</span>
  2. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$</span>

最后,是时候在你的系统中安装 VirtualBox 6.0:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt update</span>
  2. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> apt install virtualbox</span><span class="pun">-</span><span class="lit">6.0</span><span class="pln"> </span><span class="pun">-</span><span class="pln">y</span>

一旦 VirtualBox 软件包被成功安装,尝试访问它,并开始创建虚拟机。

Debian 10(Buster)安装后要做的前8件事

8) 安装最新的 AMD 驱动程序

最后,你也可以安装需要的附加 AMD 显卡驱动程序(如 ATI 专有驱动)和 Nvidia 图形驱动程序。为安装最新的 AMD 驱动程序,首先,我们需要修改 /etc/apt/sources.list 文件,在包含 maincontrib 的行中添加 non-free 单词,示例如下显示:

  1. <span class="pln">root@linuxtechi</span><span class="pun">:~</span><span class="pln">$ </span><span class="kwd">sudo</span><span class="pln"> </span><span class="kwd">vi</span><span class="pln"> </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="kwd">list</span>
  1. <span class="pun">...</span>
  2. <span class="pln">deb http</span><span class="pun">:</span><span class="com">//deb.debian.org/debian/ buster main non-free contrib</span>
  3. <span class="pln">deb</span><span class="pun">-</span><span class="pln">src http</span><span class="pun">:</span><span class="com">//deb.debian.org/debian/ buster main non-free contrib</span>
  4.  
  5. <span class="pln">deb http</span><span class="pun">:</span><span class="com">//security.debian.org/debian-security buster/updates main contrib non-free</span>
  6. <span class="pln">deb</span><span class="pun">-</span><span class="pln">src http</span><span class="pun">:</span><span class="com">//security.debian.org/debian-security buster/updates main contrib non-free</span>
  7.  
  8. <span class="pln">deb http</span><span class="pun">:</span><span class="com">//ftp.us.debian.org/debian/ buster-updates main contrib non-free</span>
  9. <span class="pun">...</span>

现在,使用下面的 apt 命令来在 Debian 10 系统中安装最新的 AMD 驱动程序。

相关推荐