< Return to Video

Linux Package Managers (Linux+ Objective 1.6.1)

  • 0:00 - 0:02
    Hello, everybody. I'm Shawn Powers, and
  • 0:02 - 0:04
    today we are talking about packages.
  • 0:04 - 0:07
    Oh my God. Look at my package.
  • 0:07 - 0:09
    No. We're talking about Linux packages--
  • 0:09 - 0:12
    specifically RPM and DEB-based package
  • 0:12 - 0:15
    management as part of the Linux+
  • 0:15 - 0:17
    exam objectives. Whether or not you want
  • 0:17 - 0:21
    to take the exam, that's what we're basing this video on. So we're going to
  • 0:21 - 0:24
    look at package management using
  • 0:24 - 0:28
    multiple tools: DNF, YUM, APT, Zypper, and
  • 0:28 - 0:30
    we're going to look at the two different
  • 0:30 - 0:35
    types of packages that are specified here--RPM, and then it doesn't spell it
  • 0:35 - 0:40
    out, but DEB packages for .deb files. And that's what we're going to look at.
  • 0:40 - 0:43
    Even though there are other options out there
  • 0:43 - 0:45
    for package management, these are the
  • 0:45 - 0:46
    main ones that we're going to look at.
  • 0:46 - 0:48
    They're the most common. They're used in
  • 0:48 - 0:50
    Red Hat variants and Debian variants
  • 0:50 - 0:53
    like Ubuntu, etc. And we're going to talk
  • 0:53 - 0:57
    just briefly about these. This is an odd sort of thing they added on to the
  • 0:57 - 1:00
    objectives, but kernel updates generally
  • 1:00 - 1:02
    require a reboot--not always, but almost always.
  • 1:02 - 1:05
    They’ll require a reboot, and they'll have to rebuild a bunch of modules.
  • 1:05 - 1:08
    So this isn't necessarily done every time
  • 1:08 - 1:11
    you update your system. You can update
  • 1:11 - 1:16
    packages either--depending on your distribution--you can update all the
  • 1:16 - 1:22
    packages, or you can update only the packages that need security updates.
  • 1:22 - 1:26
    There are several different ways you can go about updating packages and
  • 1:26 - 1:28
    kernel updates. And the most important
  • 1:28 - 1:32
    thing is to make sure that you have the most recent versions if there are
  • 1:32 - 1:36
    security fixes. But we're going to look at a bunch of different tools that you
  • 1:36 - 1:41
    can use to manage packages on your system, because by default, just
  • 1:41 - 1:45
    managing individual packages is not the way to go. Like I said, we're
  • 1:45 - 1:50
    going to look at DEB files like .deb, which comes from Debian, and
  • 1:50 - 1:53
    then .rpm, which stands for Red Hat Package Manager.
  • 1:53 - 1:57
    Back in the old days, there didn’t use to be this big
  • 1:57 - 2:00
    database-driven way to install and manage things on your system.
  • 2:00 - 2:04
    You used to have to install the .rpm or .deb
  • 2:04 - 2:09
    files, and it was really a pain in the butt because an individual RPM file or
  • 2:09 - 2:13
    DEB file does not necessarily contain all the dependencies.
  • 2:13 - 2:17
    Although they do know what dependencies they require,
  • 2:17 - 2:20
    if you try to install them manually, you
  • 2:20 - 2:22
    end up with a nightmare. Let me show you
  • 2:22 - 2:24
    what I mean. First, we'll start with Rocky Linux,
  • 2:24 - 2:29
    which is the same as Red Hat. So it uses RPM. Like I said, this is Rocky
  • 2:29 - 2:33
    Linux, which is just like Red Hat Enterprise Linux version 9.
  • 2:33 - 2:38
    I think this is Rocky version 9. Anyway, in here, I have an RPM file.
  • 2:38 - 2:43
    Now, this is not normally how you would get a file
  • 2:43 - 2:47
    installed on your Linux system, but it used to be this way. And occasionally,
  • 2:47 - 2:49
    you'll have to install an RPM. But let's
  • 2:49 - 2:54
    say we had this RPM file and we wanted to install it using just the RPM tools--
  • 2:54 - 2:57
    not the package management system.
  • 2:57 - 3:02
    Well, we would do: sudo rpm -i for install
  • 3:02 - 3:04
    and then the file that we want to install.
  • 3:04 - 3:07
    And now, if there are no dependencies or all the dependencies are
  • 3:07 - 3:09
    already installed on your system, hey--no
  • 3:09 - 3:13
    problem. However--well, I’ve got to put in my password--
  • 3:13 - 3:18
    you'll see here it's not going to install because we also have to have
  • 3:18 - 3:28
    libteam and libteam.so.5, which is probably part of the libteam file.
  • 3:28 - 3:30
    Yeah. That’s actually what it's saying.
  • 3:30 - 3:32
    It needs it from the libteam file. So what
  • 3:32 - 3:34
    we would have to do is go online and
  • 3:34 - 3:42
    try to find the proper version of libteam.rpm with the exact version
  • 3:42 - 3:44
    that we're looking for on the repos.
  • 3:44 - 3:46
    We would install that. And then, if that has
  • 3:46 - 3:50
    its own dependencies, we end up in something that used to be called "RPM
  • 3:50 - 3:56
    Hell." It was kind of a play on the term "DLL Hell," which is what Windows
  • 3:56 - 4:00
    users would talk about—like, "This DLL (Dynamic Link Library) in Windows
  • 4:00 - 4:02
    interferes with that DLL, and so I can't
  • 4:02 - 4:04
    have them both installed, and I can't get
  • 4:04 - 4:06
    my package to work," etc., etc. So this used
  • 4:06 - 4:08
    to be a very frustrating way to install
  • 4:08 - 4:11
    packages. And, of course, it's not limited
  • 4:11 - 4:15
    just to RPM-based things. The same thing is true on a Debian or Ubuntu
  • 4:15 - 4:18
    system that uses DEBs. So here, I'm on an
  • 4:18 - 4:20
    Ubuntu system which uses .deb files,
  • 4:20 - 4:22
    and you'll see I've already downloaded one.
  • 4:22 - 4:28
    This is curl, like the curl we talked about in a previous video. curl is used to
  • 4:28 - 4:30
    fetch a URL or a file online.
  • 4:30 - 4:33
    The curl program, though--to install it--we
  • 4:33 - 4:38
    could use the dpkg program, which manually
  • 4:38 - 4:45
    handles .deb files. So we could do: sudo dpkg -i for install and then this
  • 4:45 - 4:47
    file, curl, blah, blah, blah, blah, blah, and
  • 4:47 - 4:50
    we'll press enter. And if there were no
  • 4:50 - 4:55
    dependencies that were unmet, it would have installed and been available on our system to use.
  • 4:55 - 4:57
    However, just like with that RPM file,
  • 4:57 - 5:03
    this says: "Well, no. This depends on libcurl4." So, in the old days, we’d
  • 5:03 - 5:09
    have to go and find libcurl with the exact version it's looking
  • 5:09 - 5:13
    for, install that .deb file. Of course, that .deb file might have some other
  • 5:13 - 5:16
    dependency--like libcurl might depend on
  • 5:16 - 5:19
    glibc or something--and we’d have to find
  • 5:19 - 5:23
    that one and go all the way back until all the dependencies were met.
  • 5:23 - 5:26
    But thankfully, there is a better way.
  • 5:26 - 5:28
    In fact, there are quite a few better ways.
  • 5:28 - 5:31
    Because in the world of RPMs--like using Red Hat
  • 5:31 - 5:35
    or Rocky Linux, or even SUSE Linux, which
  • 5:35 - 5:41
    also uses the RPM system--there are package management systems that kind of
  • 5:41 - 5:48
    wrap around RPMs or DEBs, in the case of a Debian-based system.
  • 5:48 - 5:51
    And they kind of keep a database of all the
  • 5:51 - 5:56
    available packages on a repository on the Internet. When you say, "I want to
  • 5:56 - 6:01
    install something," it says, "Okay, what other dependencies are there?"
  • 6:01 - 6:04
    Then it finds all of those dependencies,
  • 6:04 - 6:07
    downloads and installs them, so you
  • 6:07 - 6:09
    don't have to track down each individual
  • 6:09 - 6:14
    one. It has made managing Linux so much better than it used to be.
  • 6:14 - 6:19
    But there are a lot of ways to skin the same cat--which is a horrible, horrible metaphor.
  • 6:19 - 6:24
    I don't like that. There are a lot of ways to manage packages in Linux.
  • 6:24 - 6:26
    I’ll show you the various ways mentioned in the
  • 6:26 - 6:28
    objectives, but note that there are others. Like,
  • 6:28 - 6:30
    if you're using Arch Linux, there's going to be Pacman.
  • 6:30 - 6:33
    We're not covering that. We're just going to cover the ones mentioned
  • 6:33 - 6:35
    in the objectives--and they are the most common.
  • 6:35 - 6:37
    So, for example, we're back here.
  • 6:37 - 6:39
    We're on Rocky Linux, which, like I said,
  • 6:39 - 6:42
    is just like Red Hat Linux. And instead
  • 6:42 - 6:44
    of using the RPM tool, we can say: "Oh, well,
  • 6:44 - 6:47
    there are two different tools that come with Red Hat variants," which is
  • 6:47 - 6:52
    interesting. One is yum, which stands for Yellowdog Updater Modified.
  • 6:52 - 6:54
    There's another whole story there. And the other
  • 6:54 - 6:58
    one is dnf, which was written by Red Hat,
  • 6:58 - 7:03
    and it stands for Dandified Yum, which I think is a little bit silly. dnf is newer.
  • 7:03 - 7:05
    It's the one that you should be using on
  • 7:05 - 7:08
    a Red Hat-based system because it has a
  • 7:08 - 7:12
    few more features--like the ability to roll back if you want to make a change.
  • 7:12 - 7:16
    I'll show you what I mean. But first of all, to install--let’s say--this
  • 7:16 - 7:19
    teamd thing that I had downloaded, we could say:
  • 7:19 - 7:26
    sudo yum install teamd
  • 7:26 - 7:28
    And this is the difference. See, we
  • 7:28 - 7:30
    couldn't install it before because there
  • 7:30 - 7:32
    were dependencies. The dependencies were
  • 7:32 - 7:35
    libteam. And like I said, libteam might
  • 7:35 - 7:39
    have its own dependencies--and sure enough, it does. If you look,
  • 7:39 - 7:44
    libteam apparently depends on libnl3-cli.
  • 7:44 - 7:48
    But the nice thing about using a package management system like YUM is
  • 7:48 - 7:53
    that it gets all of those dependencies and installs all of them.
  • 7:53 - 7:56
    So, in order to use YUM to install this teamd
  • 7:56 - 8:01
    package that I just randomly picked, I would just say "yes," and it would download
  • 8:01 - 8:05
    all of the packages required, install the dependencies, and then install that
  • 8:05 - 8:08
    package. Now, I'm going to say "no," not
  • 8:08 - 8:09
    because this doesn't work--this would
  • 8:09 - 8:11
    work perfectly fine--but I want to show
  • 8:11 - 8:15
    you how you would do the exact same thing using DNF.
  • 8:15 - 8:20
    In fact, the command-line flags are almost identical
  • 8:20 - 8:24
    when you're using DNF or YUM. So let's say:
  • 8:24 - 8:30
    sudo dnf install teamd.
  • 8:30 - 8:32
    And by looking at it, it even looks exactly the
  • 8:32 - 8:34
    same, right? It just has some more features.
  • 8:34 - 8:38
    So it's YUM, but "dandified"--thus the name, DNF.
  • 8:38 - 8:40
    um and this is going to do the exact
  • 8:40 - 8:41
    same thing it's going to download the
  • 8:41 - 8:42
    dependencies we'll actually do it this
  • 8:42 - 8:45
    time but it does the same thing whether
  • 8:45 - 8:47
    you're using yum or dnf
  • 8:47 - 8:50
    um it's saying that there is a gpg key
  • 8:50 - 8:53
    do I want to import that I'm going to
  • 8:53 - 8:56
    say yes I want to import that and boom
  • 8:56 - 8:58
    there it is installed it and now it's
  • 8:58 - 9:01
    running and it keeps up it keeps like a
  • 9:01 - 9:02
    database of everything that is installed
  • 9:02 - 9:04
    on the system so the next time we
  • 9:04 - 9:06
    install something if one of its
  • 9:06 - 9:09
    dependencies is this team D or or lib
  • 9:09 - 9:11
    team or whatever it was it'll say oh
  • 9:11 - 9:13
    that's already installed I don't need to
  • 9:13 - 9:16
    download that so like I said yum and dnf
  • 9:16 - 9:19
    are almost exactly the same when you're
  • 9:19 - 9:21
    using them on the command line it's very
  • 9:21 - 9:23
    possible that yum will go away in the
  • 9:23 - 9:25
    future right now it's still installed
  • 9:25 - 9:27
    it's still perfectly cromulent way to
  • 9:27 - 9:29
    you know manage the packages on your
  • 9:29 - 9:31
    system and you can mix or match you
  • 9:31 - 9:32
    could use yum and then you could use dnf
  • 9:32 - 9:35
    they have the same database of
  • 9:35 - 9:37
    information that they pull from so you
  • 9:37 - 9:39
    can use either or right now but it would
  • 9:39 - 9:43
    not surprise me if yum goes away at some
  • 9:43 - 9:45
    future version of red hat stuff it's
  • 9:45 - 9:48
    just been replaced by dnf so there's no
  • 9:48 - 9:51
    reason not to use dnf and dnf will do
  • 9:51 - 9:53
    like I said it will roll back it'll
  • 9:53 - 9:56
    allow you to take back uh like if you
  • 9:56 - 9:58
    install something in your side you want
  • 9:58 - 10:00
    to undo that dnf allows you to do that
  • 10:00 - 10:02
    whereas yum does not and that really is
  • 10:02 - 10:04
    one of the big differences between the
  • 10:04 - 10:06
    two is dnf has more features that being
  • 10:06 - 10:10
    a main one but whether you're using dnf
  • 10:10 - 10:13
    or yum you can do things like update
  • 10:13 - 10:15
    which will update all the packages on
  • 10:15 - 10:17
    your system if you say update and a
  • 10:17 - 10:19
    package name it will only update that
  • 10:19 - 10:21
    one package I'll show you really quick
  • 10:21 - 10:23
    how to do the rollback because since we
  • 10:23 - 10:25
    use dnf we could roll back so we're back
  • 10:25 - 10:27
    here on the system that we just
  • 10:27 - 10:29
    installed uh Team D Actually I don't
  • 10:29 - 10:30
    even know what team D is but you just
  • 10:30 - 10:33
    installed that and now if we do dnf now
  • 10:33 - 10:34
    we don't have to be root to do this one
  • 10:34 - 10:36
    but we could say dnf
  • 10:36 - 10:38
    history
  • 10:38 - 10:41
    and it's going to show us the stuff that
  • 10:41 - 10:44
    it did now it says it shows a full
  • 10:44 - 10:45
    history you're going to see that before
  • 10:45 - 10:48
    the video I actually removed Team D so
  • 10:48 - 10:51
    that all this would work but this shows
  • 10:51 - 10:53
    a history of all the things that have
  • 10:53 - 10:56
    been done with dnf on the system and
  • 10:56 - 10:59
    since we see that this was done the
  • 10:59 - 11:03
    install Team D was um ID number three so
  • 11:03 - 11:05
    we can say now this does require sudo
  • 11:05 - 11:06
    because it's going to make some
  • 11:06 - 11:08
    system-wide changes we could say sudo
  • 11:08 - 11:12
    dnf history undo and then the number
  • 11:12 - 11:15
    three that last thing if we do that
  • 11:15 - 11:18
    it's going to remove the packages and
  • 11:18 - 11:19
    the dependencies that we just installed
  • 11:19 - 11:21
    basically it's going to just roll back
  • 11:21 - 11:24
    exactly what we just did
  • 11:24 - 11:25
    so I'm going to say yes
  • 11:25 - 11:27
    and now we have we don't have Team d
  • 11:27 - 11:30
    installed anymore so that's one of the
  • 11:30 - 11:33
    advantages of dnf over yum when it comes
  • 11:33 - 11:35
    to upgrading packages on your system
  • 11:35 - 11:38
    whether you're using yum or dnf there
  • 11:38 - 11:40
    are two very similar sounding and kind
  • 11:40 - 11:44
    of confusing terms you can either do uh
  • 11:44 - 11:48
    yum or dnf update and if you do that if
  • 11:48 - 11:50
    you specify a package it's just going to
  • 11:50 - 11:52
    update that one package but if you do it
  • 11:52 - 11:54
    without any other you know things at the
  • 11:54 - 11:56
    end just update and press enter it's
  • 11:56 - 11:59
    going to update all of the packages on
  • 11:59 - 12:01
    your system which is normally what you
  • 12:01 - 12:03
    want to do normally you want to update
  • 12:03 - 12:05
    all the packages to get them up to date
  • 12:05 - 12:06
    and you can see there's a whole bunch of
  • 12:06 - 12:08
    them it actually shows you different
  • 12:08 - 12:10
    kinds like it's going to install a new
  • 12:10 - 12:11
    kernel because there's a new kernel and
  • 12:11 - 12:12
    then it will activate that so I'll have
  • 12:12 - 12:15
    to restart it's going to upgrade all
  • 12:15 - 12:18
    these packages and it's going to install
  • 12:18 - 12:21
    these dependencies down here because the
  • 12:21 - 12:23
    new updated packages require updated
  • 12:23 - 12:25
    dependencies as well so you can can do
  • 12:25 - 12:27
    update and that's pretty safe the other
  • 12:27 - 12:29
    thing the other option that you have I'm
  • 12:29 - 12:31
    going to say no here the other option
  • 12:31 - 12:32
    you have and again whether using dnf or
  • 12:32 - 12:34
    yum so we'll use dnf this time just
  • 12:34 - 12:38
    because you can say upgrade instead of
  • 12:38 - 12:40
    update and the difference here is that
  • 12:40 - 12:44
    it's going to allow the system to get
  • 12:44 - 12:47
    rid of obsolete packages and these are
  • 12:47 - 12:50
    packages that are obsolete no longer
  • 12:50 - 12:54
    like current however it's possible that
  • 12:54 - 12:55
    some of those packages are things you're
  • 12:55 - 12:57
    still using so it's a little more
  • 12:57 - 12:59
    dangerous to do upgrade a lot of times
  • 12:59 - 13:02
    if you have update upgraded from like
  • 13:02 - 13:06
    red hat 8 to Red Hat 9 on your system
  • 13:06 - 13:08
    you can do upgrade and it will get rid
  • 13:08 - 13:10
    of obsolete packages and replace it with
  • 13:10 - 13:13
    updated ones but just know that it could
  • 13:13 - 13:14
    break stuff if you're actually using
  • 13:14 - 13:17
    those older packages so upgrade is
  • 13:17 - 13:19
    generally not used as much as update on
  • 13:19 - 13:21
    a red hat system but we'll say upgrade
  • 13:21 - 13:23
    and it's going to do the exact same
  • 13:23 - 13:24
    thing in this case it's the same
  • 13:24 - 13:26
    packages there aren't any the obsoleted
  • 13:26 - 13:27
    ones that it's you know worrying about
  • 13:27 - 13:29
    getting rid of because again we're not
  • 13:29 - 13:31
    changing anything drastic on our system
  • 13:31 - 13:33
    and so it's going to do the exact same
  • 13:33 - 13:35
    thing but just know that upgrade has the
  • 13:35 - 13:37
    potential to Break Stuff uh easier than
  • 13:37 - 13:40
    update does and it I hate that it's like
  • 13:40 - 13:43
    such similar words but the thing is
  • 13:43 - 13:46
    upgrade think of it as like I upgraded
  • 13:46 - 13:48
    to a new version of the Linux system as
  • 13:48 - 13:50
    opposed to just updating my current
  • 13:50 - 13:52
    packages maybe that'll help anyway we
  • 13:52 - 13:55
    say why it's going to go download all of
  • 13:55 - 13:57
    the stuff it's going to install it again
  • 13:57 - 13:59
    in this case it's a kernel package that
  • 13:59 - 14:01
    it's updating and going to recompile all
  • 14:01 - 14:03
    the all the modules that it needs to and
  • 14:03 - 14:05
    it will tell us that we need to reboot
  • 14:05 - 14:07
    in order to you know complete and
  • 14:07 - 14:10
    activate it and so if that's the kind of
  • 14:10 - 14:11
    thing that it's a production system you
  • 14:11 - 14:13
    might have to time when you can upgrade
  • 14:13 - 14:16
    it if it's going to require a reboot now
  • 14:16 - 14:18
    you probably remember that I said Souza
  • 14:18 - 14:21
    Linux also uses RPM and that's true the
  • 14:21 - 14:25
    underlying packages are RPM on Azusa
  • 14:25 - 14:28
    Linux box however it does not use yum or
  • 14:28 - 14:32
    dnf to manage the packages it uses
  • 14:32 - 14:35
    something called zipper and so I'll show
  • 14:35 - 14:38
    you that again the underlying stuff is
  • 14:38 - 14:41
    still RPM files and that's how it you
  • 14:41 - 14:43
    know maintains its packages but the
  • 14:43 - 14:45
    actual system to keep track of
  • 14:45 - 14:47
    dependencies and what's installed and
  • 14:47 - 14:49
    and where all the repositories online
  • 14:49 - 14:52
    are and stuff that uses the zipper
  • 14:52 - 14:54
    program which is completely different
  • 14:54 - 14:56
    from red hat or rocky Linux so I'm here
  • 14:56 - 15:00
    on open Souza and this is again an RPM
  • 15:00 - 15:02
    based system but it uses zipper and
  • 15:02 - 15:05
    zipper has slightly different commands
  • 15:05 - 15:07
    in order to do things rather than just
  • 15:07 - 15:11
    update and upgrade there are update or
  • 15:11 - 15:13
    just up it allows you to use shortcuts
  • 15:13 - 15:16
    there is dist upgrade which is very
  • 15:16 - 15:18
    rarely used and that's the same sort of
  • 15:18 - 15:21
    thing where it can remove packages for
  • 15:21 - 15:23
    you uh even if you don't want it to so
  • 15:23 - 15:26
    we don't normally do dist Dash upgrade
  • 15:26 - 15:29
    but zipper or open Souza has another
  • 15:29 - 15:31
    option that red hat does in it that's
  • 15:31 - 15:34
    called patch and patch basically just
  • 15:34 - 15:36
    installs the very important things like
  • 15:36 - 15:38
    security updates and stuff that you know
  • 15:38 - 15:40
    if there's a security release that has
  • 15:40 - 15:42
    to be installed even on a production
  • 15:42 - 15:44
    system you can do patch and it will
  • 15:44 - 15:47
    install those without updating all of
  • 15:47 - 15:49
    the other packages that may have updates
  • 15:49 - 15:52
    but they're not like super important
  • 15:52 - 15:55
    they're not security related updates so
  • 15:55 - 15:58
    patch is something that you can use more
  • 15:58 - 16:00
    often on a production system knowing
  • 16:00 - 16:02
    that it's just going to update the
  • 16:02 - 16:04
    things that are a security risk on your
  • 16:04 - 16:05
    system it's kind of cool actually and it
  • 16:05 - 16:11
    works similarly uh sudo z y p p e r is
  • 16:11 - 16:14
    the program instead of dnf or yum it's
  • 16:14 - 16:16
    zipper and then you can do things and I
  • 16:16 - 16:17
    didn't show you this with yum and dnf
  • 16:17 - 16:20
    but you can search for a package too so
  • 16:20 - 16:21
    we'll do it here it works the same on
  • 16:21 - 16:23
    the others I mean you can play with it
  • 16:23 - 16:25
    and look at the man page but we can say
  • 16:25 - 16:29
    search for Firefox I guess oh and this
  • 16:29 - 16:30
    is something it says sudo password for
  • 16:30 - 16:32
    root but it's my local password that it
  • 16:32 - 16:34
    wants that's just some weird open Sousa
  • 16:34 - 16:36
    thing and it looked in its repositories
  • 16:36 - 16:38
    and these are the things that it found
  • 16:38 - 16:42
    so we could install for example uh
  • 16:42 - 16:45
    Mozilla Firefox we can install using
  • 16:45 - 16:47
    zipper and it's going let's let's do it
  • 16:47 - 16:48
    sudo
  • 16:48 - 16:50
    zipper
  • 16:50 - 16:53
    install or you can just do in it they're
  • 16:53 - 16:55
    real big on like shortcuts but I I mean
  • 16:55 - 16:56
    it's confusing enough having multiple
  • 16:56 - 16:58
    ways to install packages on multiple
  • 16:58 - 16:59
    distros so I'm just going to type the
  • 16:59 - 17:00
    whole thing
  • 17:00 - 17:02
    install
  • 17:02 - 17:03
    Mozilla
  • 17:03 - 17:07
    Firefox now it did the exact same thing
  • 17:07 - 17:09
    it found any dependencies that it might
  • 17:09 - 17:11
    need and it did find a dependency it
  • 17:11 - 17:13
    said it's going to install the following
  • 17:13 - 17:16
    two packages this package and this
  • 17:16 - 17:19
    package in order to get the Mozilla
  • 17:19 - 17:20
    Firefox and it looks like it's going to
  • 17:20 - 17:21
    upgrade it it looks like it's already
  • 17:21 - 17:24
    installed which is fine so do I want to
  • 17:24 - 17:27
    do this why is the default but I'm going
  • 17:27 - 17:29
    to say yes it's going to download all of
  • 17:29 - 17:32
    those things it's going to install it
  • 17:32 - 17:34
    um and I shouldn't have said yes because
  • 17:34 - 17:36
    I'll just I'll fast forward I won't make
  • 17:36 - 17:37
    you wait but oh really quickly look you
  • 17:37 - 17:40
    see it's downloading RPM files so it is
  • 17:40 - 17:42
    using an RPM system underneath so I'm
  • 17:42 - 17:44
    glad I hit enter so I can show you that
  • 17:44 - 17:46
    um so okay that's installed we could do
  • 17:46 - 17:48
    the same thing with you know update or
  • 17:48 - 17:51
    or dist upgrade but the one thing that's
  • 17:51 - 17:54
    kind of unique here sudo
  • 17:54 - 17:56
    zipper
  • 17:56 - 17:59
    patch what this will do is it will
  • 17:59 - 18:00
    there's nothing to do there are no
  • 18:00 - 18:03
    security issues currently on on the
  • 18:03 - 18:07
    system that a patch would would do so we
  • 18:07 - 18:09
    can even if you know there are upgrades
  • 18:09 - 18:11
    available or updates available for our
  • 18:11 - 18:13
    packages we don't have to necessarily
  • 18:13 - 18:14
    install them on a production system
  • 18:14 - 18:16
    because there are no security ones
  • 18:16 - 18:18
    currently available hopefully that makes
  • 18:18 - 18:21
    sense that's a again a big deal but we
  • 18:21 - 18:23
    could do sudo
  • 18:23 - 18:25
    zipper
  • 18:25 - 18:28
    update and this will update all the
  • 18:28 - 18:30
    packages that are available to update
  • 18:30 - 18:32
    and you can say if we if we hit yes here
  • 18:32 - 18:35
    it's going to get 232 packages to
  • 18:35 - 18:37
    upgrade three of them new one of them is
  • 18:37 - 18:38
    going to change its architecture
  • 18:38 - 18:40
    interestingly enough but notice here it
  • 18:40 - 18:43
    says open Sousa Tumbleweed requires a
  • 18:43 - 18:44
    zipper
  • 18:44 - 18:47
    dup dup again they're all about
  • 18:47 - 18:50
    shortcuts is short for dist Dash upgrade
  • 18:50 - 18:54
    and that's because Tumbleweed I'm
  • 18:54 - 18:55
    getting in the weeds here with Souza but
  • 18:55 - 18:57
    in the weeds I didn't even mean that um
  • 18:57 - 19:00
    it's a it's a rolling distribution and
  • 19:00 - 19:02
    so that means that we're basically going
  • 19:02 - 19:05
    to upgrade will be more more common
  • 19:05 - 19:07
    because it it doesn't like have releases
  • 19:07 - 19:11
    it just is a rolling release so to fully
  • 19:11 - 19:13
    upgrade Tumbleweed we will do dist
  • 19:13 - 19:16
    upgrade or just dup it's shortcut so I'm
  • 19:16 - 19:18
    going to say no just so I can show you
  • 19:18 - 19:21
    that and then we'll be done sudo zipper
  • 19:21 - 19:24
    I could do dupp but again I don't like
  • 19:24 - 19:28
    that dist upgrade and this is going to
  • 19:28 - 19:31
    go through and now install again it's
  • 19:31 - 19:33
    installing the same packages it's just
  • 19:33 - 19:34
    telling you like hey when you have
  • 19:34 - 19:37
    Tumbleweed the rolling distribution you
  • 19:37 - 19:39
    should use dist upgrades so you know do
  • 19:39 - 19:40
    it that way you will usually we don't
  • 19:40 - 19:42
    use that in a production server
  • 19:42 - 19:44
    environment anyway but nonetheless
  • 19:44 - 19:46
    that's the difference between the two we
  • 19:46 - 19:48
    can press enter and it's going to
  • 19:48 - 19:50
    upgrade all of the things but it does
  • 19:50 - 19:51
    tell us that a system reboot is going to
  • 19:51 - 19:53
    be required because it's installing a
  • 19:53 - 19:54
    new kernel which is awesome information
  • 19:54 - 19:57
    for it to tell us in advance and that
  • 19:57 - 19:59
    leaves us with the system that I
  • 19:59 - 20:00
    actually prefer I use the most is a
  • 20:00 - 20:02
    Debian based system or dot Deb files
  • 20:02 - 20:06
    using apt and apt is the package
  • 20:06 - 20:09
    management system for Dev files uh apt
  • 20:09 - 20:12
    is used in Ubuntu and Debian there are
  • 20:12 - 20:15
    some others like apt-get is kind of a
  • 20:15 - 20:17
    package management system that uses the
  • 20:17 - 20:19
    app database and just like you can use
  • 20:19 - 20:22
    yum and dnf at the same time you can use
  • 20:22 - 20:24
    apt and apt-get and it just writes to
  • 20:24 - 20:26
    the same database so you can use either
  • 20:26 - 20:30
    one apt alone apt is the most recent one
  • 20:30 - 20:32
    and it's the one mentioned in the
  • 20:32 - 20:33
    objective so that's what I'm going to
  • 20:33 - 20:35
    show you that's what I use and there are
  • 20:35 - 20:38
    a couple nuances with dev-based systems
  • 20:38 - 20:41
    versus RPM based systems and the biggest
  • 20:41 - 20:43
    difference and this really is a big
  • 20:43 - 20:47
    difference is that with yum and dnf and
  • 20:47 - 20:50
    zipper when you search for a package or
  • 20:50 - 20:52
    install a package before it does
  • 20:52 - 20:55
    anything those systems will go and
  • 20:55 - 20:58
    refresh everything on the web like they
  • 20:58 - 21:01
    will get an update of all of the
  • 21:01 - 21:03
    available packages and versions but with
  • 21:03 - 21:05
    an apt-based system
  • 21:05 - 21:08
    that's an extra step you actually have
  • 21:08 - 21:10
    to refresh the what is available
  • 21:10 - 21:14
    database and to do that sudo apt update
  • 21:14 - 21:18
    so in this case update means I want to
  • 21:18 - 21:21
    update my cached information of packages
  • 21:21 - 21:24
    that are available and what versions are
  • 21:24 - 21:27
    on my repositories on the internet so it
  • 21:27 - 21:28
    means something drastically different
  • 21:28 - 21:29
    but it's important to do this first
  • 21:29 - 21:32
    because if you don't update then you
  • 21:32 - 21:34
    have old information you don't know what
  • 21:34 - 21:37
    packages are available so sudo apt
  • 21:37 - 21:40
    update oh come on there finally and it
  • 21:40 - 21:42
    will get you know it'll refresh its
  • 21:42 - 21:44
    cache of what stuff is available this
  • 21:44 - 21:46
    goes pretty quick as you can see it's
  • 21:46 - 21:49
    already done and now we can use apt to
  • 21:49 - 21:53
    upgrade or dist upgrade and this is
  • 21:53 - 21:55
    similar in that like the the different
  • 21:55 - 21:58
    degrees of upgrade because upgrade is
  • 21:58 - 22:00
    going to do all the packages that have
  • 22:00 - 22:04
    updates but it's not going to allow it
  • 22:04 - 22:07
    to remove package is and like do big
  • 22:07 - 22:09
    changes this is the same sort of thing
  • 22:09 - 22:12
    generally dist upgrade in an app system
  • 22:12 - 22:14
    is a little more dangerous and dangerous
  • 22:14 - 22:16
    isn't really a good word but it's it's
  • 22:16 - 22:18
    more apt and that's too punny for me to
  • 22:18 - 22:21
    say it's possible that if you do dist
  • 22:21 - 22:24
    upgrade it might break packages on your
  • 22:24 - 22:27
    system but if you're doing like going
  • 22:27 - 22:30
    from one like version to another dist
  • 22:30 - 22:33
    upgrade will bring all of your packages
  • 22:33 - 22:36
    up to the current distribution numbers
  • 22:36 - 22:40
    versions by removing old stuff and
  • 22:40 - 22:42
    installing the new versions of them if
  • 22:42 - 22:44
    they exist that sort of thing so
  • 22:44 - 22:46
    generally you just do upgrade but dist
  • 22:46 - 22:49
    upgrade is available if you have like a
  • 22:49 - 22:50
    drastic change that you've done and so
  • 22:50 - 22:55
    we can simply do sudo apt upgrade oh
  • 22:55 - 22:59
    when we used D package to install curl
  • 22:59 - 23:02
    uh it screwed up the database uh you
  • 23:02 - 23:03
    remember earlier when I try to do it
  • 23:03 - 23:05
    manually it actually screwed it up and
  • 23:05 - 23:09
    so what we can do we could say
  • 23:09 - 23:13
    pseudo apt Dash F install and it will
  • 23:13 - 23:16
    fix what I broke in fact in this case
  • 23:16 - 23:18
    it's going to install curl properly by
  • 23:18 - 23:20
    getting its its dependencies so I'm
  • 23:20 - 23:23
    going to say yes and uh that's a really
  • 23:23 - 23:25
    nice feature that it will clean up my
  • 23:25 - 23:26
    mess because I tried to do it manually
  • 23:26 - 23:28
    even though I would never do that in
  • 23:28 - 23:30
    real life I was showing you kind of the
  • 23:30 - 23:31
    old way that we had to do it anyway so
  • 23:31 - 23:33
    it's fixed that and now I can actually
  • 23:33 - 23:36
    run upgrade and it'll say okay there are
  • 23:36 - 23:40
    75 upgrades uh five new installs three
  • 23:40 - 23:42
    are not upgraded 30 are standard
  • 23:42 - 23:47
    security updates and so this is how you
  • 23:47 - 23:50
    can keep your system up to date it says
  • 23:50 - 23:52
    that these have been held back if we
  • 23:52 - 23:55
    were to do dist upgrade these would also
  • 23:55 - 23:57
    be upgraded but again it has the
  • 23:57 - 24:01
    potential to break your system maybe
  • 24:01 - 24:03
    um yeah it's it's kind of a frustrating
  • 24:03 - 24:05
    thing generally you can avoid disk
  • 24:05 - 24:06
    upgrade and just do upgrades and you'll
  • 24:06 - 24:08
    be fine so that's pretty much what we
  • 24:08 - 24:10
    would do here I just press enter it's
  • 24:10 - 24:12
    going to go and upgrade all the stuff so
  • 24:12 - 24:13
    depending on your system you have lots
  • 24:13 - 24:16
    of options for package management the
  • 24:16 - 24:18
    big thing to remember is on a Debian
  • 24:18 - 24:20
    based system so using apt you have to do
  • 24:20 - 24:24
    apt update and then apt upgrade in fact
  • 24:24 - 24:26
    you have to do apt update before you do
  • 24:26 - 24:28
    like an apt install so like if we were
  • 24:28 - 24:31
    to do apt install Firefox we'd have to
  • 24:31 - 24:34
    do apt update first otherwise it's going
  • 24:34 - 24:36
    to try to pull an old version that
  • 24:36 - 24:38
    doesn't exist anymore so you always need
  • 24:38 - 24:40
    to do apt update before you make any
  • 24:40 - 24:43
    changes to your system it's funny that
  • 24:43 - 24:46
    yum and dnf and zipper all do that step
  • 24:46 - 24:48
    automatically and app just doesn't but
  • 24:48 - 24:50
    that's how it is with great power comes
  • 24:50 - 24:52
    great responsibility and this is one of
  • 24:52 - 24:54
    those examples anyway I hope that was
  • 24:54 - 24:56
    helpful I encourage you to play with the
  • 24:56 - 24:58
    different tools to see what they can do
  • 24:58 - 25:00
    and the different options and and how
  • 25:00 - 25:02
    they work differently install a couple
  • 25:02 - 25:04
    systems distributions in a virtualized
  • 25:04 - 25:06
    environment so if you break it you know
  • 25:06 - 25:09
    so what and just have fun but as always
  • 25:09 - 25:11
    learn everything
  • 25:11 - 25:14
    do what you love and most importantly be
  • 25:14 - 25:17
    kind I'll see you in the next video
Title:
Linux Package Managers (Linux+ Objective 1.6.1)
Description:

more » « less
Video Language:
English
Duration:
25:16

English subtitles

Revisions Compare revisions