在 Ubuntu 16.04 上使用 Tasksel 安装 LAMP 堆栈

在基于 Debian 的系统(如 Ubuntu 和 Mint)上安装软件有多种方法。 像这样的工具 易于, apt-get, 资质 和/或 突触 通常用于将单个应用程序安装到这些操作系统的桌面版本中。 或者,Tasksel 是一个命令行应用程序,用于将一组“组”相关包安装到服务器上。 默认情况下,Tasksel 不会安装在包含上述软件包管理器的“nix”版本的桌面版本上,但它会安装在更高版本的 Debian 和 Ubuntu 服务器版本上。

Tasksel 是如何工作的?

Tasksel 使用 元包 将软件应用程序和依赖项的“虚拟组”拉到一起,以安装由配置定义的软件包(或 .配置文件) 文件。 元包本身不包含实际的应用程序,它们只是引用一个 包组. 在这种情况下,这是对软件安装的引用 ubuntu 服务器.

重要提示:如果元包中的一个或多个基础依赖项被删除,元包依赖项列表中的所有其他包仍将安装在系统上。

让我们开始!

最初,我们要确保我们的 Ubuntu 服务器是最新的最新软件:

[email protected]:~# apt-get update
Get:1 https://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Hit:2 https://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 https://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 https://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 323 kB in 0s (1,019 kB/s)
Reading package lists... Done

Tasksel 已经安装了吗?

要验证是否已安装 Tasksel,请运行:

[email protected]:~# which tasksel
/usr/bin/tasksel

安装任务

如果未安装 Tasksel,请从命令行安装它:

[email protected]:~# apt-get install tasksel

错误运行Tasksel?

安装后,如果您偶然收到类似于以下内容的错误:

[email protected]:~# tasksel
tasksel: apt-get failed (100)
只需运行:

[email protected]:~# dpkg --configure -a那应该更正该错误消息。

我可以使用 Tasksel 安装什么?

要查看可安装的所有软件包的列表,请使用“–列表任务” 使用 Tasksel 命令标记:

[email protected]:~# tasksel --list-tasks
u manual    Manual package selection
u kubuntu-live    Kubuntu live CD
u lubuntu-live    Lubuntu live CD
u ubuntu-gnome-live    Ubuntu GNOME live CD
u ubuntu-live    Ubuntu live CD
u ubuntu-mate-live    Ubuntu MATE Live CD
u ubuntustudio-dvd-live    Ubuntu Studio live DVD
u ubuntustudio-live    Ubuntu Studio live CD
u xubuntu-live    Xubuntu live CD
u cloud-image    Ubuntu Cloud Image (instance)
u dns-server    DNS server
u edubuntu-desktop-gnome    Edubuntu desktop
u kubuntu-desktop    Kubuntu desktop
u kubuntu-full    Kubuntu full
u lamp-server    LAMP server
u lubuntu-core    Lubuntu minimal installation
u lubuntu-desktop    Lubuntu Desktop
u mail-server    Mail server
u mythbuntu-backend-master    Mythbuntu master backend
u mythbuntu-backend-slave    Mythbuntu slave backend
u mythbuntu-desktop    Mythbuntu additional roles
u mythbuntu-frontend    Mythbuntu frontend
u postgresql-server    PostgreSQL database
u samba-server    Samba file server
u tomcat-server    Tomcat Java server
u ubuntu-desktop    Ubuntu desktop
u ubuntu-gnome-desktop    Ubuntu GNOME desktop
u ubuntu-mate-cloudtop    Ubuntu MATE cloudtop
u ubuntu-mate-core    Ubuntu MATE minimal installation
u ubuntu-mate-desktop    Ubuntu MATE desktop
u ubuntu-usb    Ubuntu desktop USB
u ubuntustudio-audio    Audio recording and editing suite
u ubuntustudio-desktop    Ubuntu Studio desktop
u ubuntustudio-desktop-core    Ubuntu Studio minimal DE installation
u ubuntustudio-font-meta    Large selection of font packages
u ubuntustudio-graphics    2D/3D creation and editing suite
u ubuntustudio-photography    Photograph touchup and editing suite
u ubuntustudio-publishing    Publishing applications
u ubuntustudio-video    Video creation and editing suite
u virt-host    Virtual Machine host
u xubuntu-core    Xubuntu minimal installation
u xubuntu-desktop    Xubuntu desktop
i openssh-server    OpenSSH server
i server    Basic Ubuntu server

现在,让我们继续安装 LAMP 堆栈!

什么是 LAMP 堆栈?

LAMP 堆栈是运行用于托管网站的最稳定且经过时间考验的服务器平台之一的基础。 LAMP 是 Linux 的缩写, Apache, MySQL 和 PHP 软件堆栈。

  • Linux:操作系统
  • Apache: 网络服务器软件
  • MySQL:数据库服务器软件
  • PHP:网站编码的编程语言

Tasksel 无需单独安装这些软件包,而是提供了一种方便的方法来快速启动和运行 LAMP 堆栈。

如何使用 Tasksel 安装 LAMP 服务器?

要安装 LAMP 服务器,请通过 SSH 连接到新的 Ubuntu 16.04 服务器并打开终端。 在终端提示符下,输入以下命令:

[email protected]:~# tasksel

笔记 如果您出错或不小心选择了错误的软件包,只需点击“逃脱”键并重新启动进程!

这将打开 软件选择 您可以在其中选择要安装的软件组的菜单。 在这种情况下,我们将安装 LAMP。

只需使用键盘上的箭头键向下滚动菜单,直到看到 灯服务器 选项:

通过点击键盘上的空格键选择此组。 接下来,点击“tab”键并单击““ 按钮。

接下来,Tasksel 将开始安装服务器的软件。

在安装过程的中点,您将被要求提供两次 MySQL 密码。 (确保您使用安全密码!!!)