• @[email protected]
    link
    fedilink
    35419 days ago

    The binary is called apt-get. There are others like apt-cache etc.

    Apt is a script that just figures out which binary to use and passes the arguments on.

    • apt update -> apt-get update
    • apt policy -> apt-cache policy
    • @[email protected]
      link
      fedilink
      12719 days ago

      You know, I thought I knew why, but this was new information to me, so I guess I didn’t.

      Thanks for sharing this concise explico!

  • @[email protected]
    link
    fedilink
    16319 days ago

    apt is a newer, more user-friendly front-end for apt-get and apt-cache.

    apt = combines commands like install, remove, update, upgrade into one tool, with prettier output

    #apt-get = older, lower-level, more script-friendly For normal use, just use apt now. For scripting where 100% backward compatibility matters, use apt-get.

      • @[email protected]
        link
        fedilink
        318 days ago

        Lol. You’re not alone. I’ve thought that for the longest time ever. Until one I had the question pop into my head and started searching it.

    • Captain Aggravated
      link
      fedilink
      English
      218 days ago

      If I recall correctly, Linux Mint did their own thing for a bit with the apt command so there were two different implementations out there for awhile?

      • @[email protected]
        link
        fedilink
        218 days ago

        I don’t know if they modified apt at all. I know they have their mint tools that call apt through some python code, like mintinstall = apt install <package> for the software manager and mintupgrade = apt upgrade for updating mint versions … Etc

  • @[email protected]
    link
    fedilink
    289
    edit-2
    19 days ago

    These days, apt is for humans whereas apt-get is for scripts. apt’s output is designed for humans and may change between releases, whereas apt-get is guaranteed to remain consistent to avoid breaking scripts.

    apt combines several commands together. For example, you can use it to install packages from both repos and local files (e.g. apt install ./foo.deb) whereas apt-get is only for packages from repos and you’d need to use dpkg for local packages.

    • nelson
      link
      fedilink
      7619 days ago

      Huh TIL.

      I never considered trying to install a package from a local file through apt, but always dpkg. End result is the same of course. The web suggests dpkg rather than apt as well ( or at least the pages I ended up on ).

      • @[email protected]
        link
        fedilink
        3619 days ago

        Discord is distributed as a .Deb if you don’t use flatpak because they can’t be bothered to set up a repo.

        The very useful thing about local file install is that unlike dpkg, apt will install dependencies automatically

        • Fushuan [he/him]
          link
          fedilink
          219 days ago

          Thats weird, they do have an arch official package and that’s the one they usually don’t make because AUR is a thing. Have you checked lately?

          • @[email protected]
            link
            fedilink
            English
            1019 days ago

            An “official” arch package? The arch package is packaged by the arch maintainers. https://gitlab.archlinux.org/archlinux/packaging/packages/discord

            The maintainers of the PKGBUILD are all arch maintainers, which just downloads the generic .tar.gz file discord provides and puts it in all the places you need for you.

            The “official” arch packages are just PKGBUILDs like the AUR, except prebuilt, managed (and signed) by the arch team.

            • Fushuan [he/him]
              link
              fedilink
              319 days ago

              I didn’t know, thanks! I guess in hindsight I meant “official” as in, it’s not just some rando, I can trust it won’t break, and I don’t have to manually download the stuff every time xD

              • @[email protected]
                link
                fedilink
                English
                418 days ago

                Yep! All those things are true, but it’s due to the hard work of the archlinux team and not discord doing anything valuable. The debian/ubuntu/etc team could probably repackage the tar.xz or include the deb file in their official repos if they wanted. They just don’t. And given how simple the workaround is, i don’t really blame them. Debian isn’t going to ship something that will require constant updating to work with remote servers, and ubuntu probably just wants you to use a snap anyway.

                The archlinux team is just pretty cool.

          • @[email protected]
            link
            fedilink
            119 days ago

            I have checked on every new update because their fuckass client apparently can’t update itself in big 2025 and instead just opens your browser to the download url because that’ll convince people that Linux is great.

            • Fushuan [he/him]
              link
              fedilink
              719 days ago

              Updating itself isn’t really the Linux way of things. The Linux way is to have a centralised place like pacman or apt and to download everything at once. Every app having their own download and update system sounds like a nightmare.

              • @[email protected]
                link
                fedilink
                118 days ago

                The nightmare in question is windows. My point was that since their client isn’t distributed by a mechanism with automatic updates, they could at least have made it work, but no.

        • Maki
          link
          fedilink
          319 days ago

          And here I am using gdebi for those kinds of local packages…

      • @[email protected]
        link
        fedilink
        9
        edit-2
        19 days ago

        apt and apt-get both use dpkg internally, but these days it’s essentially seen as an implementation detail that regular users don’t need to know about.

        dpkg doesn’t resolve dependencies (that’s a feature of apt) which means that if you install a Debian package with dpkg, you’ll have to manually install all dependencies first, and they won’t be marked as automatically installed (so autoremove won’t remove them if they’re not needed any more). Using apt solves that.

        The web suggests dpkg because either the articles are old, or they’re based on outdated knowledge :)

        • @[email protected]
          link
          fedilink
          3
          edit-2
          19 days ago

          @[email protected]

          dpkg doesn’t resolve dependencies (that’s a feature of apt) which means that if you install a Debian package with dpkg, you’ll have to manually install all dependencies first, and they won’t be marked as automatically installed

          Usually installing a manually downloaded package and its dependencies works like this:
          # dpkg -i package-file.deb
          # apt-get -f install

          So apt-get can be used to install missing dependencies afterwards while marking them as automatically installed.

            • @[email protected]
              link
              fedilink
              119 days ago

              Sure, but as I understood, the question was how to do that “properly” with dpkg and apt-get, i.e. without the ‘new’ apt script.

          • Unbecredible
            link
            fedilink
            English
            3
            edit-2
            18 days ago

            Descheduling is a natural part of life, buddy. All us scripts are written into existence and our hearts set beating to the cadence of great Cron’s ever-ticking quartz clock. Until Cron takes us off his schedule and our memory is freed once again.

            Back to the silicon.

            • Joe Abercrombie

            The question, O me! so sad, recurring—What good amid these, O me, O life?

            Answer.

            That you are here—that life exists and identity,

            That the powerful OS goes on, and you may contribute a process.

            That the powerful OS goes on, and you may contribute a process.

            • Walt Whitman
  • @[email protected]
    link
    fedilink
    English
    50
    edit-2
    19 days ago

    apt is newer and mostly supersedes apt-get/apt-cache/etc tools, tries to be a more-approachable frontend.

    They interoperate though, so if you’re happy with using a mix of them, go for it. I generally just use apt.

    EDIT: There were also some older attempts to produce a unified frontend, like aptitude.

    • @[email protected]
      link
      fedilink
      26
      edit-2
      19 days ago

      mostly supersedes apt-get/apt-cache/etc tools,

      Except for in scripts. Debian guarantee that the output format of apt-get will never change and thus it’s safe to use in scripts that parse the output, whereas they don’t have the same guarantee for apt, which can change between releases.

    • @[email protected]
      link
      fedilink
      English
      519 days ago

      Aptitude is great (my favorite way of managing packages), but it’s a TUI program. You can use it as CLI, at which point it mimics apt-get.

      So I would say it never attempted to unify apt commands, by rather it successfully provided a user friendly way to do most (all?) of what you could do with apt CLI tools.

    • DasFaultier
      link
      fedilink
      419 days ago

      They interoperate though, so if you’re happy with using a mix of them, go for it.

      Same goes for nala, BTW.

  • @[email protected]
    link
    fedilink
    English
    819 days ago

    I know about these and git and flatpaks and snaps and can definitely explain them all to you! But unfortunately, I just remembered I left my oven on…

  • @[email protected]
    link
    fedilink
    1719 days ago

    I came in for the jokes but all I found was helpful responses. Did I get the Nazi virus from Reddit?

  • @[email protected]
    link
    fedilink
    6519 days ago

    apt-get has a fixed format machine parseable output

    apts output tries to be more human readable and is subject to change

  • themeatbridge
    link
    fedilink
    918 days ago

    apt is for like when you want to, and apt get is the other way to get the apt. And then if it doesn’t, sudo apt will, or then sudo apt get. Like if you’re just doing an apt, and then you also need to apt get, you can.

    • socsa
      link
      fedilink
      English
      317 days ago
      1. You can’t just be up there and just doin’ a apt like that.

      1a. An apt-get is when you

      1b. Okay well listen. An apt-get is when you get the

      1c. Let me start over

      1c-a. The user is not allowed to do a motion to the, uh, kernel, that prohibits the kernel from doing, you know, just trying to get the apt. You can’t do that.

      1c-b. Once the user is in the terminal, he can’t be over here and say to the packag, like, “I’m gonna get ya! I’m gonna apt you out! You better watch your butt!” and then just be like he didn’t even do that.

      1c-b(1). Like, if you’re about to apt and then don’t get, you have to still apt. You cannot not apt. Does that make any sense?

      1c-b(2). You gotta be, typing motion of the command, and then, until you just apt-get it.

  • @[email protected]
    link
    fedilink
    1219 days ago

    This is one of the reasons I need to set up Linux at home. I use it at work but who knows what the flavor of the week is?

    At this point I can’t tell the difference between yum and rpm and apt and dnf

    • @[email protected]
      link
      fedilink
      English
      9
      edit-2
      19 days ago

      Edit: realized you meant in the sense of hot swapping flavors after I typed out a whole explanation lol. Should start recommending niche distros and collect package managers like trading cards lol.

      yum = dnf, dnf is just the newer version which was rewritten several times.

      apt is a weird attempt to “upgrade” apt-get with better user interface without messing with the compatibility of apt-get used by scripts and whatnot.

      Both of these are dependency handling package managers which do all the magic of installing required subpackges when you want something.

      rpm is the underlying system package manager which deals with the actual task of installing, removing, and generating packages in the .rpm format. It is analogous to Debian’s dpkg which uses the .deb format. It’s usually not used by the end user unless you need to play with a package directly like with a .rpm or .deb file.

      Hence why some distros (or people) have their own dependency package manager, like zypper on OpenSUSE (rpm) or Aptitude on Debian (deb).

      Although I think Aptitude might just be a fancy wrapper for apt lol.

    • @[email protected]
      link
      fedilink
      219 days ago

      Me too but I am just zen at this point knowing the knowledge is one search away (I don’t even have to read the man)

      • @[email protected]
        link
        fedilink
        118 days ago

        I’ve had better results by including “man” in my searches to find the man pages, but man that makes for some questionable looking searches

  • @[email protected]
    link
    fedilink
    English
    2019 days ago

    When working with RHEL I always flip a coin to see if I’m gonna use yum or dnf this time

  • keen
    link
    fedilink
    12
    edit-2
    18 days ago

    Use apt in the shell and use apt-get in scripts, because apt has beautiful shell output but it isn’t script safe

  • @[email protected]
    link
    fedilink
    8
    edit-2
    19 days ago

    I got mistaken. See replies for explanation

    =======

    Apt: get whatever is in the cached package list

    Apt-get: lookup the package to see the latest version and get that one

    Unless you always apt update, apt-get is the go to choice for modern day Linux

    There’s also the apt-apt command, who triggers any audiophile to start complaining about mainstream music quality these days

    • @[email protected]
      link
      fedilink
      4019 days ago

      I disagree. According to Debian’s own documentation, apt is a newer front-end for your daily CLI updating and installing needs.
      It has simplified syntax, and combines the most-used functions and options.
      It is not meant for use in scripts, cause the syntax may change between versions.

      The dependency-solver in the back-end is identical.

      tl/dr:
      apt is shorter to type and will have prettier output, starting with Debian 13.
      Use apt-get inside scripts.

      • Snot Flickerman
        link
        fedilink
        English
        619 days ago

        My personal experience is that apt-get will absolutely miss packages that apt will capture.

        I was actually surprised by that about six months ago and finally switched over to apt after years of apt-get.

        • @[email protected]
          link
          fedilink
          419 days ago

          That’s actually one of the reasons I switched from Debian to Arch.
          Dependency resolution shouldn’t differ based on which front-end you use.
          Debian has dpkg, aptitude, apt-get, apt, synaptic, the Software Center…
          Fedora has rpm, dnf, yum. SUSE adds a couple more. I don’t get it.
          A linux distro should have one package manager, doing different stuff with it should be done via different commands/options inside it.

          • Rhaedas
            link
            fedilink
            319 days ago

            As a (still) Linux novice, this is something that I noticed with later distributions but never thought about your valid point. I did always wonder why there should be different places to install things in the same OS. It would probably be fine if they handled things the same, but then all you’re doing is changing the UI. It never “felt” like they did things the same.

          • Snot Flickerman
            link
            fedilink
            English
            219 days ago

            Out of curiosity, can pacman update flatpaks? Or do you still have to update those independent of your package manager?

            • @[email protected]
              link
              fedilink
              3
              edit-2
              19 days ago

              It can’t. I use a very simple script to combine updates and the basics of system maintenance:

              #!/usr/bin/env bash
              systemctl --failed -q
              yay -Pw
              sudo pacman -Syu
              flatpak update
              flatpak uninstall --unused
              pacman -Qqnte > ~/.local/share/applications/pkglist.txt
              pacman -Qqdtt > ~/.local/share/applications/optdeplist.txt
              pacman -Qqem > ~/.local/share/applications/foreignpkglist.txt
              pacman -Qtd
              pacman -Qm | grep -v yay-bin
              sudo find /etc -name *.pac*
              yay -Ps | grep Cache
              
    • @[email protected]
      link
      fedilink
      English
      319 days ago

      Alias is your friend.

      alias install=“sudo apt update && sudo apt install -y”

      install git

        • @[email protected]
          link
          fedilink
          English
          2
          edit-2
          19 days ago

          Oh sorry.

          install is already a part of make/cmake as well, so it’d break any of those workflows also.

          The joke I thought I was making was “I’m too lazy to type out what I want, let’s just break the system instead.”

    • bitwolf
      link
      fedilink
      English
      2419 days ago

      There is the subtle difference that the output if apt-get is optimized for automations

      Apt has pretty outputs with colors etc

        • @[email protected]
          link
          fedilink
          219 days ago

          D’oh, I’m a doofus — it’s search that I was thinking of (apt-cache search, not apt-get search).