• truthfultemporarily@feddit.org
    link
    fedilink
    arrow-up
    7
    ·
    1 month 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
      3
      ·
      1 month 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
    6
    ·
    edit-2
    1 month 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
      1
      ·
      1 month 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
        2
        ·
        1 month 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]@lemm.ee
          link
          fedilink
          arrow-up
          0
          ·
          1 month 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?

          • bisby@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 month 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]@lemm.ee
              link
              fedilink
              arrow-up
              1
              ·
              1 month 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

              • bisby@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                1 month 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.

          • themoonisacheese@sh.itjust.works
            link
            fedilink
            arrow-up
            0
            ·
            1 month 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]@lemm.ee
              link
              fedilink
              arrow-up
              1
              ·
              1 month 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.

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

        • Successful_Try543@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          1 month ago

          @fluckx@lemmy.world

          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.

          • dan@upvote.au
            link
            fedilink
            arrow-up
            0
            ·
            1 month ago

            That works, but why do that when you could just do apt install ./package-file.deb?

          • Unbecredible@lemm.ee
            link
            fedilink
            English
            arrow-up
            0
            ·
            edit-2
            1 month 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
  • Matombo@feddit.org
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    apt-get has a fixed format machine parseable output

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

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    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

    • superkret@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      1 month 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@lemmy.blahaj.zone
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month 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.

        • superkret@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          1 month 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@fedia.io
            link
            fedilink
            arrow-up
            0
            ·
            1 month 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.

            • superkret@feddit.org
              link
              fedilink
              arrow-up
              0
              ·
              edit-2
              1 month 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
              
  • four@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

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

  • DonutsRMeh@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month 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.

      • cmhe@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 month ago

        Yes, but apt-get is missing search for instance, because that relates to the cache, so apt-cache provides it.

        apt combines all those often used commands, and provides a nicer shell presentation.

      • DonutsRMeh@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 month 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@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month 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?

      • DonutsRMeh@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 month 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

  • Matriks404@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    Isn’t this explained in the manpages for apt(8) and apt-get(8)?

    Do people don’t read their manuals anymore?

  • keen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    1 month ago

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

  • pulsewidth@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    How my brain distinguishes them:

    apt-get when you want full verbose output

    apt when you want to feel fancy with progress bars and colours

    • mrsingh@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 month ago

      apt install nano (simple, clean)

      apt-get install nano (works too, but more detailed output)

      Apt-get give more technical output , helps in scripting .