• truthfultemporarily@feddit.org
    link
    fedilink
    arrow-up
    233
    arrow-down
    4
    ·
    15 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
    • grrgyle@slrpnk.net
      link
      fedilink
      arrow-up
      73
      ·
      15 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!

  • dan@upvote.au
    link
    fedilink
    arrow-up
    165
    ·
    edit-2
    15 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@lemmy.world
      link
      fedilink
      arrow-up
      39
      ·
      15 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 ).

      • themoonisacheese@sh.itjust.works
        link
        fedilink
        arrow-up
        15
        ·
        15 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

      • dan@upvote.au
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        15 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 :)

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    42
    arrow-down
    2
    ·
    edit-2
    15 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.

    • dan@upvote.au
      link
      fedilink
      arrow-up
      23
      ·
      edit-2
      15 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.

  • DonutsRMeh@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    15 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.

  • four@lemmy.zip
    link
    fedilink
    English
    arrow-up
    17
    ·
    15 days ago

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

    • Victor@lemmy.world
      link
      fedilink
      arrow-up
      24
      ·
      edit-2
      15 days ago

      Here lie dragons. Make sure you understand commands that you run on your computer. 👍

        • Rhaedas@fedia.io
          link
          fedilink
          arrow-up
          6
          ·
          15 days ago

          People don’t change. Some people look at what they’re repeating and try to understand the why, others blindly do what they are told by whom they deem as authority. LLMs are the latest, earlier were various websites (which LLMs were trained on, uh oh), still before that were the computer magazines with things to type in and the later versions even maybe a free CD of stuff. The printed media was less likely to have malicious things in them, but lord did they have errors, and the right error in the wrong place could ruin someone’s day if they just ran it without understanding it.

  • Empricorn@feddit.nl
    link
    fedilink
    English
    arrow-up
    8
    ·
    15 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…