Sunday 20 November 2016

Working with tasksel on Ubuntu 16.04 LTS


tasksel is a neat utility installed in ubuntu 16.04 by default which allows the user to install groups of software packages & associated dependencies together as a single task.
This can be useful for example if we want to deploy the LAMP stack or if we have a scheduled activity coming up, we can pro-actively write a taskel task to suit our requirements & execute the task during the change time window.

To view a list of currently available tasks, type taskel to view the TUI or taskel --list-tasks for pure CLI output.




Creating custom tasksel tasks:


Got to the directory /usr/share/tasksel/descs. This contains the task descriptions which we saw when we executed the tasksel/tasksel --list-tasks commands.

root@buntu:/usr/share/tasksel/descs# pwd
/usr/share/tasksel/descs
root@buntu:/usr/share/tasksel/descs# ls
debian-tasks.desc  ubuntu-tasks.descs

We can edit one of these descriptions or write our own description.

So, without any further ado let's write ourselves a description.
We'll be writing it under /usr/share/tasksel/descs as the system will gather descriptions from files with .desc extension from this directory alone.
Here is a task file named my.desc I wrote for demonstration purposes.

Task: testing-tasksel
Relevance: 3
Description: A tasksel task to test out tasksel
 A tasksel task to test out tasksel
Key:
Packages: list
 tree
 apache2

The task directive is the title of the task.
The relevance defines how far up the tasksel menu we would like the task to appear.
Description is the information about the task which we'll view in the tasksel menu.
The key attribute would consist of any dependent packages which should already be installed in ordfer for this task to work.
Finally in the packages directive we list the packages that need to be installed as a part of our task.

Now if we type tasksel we would be able to see the task description of our newly created task in the menu.



To run this task type #taskel install <task-title> from the command line or use the space bar to select the task from the menu & press ok to run.



Removing the packages installed under a task is just as easy as installing them.
Just type #tasksel remove <task-title>

No comments:

Post a Comment

Using capture groups in grep in Linux

Introduction Let me start by saying that this article isn't about capture groups in grep per se. What we are going to do here with gr...