Debian/Ubuntu taskel:只需单击即可安装组软件(任务),例如DNS/Web服务器

时间:2020-01-09 10:43:50  来源:igfitidea点击:

我在Debian或者Ubuntu Linux下寻找yum groupinstall group之类的命令。
如何通过单个命令安装安装一组软件,例如DNS或者LAMP服务器?
您需要使用tasksel命令。
这是一个软件安装应用程序,是Debian安装程序不可或者缺的一部分,也可以在Ubuntu Linux下运行。
它按任务对某些软件包进行分组,并为用户提供了一种为该任务安装软件包的简便方法。
它提供了与使用常规元包相同的功能。

如何使用Taskel?

在Debian和Ubuntu Linux(自Ubuntu Edgy起)下,tasksel已作为基本安装的一部分包含在内。

taskel显示所有可用任务,并允许用户选择要安装的任务。
只需在shell提示符下以root用户身份执行taskel:

$ sudo tasksel

或者

# tasksel

根据发行版,您将看到软件选择菜单,如下所示:

按空格键,然后按确定按钮,选择所需的组。

如何在命令提示符下列出可用的组?

选项list-tasks在屏幕上列出了将在taskel TUI(文本用户界面)中显示的任务(程序包)。
您可以按以下方式使用它:

$ tasksel --list-tasks

输出示例:

u server	Basic Ubuntu server
u dns-server	DNS server
u edubuntu-server	Edubuntu server
i lamp-server	LAMP server
u mail-server	Mail server
i openssh-server	OpenSSH server
u postgresql-server	PostgreSQL database
i print-server	Print server
i samba-server	Samba file server
u tomcat-server	Tomcat Java server
u virt-host	Virtual Machine host
u ubuntustudio-graphics	2D/3D creation and editing suite
u ubuntustudio-audio	Audio creation and editing suite
u edubuntu-desktop-kde	Edubuntu KDE desktop
u edubuntu-desktop-addon	Edubuntu desktop
u kubuntu-desktop	Kubuntu desktop
u ubuntustudio-audio-plugins	LADSPA and DSSI audio plugins
u mythbuntu-desktop	Mythbuntu additional roles
u mythbuntu-frontend	Mythbuntu frontend
u mythbuntu-backend-master	Mythbuntu master backend
u mythbuntu-backend-slave	Mythbuntu slave backend
u mobile-mid	Ubuntu MID edition
u ubuntustudio-desktop	Ubuntu Studio desktop (must install)
i ubuntu-desktop	Ubuntu desktop
u mobile-mobile	Ubuntu mobile
u ubuntustudio-video	Video creation and editing suite
u xubuntu-desktop	Xubuntu desktop
u edubuntu-live	Edubuntu live CD
u kubuntu-kde4-live	Kubuntu live CD
u kubuntu-live	Kubuntu live CD
u kubuntu-dvd-live	Kubuntu live DVD
u mythbuntu-live	Mythbuntu live CD
u ubuntu-live	Ubuntu live CD
u ubuntu-dvd-live	Ubuntu live DVD
u xubuntu-live	Xubuntu live CD

task-desc任务选项显示给定任务的扩展描述:

$ tasksel --task-desc virt-host

输出示例:

Packages necessary to host virtual machines

如何从命令行安装软件包组(任务)?

要安装lamp-server,请输入以下apt-get命令:

$ sudo apt-get install lamp-server^

或者使用以下apt命令安装dns-server

$ sudo apt install dns-server^

输出示例:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'python2.7-minimal' for task 'dns-server'
Note, selecting 'libirs141' for task 'dns-server'
Note, selecting 'python2.7' for task 'dns-server'
Note, selecting 'bind9utils' for task 'dns-server'
Note, selecting 'python' for task 'dns-server'
Note, selecting 'libpython-stdlib' for task 'dns-server'
Note, selecting 'bind9' for task 'dns-server'
Note, selecting 'libpython2.7-minimal' for task 'dns-server'
Note, selecting 'libpython2.7-stdlib' for task 'dns-server'
Note, selecting 'python-minimal' for task 'dns-server'
Note, selecting 'bind9-doc' for task 'dns-server'
libpython-stdlib is already the newest version (2.7.11-1).
libpython-stdlib set to manually installed.
python is already the newest version (2.7.11-1).
python set to manually installed.
python-minimal is already the newest version (2.7.11-1).
python-minimal set to manually installed.
libpython2.7-minimal is already the newest version (2.7.12-1~16.04).
libpython2.7-minimal set to manually installed.
libpython2.7-stdlib is already the newest version (2.7.12-1~16.04).
libpython2.7-stdlib set to manually installed.
python2.7 is already the newest version (2.7.12-1~16.04).
python2.7 set to manually installed.
python2.7-minimal is already the newest version (2.7.12-1~16.04).
python2.7-minimal set to manually installed.
The following NEW packages will be installed:
  bind9 bind9-doc bind9utils libirs141
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 788 kB of archives.
After this operation, 4,520 kB of additional disk space will be used.
Do you want to continue? [Y/n]

是的,您不能忘记插入符号(^)。
您需要在包名称的末尾加上^;否则会产生如下错误:

E: Couldn't find package lamp-server