I have tried, unsuccessfully, to get various AI models to create a script that will curl or wget the latest Ubuntu LTS desktop torrent, even should that LTS version update in the future (beyond 24.01.1 LTS). The purpose is that I would like to seed whatever the latest LTS torrent is and I don’t want to have to keep checking the Ubuntu page for updates, I want it automatic. I know that LTS is slow to change versions but I am annoyed that AI can’t just write a decent script for this.

I also have downloaded rtorrent as a command line and will deal with how to make sure the latest LTS is used, as opposed to the prior one, with a different script later, but that’s not what I’m trying to now.

I am not asking for a human to create this script for me. I am asking why AI models keep getting this so wrong. I’ve tried ChatGPT 4o, I’ve tried DeepSeek, I’ve tried other localized models, Reasoning Models. They all fail. And when I execute their code, and I get errors and show it to the models, they still fail, many times in a row. I want to ask Lemmy if getting an answer is theoretically possible with the right prompt or if AI just sucks at coding.

This shouldn’t be too hard to do. At https://www.releases.ubuntu.com/, they list the releases. When curling the webpage, there’s a list of the releases with version numbers some with LTS. New versions are always larger numbers. At https://ubuntu.com/download/alternative-downloads, they list the torrents. Also, all release torrents for desktop are in the format https://www.releases.ubuntu.com/XX.XX/*desktop*.torrent. I’ve tried to teach these models this shit and to just create a script for me, holy shit it’s been annoying. The models are incredibly stupid with scripting.

I’m not a computer programmer or developer and am picking up more coding here and there just because I want to do certain things in linux. But I just don’t understand why this is so difficult.

So my question is, is there ANY prompt for ANY model that will output successful code for this seemingly easy task, or is AI still too stupid to do this?

  • LostXOR@fedia.io
    link
    fedilink
    arrow-up
    46
    arrow-down
    1
    ·
    1 day ago

    Why the hell would you ask an AI model to write the script for you? It’s a one-liner, took me just a minute to write. Even if you know very little of Bash I can’t imagine it would take more than a few minutes of research to figure it out.

    curl $(curl https://ubuntu.com/download/alternative-downloads | grep -o "https.*desktop.*torrent" | tail -1) -o ubuntu-latest.torrent
    

    AI is mediocre at best when it comes to writing code, and if you don’t have the skill to troubleshoot its garbage outputs you shouldn’t be using it at all.

    • sem@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      2
      ·
      8 hours ago

      Great solution (esp the corrected one further down). I can relate to OP in the sense that if I studied programming, I might be able to whip something like this up, but so far I haven’t been disciplined enough to learn and practice programming consistently.

      It’s also interesting, this new AI variation of Cunningham’s Law, wherein posting an incorrect solution on a discussion board will yield way more attention and correct answers than asking a question. It’s interesting to wonder why that is.

    • tal@lemmy.today
      link
      fedilink
      English
      arrow-up
      9
      arrow-down
      1
      ·
      edit-2
      1 day ago

      Why the hell would you ask an AI model to write the script for you?

      I mean, I think that that’s not a hard question to answer. If AI can do something, then anyone who can use human language can also do it.

      AI is mediocre at best when it comes to writing code,

      That’s true as of 2025, and a solid issue. I don’t think that a purely-LLM based solution is going to be the final solution.

      I do think that AI will ultimately get there, though.

    • secretlyaddictedtolinux@lemmy.worldOP
      link
      fedilink
      arrow-up
      9
      arrow-down
      7
      ·
      edit-2
      1 day ago

      Thank you! There are two different kinds of people in the world. There are those great at coding and those great at watching netflix and doing whip-its.

      edit: actually this torrent downloads ubuntu-22.04.5-desktop-amd64.iso, which isn’t the latest LTS version (which is 24.01.1). It’s probably good enough, but part of the challenge in this was to always torrent the latest one.

      does anyone know why ubuntu-latest.torrent would try to download 22 instead of 24 LTS?

      • LostXOR@fedia.io
        link
        fedilink
        arrow-up
        13
        ·
        1 day ago

        My bad, that’s what happens when you write a script in a minute. It turns out the latest LTS version is actually the second one listed, not the last. This one should actually fetch the latest version:

        curl $(curl https://ubuntu.com/download/alternative-downloads | grep -o "https.*desktop.*torrent" | sed "2q;d") -o ubuntu-latest.torrent
        
        • hddsx@lemmy.ca
          link
          fedilink
          arrow-up
          2
          ·
          24 hours ago

          I’m so confused. Why are you using sed and grep? Can’t you use sed and/or awk to write a regular expression?

          • tal@lemmy.today
            link
            fedilink
            English
            arrow-up
            4
            ·
            edit-2
            23 hours ago

            I’m not the author, but I regularly use grep and sed in conjunction for things that sed or awk can theoretically do alone via multiple commands. I think that that’s pretty common – grep is used as the search tool, sed as the replacement tool, and you stick 'em together at the shell level. Memory usage isn’t very significant for something like this.

            • hddsx@lemmy.ca
              link
              fedilink
              arrow-up
              1
              ·
              4 hours ago

              The issue with large dataset matches is that in the worst case, grep will put parse the file once and sed will again. With awk or sed only, you only parse the file once.

          • LostXOR@fedia.io
            link
            fedilink
            arrow-up
            2
            ·
            22 hours ago

            grep finds the URLs for the desktop torrent files, sed selects the second one. There’s probably a more elegant way to do it but for a quick script it’s fine.

      • LostXOR@fedia.io
        link
        fedilink
        arrow-up
        8
        ·
        1 day ago

        You can be good at anything if you just put in some effort. The mindset that since you’re not good at programming you can never be is stupid.

        • secretlyaddictedtolinux@lemmy.worldOP
          link
          fedilink
          arrow-up
          5
          arrow-down
          4
          ·
          edit-2
          1 day ago

          I don’t know if that’s actually true. If I’m 5’2" and uncoordinated will I ever become a professional basketball player? I try to be honest with myself about my strengths and weaknesses. For me, just stopping windows was the victory.

      • CaptainBlagbird@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        20 hours ago

        does anyone know why ubuntu-latest.torrent would try to download 22 instead of 24 LTS?

        ubuntu-latest.torrent (what’s written after -o) is the output name. You should be very careful with executing commands that you don’t fully understand. Might save you a lot of trouble in the future.