Join Chaim Krause for an in-depth discussion in this video Manage RPM packages, part of SUSE Linux Enterprise Server Essential Training.
- [Instructor] Let's use a Linux Enterprise Server software is installed or removed in the form of packages. Now in earlier versions, RPM was all there was which goes all the way back to the days of the Red Hat Package Manager. In '12, we've got Zypper. So let's explore that and see how we can add and remove software. First thing we can do, is make sure we've got some repositories configured properly. So we're gonna zypper and l r for less repos.
And we've got a bunch of repos set up here, these are the standard ones for a subscription service. If I want to install some software, I can say sudo zypper install and let's install the git-core. So we're told that not only does git-core need to be installed, but there's a package dependency for perl-error. So these two packages want to be installed, do you want to continue, yes or no default being yes.
It is now downloading those packages from the repo and installing them. Let's take the next easy step which is to remove what we just did. So we're going to remove git-core. Now we see here that all it's going to remove is git-core itself because the other one was a dependency and we're not telling it to uninstall the dependency. So yes here, we remove the package. So we removed git-core and yet we still had a dependency there.
Well, the one way to take care of that is to remove it on its own. So we can sudo zypper remove perl-error. And we can remove it that way. Let me show you a shortcut. Let's reinstall. We'll go through our history here, cause we used the same exact command install git-core. And it will install it and it will install the dependency.
So instead, we're going to use a shortcut here and we're going to say sudo zypper and I'm going to use rm for remove instead of writing out the whole word, but this time I'm going to add an option to clean dependencies. Now when I say git-core, it's going to remove both packages. The package we want and the dependency. Let's clear our screen. Since we're talking about dependencies, let's take a moment to check and see if we are missing any dependencies on our system.
We can do that with the zypper verify. And it checks through our database and finds out if we're missing any dependencies, and at this point we're not. So that's a good tool to use when things aren't working the way you want them to, get an error about something missing or not being where it's supposed to be this will solve the problem. The other thing you can do besides installing and removing software with zypper is to do your patching. So if I use sudo and zypper, I can tell its patch.
And it's going to tell me these are all the patches that would be installed if I continue forth with the patching. But I'm going to say no here so I can show you another option. And that is to say sudo zypper patch but I want to include the optional packages, as well. Now when you run this, it's going to include not only the recommended patches but the optional patches as well.
And we will not do that, so I can show you the next command. And that is patch check. And when we run this, we get a summary of security patches, recommended patches, and optional patches. So if you've been paying attention and doing the math, all of those should line up. And then besides patching, we've got updates. So we're talking about patches and updates. So what's the difference between them? Well you generally see patches with the kernel, because patches are something that are backward compatible.
So you'll see that in the kernel, fixing a bug or security issue yet it's still compatible with older versions. And then you see updates, you'll most often see those with software applications because updates generally add new features, functionality and very well may break backwards compatibility. So let's see what we have in terms of patches. And then we get a listing of all the patches. Now let's check on those updates.
And these are now all the software updates that it would do if you were updating the system. And let's go ahead and let's say yes so you see what that looks like. Okay, now that it's finished updating and installing, you should heed the warning that there are some running programs and that we might want to restart some of them. And they even tell you how to do that, so let's go ahead and let's run zypper ps dash s.
And these are ones that were running and cannot be replaced. So we can restart all these processes and one last thing I want to show you is that if we do a listing of the updates, since we already applied them there should be no updates found. Because we applied all of them that were existing. Next we'll take a look at RPM. Now you zypper, because it's a new tool but RPM still has its usage and that's for querying the database.
So for example, let's take a look at using rpm and we will use dash q for query and then dash I for information and we will look into the wget package. And what we get is basic information about that package, which you'll need when you're deciding whether to install that package or it's not the package you're looking for. If you want to see what files are included in that package, I'm just going to use the up arrow key here so it'll show you we're only changing one letter.
And we're going to change that I to an L and what we get is a file listing of all the files that are in that package. Once again, up. This time we'll change the L to a D and we will get only documentation that's in those packages. Configuration files, same thing just change this to a C. And you'll find out what configuration files are in that package. And the last thing I like to check is because there's a dash s for status, we have to use a long version to get scripts.
And this presents you the scripts that's used for installing and uninstalling. So rpm still has its use and it's generally for querying the packages. Let's look at how you install and remove software using YaST. In YaST, there is software management. That's what we're going to use to do installation and removal of packages. Let's take a look at similar packages we looked at before, if I look at git-core I can search for that here using name, keyword or summary and it finds git-core.
If I look on the dependencies tab, I can see the dependencies it meets. So we can go ahead and check that so if we look here on installation summary, we can see that a check mark will do an install and the check mark with the ellipsis underneath it is an auto install and that is installing our dependency, perl-error package. So let's go ahead and click accept. And it tells us here that it's making these automatic changes because we didn't specifically choose to install perl-error.
It's giving us a chance to make changes. If we continue on, downloads our dependency. It downloads our package. Installs our dependency. And it installs our package. Now similarly, if we want to remove package we can do the same thing in terms of searching for it first. And we see that git-core is installed since it has the check mark.
And if we want to uninstall that, change this to an X to remove it. Also have perl-errors, search for that. Mark that to uninstall it. We'll get a summary and we go ahead and accept. So that is how you install and uninstall software using YaST.
- What is SUSE Linux Enterprise?
- Installing SLES
- Linux file types
- Working at the command line
- Managing processes
- Working with background processes
- Managing users and groups
- Changing file permissions
- Configuring network interfaces
- Displaying hardware information
- Managing drivers