Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a terminal, if you type apt- and press tab, you will end up with these suggestions:

enter image description here

I'd like to see practical examples of how you would use each these commands.

Note: I already know how to use a few of these, but would like examples of them all for completeness.


locked by Oli Apr 3 '13 at 13:14

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as not constructive by Oli Apr 3 '13 at 13:12

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

It might help if you explained why the man pages aren't helping you. – Cry Havok Mar 25 '13 at 20:26
@CryHavok, I am looking for an answer that shows me how to use it. Not read what it does. I mean the man pages are good. But I would never understand how apt-mark works unless I am an expert or I have had an instance where I have used it – Suhaib Mar 25 '13 at 20:54
See also this related question: what is the use of the various apt commands. – user76204 Mar 25 '13 at 21:19
Isn't it better to ask for specific examples? This is quite broadly scoped and can turn into a "lists" type of situation. If you have a question about apt-mark, ask it by all means. – user25656 Mar 26 '13 at 1:27
@vasa1 I don't see how this is different from The mods even endorsed that one. – Seth Mar 31 '13 at 21:51

It is very easy: you type man apt-cdrom, for instance, and you get more information and an explanation. You can also navigate the documentation here: man stands for manual. The command works for a lot of other terminal commands as well.

You usually get a good description and a synopsis. Sometimes you also get practical examples, but that depends on the man page.

  1. For apt-add-repository it states

      add-apt-repository is a script which adds an external APT repository to
      either  /etc/apt/sources.list  or a file in /etc/apt/sources.list.d/ or
      removes an already existing repository.
  2. For apt-get

     apt-get is the command-line tool for handling packages, and may be
     considered the user's "back-end" to other tools using the APT library.
     Several "front-end" interfaces exist, such as dselect(1), aptitude(8),
     synaptic(8) and wajig(1).
  3. For apt-key

      apt-key is used to manage the list of keys used by apt to authenticate
      packages. Packages which have been authenticated using these keys will
      be considered trusted.

For the rest it is up to you to learn about these commands in the man pages. The synopsis can hardly get any more practical.

Thank you for the answer, But I know it is time consuming, But Can you show me some practical examples for each one of them ? For the 1st two commands I already know what they do. I was hoping that someone explains the commands with an example. apt-mark can be understood if you know how to mark packages which is considered advanced for a user like me – Suhaib Mar 25 '13 at 20:59
This just says 'RTFM' to me and does not have the examples the OP is looking for. -1 – Mark Paskal Mar 25 '13 at 21:24
@MarkPaskal This is indeed a way of saying RTM [sic]. The manual contains sufficient information for the OP to solve his question. If he wants a tutorial, I personally feel that Ask Ubuntu is not the place. Thanks for you feedback. – don.joey Mar 26 '13 at 8:05
@MarkPaskal, when you hover the mouse cursor over the upvote area, the tooltip that displays has this, in part: This question shows research effort; Where is the research effort in this question? That's why I suggested in a comment that OP ask a focused question if a specific problem was encountered. Apt is a vast topic and asking to see "some practical examples for each one of them" is not appropriate in my opinion. – user25656 Apr 2 '13 at 11:01
@vasa1 I agree that asking for any information on ten separate commands in one question is inappropriate on AU. I do think asking how apt as a whole works (including how it's plethora of command line programs are relevant to me the user) is ok, however. I don't think the question is so much asking just for examples as it's asking 'What are all these and why/when would I use them? – Mark Paskal Apr 2 '13 at 23:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.