If I only know what feature I want to add to my server/desktop, for example a mail server, how on earth, can I tell what packages should I get via apt-get?
5 Answers
You can always look it up, which is just what I do.
Using your example of wanting to install an email server, I would open Google and search
set up email server ubuntu
With that search, the first result is this DigitalOcean article, titled "How To Install and Setup Postfix on Ubuntu 14.04." (Also exists for 16.04) Now I know that the email server on Ubuntu is most likely called Postfix, and I also have a guide on setting it up.
Now, maybe I don't like DigitalOcean for whatever reason, or maybe I'd just prefer a StackExchange Q&A, because those are easier to read for me. With that in mind, I'd search
set up email server ubuntu
And voila: How do I set up an email server?
That contains a very detailed answer on setting up a mail server on Ubuntu, using the mail-server
package. One result below that question is this one: simple method to install a mail server
It provides yet another method for setting up a mail server.
What you really, really, really need to do when using Ubuntu (well, anything really) is look it up. I could say there's no index that lists all the packages for different mail servers, but there is; it's called The Internet. Use this index to your advantage. Package names can be weird, which is why using a search engine can be very beneficial.
If it turns out you can't find what you're looking for, ask here, as you have just done. Chances are, it already has an answer and will be closed as a duplicate (I'm seeing more and more of those lately, and this question is very likely one as well), but there's nothing wrong with that, especially if you get your answer. In fact, duplicates help others as well, as your question might show up to different search terms than the question it is a duplicate of.

- 19,395
- 12
- 50
- 65
You can just try apt-cache search 'mail server'
. It should list packages related to this search and in this state, you should be able to select which one you need.
apt-cache search 'mail server'
results in my system these
→ apt-cache search 'mail server'
ktnef - Viewer for mail attachments using TNEF format
libkf5ksieveui5 - Sieve, the mail filtering language, GUI library
libksieveui5 - Sieve, the mail filtering language, GUI library
nginx-common - small, powerful, scalable web/proxy server - common files
nginx-extras - nginx web/proxy server (extended version)
libksieveui4 - Sieve, the mail filtering language, GUI library
spamc - Client for SpamAssassin spam filtering daemon
libclamav6 - anti-virus utility for Unix - library
xmail - advanced, fast and reliable ESMTP/POP3 mail server
mail-stack-delivery - mail server delivery agent stack provided by Ubuntu server team
amispammer - Powerful Mail Server checker on blacklists
courier-base - Courier mail server - base system
courier-doc - Courier mail server - additional documentation
courier-faxmail - Courier mail server - Fax<->mail gateway
courier-imap - Courier mail server - IMAP server
courier-imap-ssl - Courier mail server - IMAP over SSL
courier-ldap - Courier mail server - LDAP support
courier-maildrop - Courier mail server - mail delivery agent
courier-mlm - Courier mail server - mailing list manager
courier-mta - Courier mail server - ESMTP daemon
courier-mta-ssl - Courier mail server - ESMTP over SSL
courier-pcp - Courier mail server - PCP server
courier-pop - Courier mail server - POP3 server
courier-pop-ssl - Courier mail server - POP3 over SSL
courier-ssl - Courier mail server - SSL/TLS Support
courier-webadmin - Courier mail server - web-based administration frontend
feed2imap - feed aggregator (RSS/Atom) which puts items on a IMAP mail server
libnet-server-mail-perl - versatile and extensible mail server framework
mailfront - mail server network protocol front-ends
mlmmj - mail server independent mailing list manager
prayer - standalone IMAP-based webmail server
sqwebmail - Courier mail server - webmail server
tumgreyspf - external policy checker for the postfix mail server
Looking at the description beside the package name, It seems xmail
, prayer
and sqwebmail
could be the names I needed.
If you have synaptic
package manager installed, you can also search in it by clicking the search button.
Here is a screenshot for doing it in synaptic

- 76,649
If you know the name of the binary, you can search for it with apt-file
.
If you want to know which package provides /usr/bin/emacs
, use
apt-file search /usr/bin/emacs
See https://help.ubuntu.com/community/AptGet/Howto#line-103.

- 111
- 2
I recommend to follow the other answers, usually research is a good idea.
But you're just looking for ways to add basic functionalities like various servers (such as web, database, mail etc), different Desktop Environments tasksel
can be a good option as well. tasksel
let's you select tasks like "Mail server" and installs the necessary default packages for that task.
sudo apt-get install tasksel
sudo tasksel
Check the screenshot for of a tasksel
waiting for selection

- 76,649

- 1,105
-
3Please add more details. It's unclear how tasksel will solve the problem – Anwar Oct 23 '16 at 16:45
-
Not sure why this is being downvoted, I added details. Tasksel isn't a complex program :-) – Jakob Lenfers Oct 24 '16 at 04:19
-
I don't know how installing
tasksel
solves the problem. Shed light on that part of the question. Oh, I'm not the downvoter – Anwar Oct 24 '16 at 06:10 -
Didn't expect you to come back on your own just to downvote. :) The upvotes on your comment makes it clear others concur with you. I added a screenshot, if people still find it unclear, I'll have to suffer the downvotes, because tasksel is too simple to say more about it. :) – Jakob Lenfers Oct 24 '16 at 06:37
-
1I have a suggestion. Include in your answer that, running
tasksel
will give you an option to install mail server. But still,mail-server
was just an example from OP.tasksel
doesn't provide many options other than some defaults – Anwar Oct 24 '16 at 06:40 -
Thanks, I added it. I thought as well that there wouldn't be many options, but I didn't check tasksel for ages. Did you see the screenshot, that is already so much more than I expected. Honestly, I think tasksel isn't a good solution, the other answers as stated in my answer are better, but it is what OP was asking for. – Jakob Lenfers Oct 24 '16 at 06:46
-
The screenshot will be better if it includes Mail Server entry. But still better than the initial version – Anwar Oct 24 '16 at 06:54
If you want a user-friendly apt-get
you should be using apt
.
It also provides the search
command which searches for package names and descriptions:
$ apt search "mail server"
$ apt search database GUI

