🎓 A1Learner
🔍
0 of 50 lessons completed

Installing Packages

A dependency is a package that another package needs. Apt installs the dependency with the package.

Install cowsay

The last lines show the install finishing.

$ apt install -y cowsay | tail -5

Say hello

Cowsay prints the words in a speech bubble.

$ cowsay "Hello, Linux"

Remove cowsay

The last lines show the removal finishing.

$ apt remove -y cowsay | tail -5

Example

$ apt install -y cowsay
$ cowsay "Hello, Linux"
$ apt remove -y cowsay

Key points

  • Use apt install to add a package.
  • Use apt remove to take a package away.
  • The -y option answers yes to every question.
  • Cowsay needs no other package, so apt installs one package only.
  • Apt prints its steps as it works.
  • Your package counts will differ from the counts shown here.

In this example, apt installs cowsay. Cowsay then prints the greeting. Apt removes cowsay at the end, so the machine ends as it began.

Note

Remove a try-out package when you finish with it.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Exercise

What does apt install -y cowsay do?