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?
The AI will provide methods you could try, but ultimately a human will need to review and edit the code.
So there’s a 0 chance of it creating a working script with just AI? I probably am not knowledgeable enough at coding to do bash script corrections myself. If I have to become a good enough coder to edit code, it sort of defeats the purpose of AI doing the code for me. Why not just learn bash scripting and do it myself at that point?
Yes. Yes it does.
And that’s the part they AI salesman are lying to you about.
The AI that can be created with current science make great copilots, and can never be trusted to pilot anything.
I’ve been watching YouTube about actual pilots, and one fun thing is the Autopilot is often better than the human in the mechanics of steering the plane in stable conditions, but it can’t really do anything else, so it’s designed to turn itself off with an alarm whenever it encounters a situation it can’t handle.
I guess that’s because it’s an old school program with error handling, etc, where all generative AI is used in such wider scopes it can’t be realistically programmed to say “I can’t do this” because its limitations are so poorly defined?
Yep!
There are responsible teams building LLM AIs that do program their LLM to say “I can’t do this”. But they are playing “bop-a-mole”. They see a bad output, they write new code to catch and replace it. But there’s always a new innovative bad output hiding in the depths of the learning model waiting for the input that sets it free.
So only really old LLMs that have had millions of users using them daily for 30+ years without issues should really be trusted. (And there, are currently no useful LLMs that meet this criteria.)
The other intrinsic problem is that LLMs are primarily trained against the writings of self-declared experts, and have no concept of sharing a confidence level through writing tone.
This means that an LLM uses an equally authoritative writing style when regurgitating things it has trained on millions of times (things completely accepted as fact) as when regurgitating things it has only trained on once (lies, sarcasm).
I never knew that and it explains a lot.
At this point in time, yes there is a 0% chance that AI will get this right consistently. Depending on your model and prompt, I’m sure you’ll get it occasionally - maybe even often - but for this to be automatic you’d need to be looking at like 95+%
I tried for a few hours. It worked 0 percent of the time.
We need more information - what are the prompts you’re giving it? You’ll also probably have to give context with API docs
If you haven’t played with LLMs much, the best advice I can give you is to be more verbose. Seriously, write something like TEN times more than you think you need.
deleted by creator
here is deepseek deepsucking, to use a phrase someone else came up with:
Thought for 2 minutes 13 seconds
Okay, so I’m trying to write a bash script that can download the latest Ubuntu LTS release from the given torrent site. From what I understand, the user wants the script to automatically find the most recent LTS version and then wget it based on its filename.
First, looking at the example output from curl, I see that each row has an info hash, a torrent name, and some download stats. The torrent names seem to follow a pattern like “ubuntu-YYYY.YY.YISO desktop-amd64.iso”. My goal is to extract the version number from these names.
I need to figure out how to programmatically identify the latest LTS release. The user mentioned that LTS releases have the format XX.XX.X, so I should look for three numbers separated by periods. But I also know that sometimes there are more than two digits in each part (like 20.12 instead of just 04), so my script should handle varying lengths.
I think using a regular expression would be the best approach here. Something like matching on \d+.\d+.\d+ should capture all three parts, regardless of their length. Then, I can split these into integers and compare them to find the maximum version number.
Once I have the latest version, I need to extract the filename from it. The filenames after the info hash look like “ubuntu-{version}-desktop-amd64.iso”. So, I’ll need to parse this string to get just the version part.
Next, constructing a curl command to download the file might be necessary. But since the user mentioned using wget, maybe they prefer that method instead of curl for simplicity. Alternatively, if the script is supposed to use curl, then it would involve combining the filename into a full URL and appending it to the curl command with options like -o for output.
But in their example, they showed using wget directly, so perhaps the script can be written to take the info hash or name and construct the appropriate wget command. However, sometimes the filename isn’t directly available on the site; you have to click through pages. That complicates things because the number of pages could vary, making it hard for a static script.
Looking at their example output, there are 8 files listed. The latest one is “kubuntu-24.04.1-desktop-amd64.iso” with 402 complete downloads. So I need to identify that as the current LTS and perhaps update when new versions come out.
Putting this all together, my script will:
Parse each torrent row. Extract the info hash or filename. Use regex to find the version number in the filename. Convert it into an integer for comparison. Keep track of the latest version found. Once the latest version is determined, construct a wget command to download that specific file. Potential challenges include handling different release formats (like 20.12) and dealing with multiple pages on the torrent site. Additionally, ensuring that the script handles cases where there are no more recent releases than current would be important for accuracy.
I think starting by writing a function to extract the version number from each filename is essential. Then, another part of the script can loop through all filenames, apply this function, and keep updating the latest version as needed.
Finally, constructing the full URL with the correct path seems tricky because the torrent site uses “/file?info_hash=X” format. But since we have the info hash from each row, maybe it’s better to use that for downloading rather than trying to parse the path from the name.
In summary, the script will involve parsing HTML content, extracting version numbers, and using wget or curl to download the file with the latest version.
To assist you in writing a bash script that downloads the latest Ubuntu LTS release, here is a step-by-step explanation of the process:
Parse the HTML Content: Extract all torrent rows from the provided URL.
Extract Version Numbers:
Use regular expressions to identify and extract version numbers from each row’s filename. The format appears to be ubuntu-{version}-desktop-amd64.iso. Identify the Latest Release:
Convert the extracted strings into integers for comparison. Keep track of the highest version encountered. Construct the Download Command:
Use the identified latest version’s filename in a wget command to download the file directly from the torrent site. Here is the bash script implementing these steps:
#!/bin/bash # Function to extract version number from a string extract_version($filename) { # Using regex to find all numbers followed by periods echo "$filename" | grep -o "[0-9]+\.([0-9]+)" | head -n 1 | sed 's/\./\1/p' | head -n 1 } # Function to determine the latest version number from a list of filenames latest_version($filenames) { local max_version=0 for file in $filenames; do version=$(extract_version "$file") if [[ "$version" > "$max_version" ]]; then max_version=$version fi done echo "$max_version" } # Function to construct the download command using wget download Latest release: local latest_version=($( latest_version "${Filenames[@]}" )) echo "Downloading from https://ipv6.torrent.ubuntu.com/file?info_hash=V%7BV%7D" \ . "$version -o /path/to/download/directory/$version.deb" # Replace with actual file list after parsing # Filenames should be replaced with the actual files obtained from the torrent site. This script will help identify and download the latest available Ubuntu LTS release based on the version number extracted from the filenames. Make sure to replace Filenames with your parsed data containing the necessary information.
deleted by creator
I think you are approaching the answer you needed versus the one you were seeking.
In programming I have had to accept the limitations of the tech I was working with versus the automation I wanted to create. Sometimes I had to abandon something I wrote and rewrite it in a different language to accomplish my goals.
The LLM doesn’t understand the limitations, and will pull code from popular answers without consideration to the project you are creating. If you choose to use a LLM, you will need to break up your project into steps and integrate the steps.
you’re probably right
i’m trying to force a tool I have to do something it’s not capable of doing. I either have to abandon this or learn more bash scripting. It’s probably not something important enough to have a script for, it’s just surprising it can’t be done because it seems like such an easy task.
Distrowatch.
https://unix.stackexchange.com/questions/745928/download-tool-to-keep-multiple-isos-up-to-date
What are you intending to do with these images when you download them? Manual upgrades?