In this lesson, we'll learn how to install and manage software on Ubuntu.
A
Linux makes it easy to install,
remove and upgrade software using a package management system.
Let's explore how these systems work on Ubuntu through some practical examples
to manage software on
Ubuntu, we use the app command
app stands for advanced package tool.
Now, before installing or upgrading anything, we run pseudo app
update
and this refreshes the local database of available packages.
This information is downloaded from repositories which are servers
that store package information and the packages themselves.
So why is this needed?
The package management system maintains a database
of software packages that it knows about.
So this information becomes outdated.
For example, if we last ran the app update command one week ago,
we only have information about the packages that were available one week ago.
So with this command, we can update or refresh the information on our machine.
The command downloads the updated information from the repositories.
These repositories are servers that store information about software packages
and the packages themselves and these are maintained by canonical.
Now, let's say we want to install a new application.
For example, engine
X,
we'll just type in pseudo
apt install and Genex.
Now notice the output shows that installing
engine X also installs additional dependencies packages
that the software needs to run correctly
such as libraries or functionality enhancements.
So what is a package?
A package is an archive containing the files needed by a piece of software.
It may include binaries, configuration files, documentation, et cetera
and it's all bundled together for easy installation.
Now, after installing a package,
we can view the files in the package using the DPKG tool or D package.
For example, we can type in DPKG
dash dash list, files and Genex
and it shows the files in the engine X package.
And here we can see the actual engine
X program is slash user slash Espin
engine
X
and we can list all of the files in the engine
XCORE package
and you can do this in reverse as well
to find out which package the user Espin
engine X binary is associated with.
We can type in
DPKG dash search
and then the file
and we can see that it was brought in by the engine X core package.
But what about other dependencies that are pulled in by engine X?
We saw one called live
engine
X dash mod dash stream
that was pulled in as a dependency.
Now, if you're curious about the purpose of a certain package,
we can run the following command
a
show
and then the name of the package
and you can see a description,
this tells us what the package includes and what it does.
Now, in some cases, we might not know what package includes the software we need.
So we need to search for it.
For example, to look up all the packages that mention the word engine
X, we can search for
a
search
engine.
However, this can produce a lot of matches.
That's because it looks for the text engine X
in both the package names and their descriptions.
Now, in this case,
it's a good idea to exclude descriptions and search
for packages based only in the package name.
And to do that, we can type in app, search dash dash names, dash only
engine X
and that will only search for packages with the name that has the word engine X in it.
And we can also look for packages that match multiple search words.
For example, to look for packages that match all of these words,
we can do app search engine X module image.
Now the search function must match all of these words
with a command like this.
We can locate the engine X package that contains the module needed to process images
to remove a package that's no longer needed. The command is quite intuitive.
We just do pseudo
app remove in the name of the package in this case engine
and we'll look at an alternative way to remove packages.
And now instead of running two separate commands to
remove the main package and all the dependencies.
We'll do this with a single command.
We'll type in pseudo
app, Autoremove and Genex.
So this will remove the engine X package and all its dependencies.
So we've covered the basics of using the package manager in
Ubuntu.
Let's move on to the next lesson.