5

Can someone explain what actions this command will perform?

sudo apt-get install xyz

1

6 Answers 6

18

Indeed, lets break this down.

  • sudo (some parameters): Instructs the operating system to execute the parameters as a command, but do so with administrative (usually root) privileges.
  • apt-get (some parameters): Runs the package manager called apt-get on your machine. The parameters are a command for apt-get to run.
  • install xyz: These parameters to apt-get instruct apt-get to find and install a package called xyz.

So, as a whole, this command attempts to find and install package/program xyz on your machine and does so as root if you are able to authenticate as such.

4

Note: "apt-get install" will also install missing dependencies for the xyz package.

3

for future reference, the man command can help with commands

just type

man *yourCommand*

or in your case

man sudo

man apt-get
1
  • A bit bofh'ish, but I like it!
    – Andrioid
    Jul 13, 2009 at 7:32
1

This is more of a ServerFault.com question than StackOverflow, but it instructs the package manager to install the xyz program.

sudo - do this as an administrative user apt-get - the package management program install - the instruction for the program xyz - the program to install

1
  • And how can I see from what repository will the library be installed? My OS is Ubuntu.
    – cmdev
    Jul 12, 2009 at 15:21
1

In order to see the repository that would be used to install a package, use the following:

apt-get --print-uris install xyz

then answer "Y". The URIs will be printed, but the package won't be installed.

To see what repositories you have configured, look at this file /etc/apt/sources.list which can be edited (but you should probably use System>Administration>Software Sources to choose repositories.

1

To see what versions of a package are available to be installed, and from what repository, try

apt-cache policy xyz
1
  • apt-cache policy doesn't need root privileges.
    – LiraNuna
    Jul 12, 2009 at 22:38

You must log in to answer this question.