39

I'm seeing various instructions that request that you install something like:

apt-get install lamp-server^

With the oddball caret in the command. It doesn't seem to be mentioned in apt-get manual. What's the deal ?

Braiam
  • 66,947
  • 30
  • 177
  • 264
mlissner
  • 2,193
  • 2
  • 23
  • 35
  • Related: https://askubuntu.com/questions/252056/should-i-use-tasksel-tasks-in-apt-or-install-regular-metapackages – Aritz Apr 24 '18 at 12:18

2 Answers2

25

The ^ character is not a typo. If you remove it, apt-get will complain that the package cannot be found.

This article and its comments describe what the caret does:

Well, the answer is that the caret symbol is a short form for performing a task that otherwise the program “tasksel” would have done with the given package name. tasksel is a program to ease the installation of commonly used things that go together for a particular use.

Lekensteyn
  • 171,743
  • 65
  • 311
  • 401
  • 2
    Learn something new every day. – coteyr Nov 05 '12 at 00:13
  • 2
    This detail missing from the man page for 3 yrs is a terrible thing. – Jay _silly_evarlast_ Wren May 17 '15 at 20:45
  • I don't installed tasksel in my system still it's working. – Hardik Gajjar Sep 07 '18 at 09:36
  • @HardikGajjar The reason is that `tasksel` is just a very useful command for working with "tasks". You can install tasks without `tasksel`. But ([as explained here](https://askubuntu.com/a/257172/349837)) is better using `tasksel` than with the apt/caret way. Also it seems `apt-cache` doesn't provide a way to list tasks as `tasksel --list-task`. – Pablo Bianchi Jan 03 '19 at 05:29
14

The ^ symbol let you install "Tasks", a set of packages. This can replace tasksel, dedicated tool to work with tasks.

By doing

apt-get install lamp-server^

You are actually running installing a set of packages that would have been installed via the command (even is not exactly the same):

tasksel lamp-server

In other words: Tasks are very similar to meta-packages and live independently of tasksel. You can install tasks without installing tasksel package.

Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117
coteyr
  • 17,948
  • 6
  • 29
  • 57
  • This is not correct. The `apt-get` command would error out on unrecognized names. – Lekensteyn Nov 04 '12 at 21:52
  • I stand corrected, it does appear that it has been used in apt-get to replace tasksel as you mentioned. I will update my answer. – coteyr Nov 05 '12 at 00:05
  • 1
    Yes, but this works even without `tasksel` command being installed. And I don't have the `/usr/share/tasksel/` directory, so I can't see what other cool "tasks" are available. It's only `lamp-server^` everywhere. So where does `apt-get` take it from? – Tomasz Gandor Oct 01 '14 at 07:03