- 642
-
How is it more "user-friendly" than
apt-get
? You need to type 4 less characters only. – Anwar Oct 24 '16 at 06:12 -
@Anwar You also don’t need to remember which subcommands belong to
apt-get
and which toapt-cache
, for example. However, I think this answer should be a comment to your answer instead of a standalone answer. – Melebius Oct 24 '16 at 06:58 -
@Anwar Did you see the output of
apt
vsapt-get
? Try to install something usingapt-get install
vsapt install
and see the differences in the UI... – Bakuriu Oct 24 '16 at 07:07 -
-
@Anwar didn't notice that
apt
output is coloured and provides a proper progress bar (for example)?apt-get
does not do that. – Bakuriu Oct 24 '16 at 07:14 -
@Bakuriu I've noticed all those. But those doesn't make difference in finding a package required using
apt-cache
. That was my point – Anwar Oct 24 '16 at 07:15 -
@Anwar Do you mean except the fact that there is no
apt-get search
command? – Bakuriu Oct 24 '16 at 07:16 -
@Bakuriu I meant
apt-cache
. Usingapt
here making no big difference thanapt-cache
. – Anwar Oct 24 '16 at 07:20 -
@Anwar Except that
apt-cache
is a random name for such functionality. Think of a newbie user... why would he think he needs to use apt-cache ? The term cache does not make sense for a searching functionality. That's a difference in UX. – Bakuriu Oct 24 '16 at 07:22 -
This is same as remembering the fact that
apt
has a search command. If a person can remember that, he/she can do this too. That is what people has been doing for decades. – Anwar Oct 24 '16 at 07:25 -
@Anwar No, it's not the same thing. Once one knows
apt
by usingapt --help
he can know how to install/uninstall programs but also how to search them. So he has to remember one command:apt
. Besides just by trial&errorapt search
is much easier to find thenapt-cache
. Moreover even if you knowapt-get
you still wont be able to know how to search a package becauseapt-get --help
does not mentionapt-cache
. Sure: once one knows how to do a thing it knows how to do a thing, independently of how hard it is (by definition). The point is: UX is about making it easier to do things – Bakuriu Oct 24 '16 at 08:53
postfix
package would give you a mail server. It would be a good idea to further research and find the exact program / features you need, and then find a program which offers those features. (Not all mail servers are the same) – Jonas Czech Oct 23 '16 at 13:22debtags
For a specific example, see https://unix.stackexchange.com/q/272079/4671. – Faheem Mitha Oct 23 '16 at 17:22apt search "mail server"
orapt search database GUI
. It searches the package names & descriptions. – Bakuriu Oct 23 '16 at 18:50