Now working on our openSUSE system,
we have the zypper package management system. And here we are then in the
comfort of the surroundings of my openSUSE system. I've already gained access
as root, so I don't need to worry about prefacing commands with sudo. But now
we can look at some of the tools that we can use with zypper, including the
subcommand refresh, or ref for short.
This is updating our cache, our list of packages that
are available in our repositories.
In theory, it's not needed to be run because we would force
it to run if our metadata was old, but we could perhaps
schedule it to happen out of hours.
I can list my repositories with the lr command or the zypper repos command, and
it's listing both the enabled and the disabled repositories.
Those repositories are going to be found within our filesystem,
inside of the /etc/zypp/repos.d directory.
So each one of these text files represents the repository configuration
that we were looking at with our lr subcommand. And as we were looking at
before, having found all of our software,
we might need to go through and install software and, of
course, we need to know the package name.
So I can do a zypper se, for search, and tree.
And, of course, we've got that similar problem to what we
were working with in our last time.
One of the things that we could do was improve our search by using a regular
expression, whereas we have options, so ‑‑match‑words and tree.
Now when we look at the output,
we can see it's got better. We've got much less information
being shown, but it's still not an exact match.
So we have an option very similar to the regular
expression that we use where match‑exact.
So we're looking for an exact match on the word tree, but we
are now finding just that tree package.
Once we know the package name to install, then we can go
through and use our zypper in for install.
We can go ‑y if we want to, so we're not prompted to install it, but
then the package name. So tree is now installed, and of course, I can
run it, so just tree in my current directory.
Normally in SUSE, we have a bin subdirectory, so we can see that
subdirectory, but we're looking good. Tree is installed.
Removing it is a little bit more simple.
We just have the rm command.
We don't have the purge command, as such, so everything is just
going to be removed whether we want it or not.
And that leaves us then just with the update, if we want to
update a package or all of our packages.
Again, if I don't specify the package name,
everything is going to be updated, and I could use ‑y, so we could
script it so it would just carry ahead and run the update. But we can
allow this to run through as we update those eight packages, but
we've seen the basics of our software management inside of our openSUSE system using zypper.