this post was submitted on 01 Feb 2025
63 points (100.0% liked)

Ask Lemmy

31729 readers
2154 users here now

A Fediverse community for open-ended, thought provoking questions


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either [email protected] or [email protected]. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email [email protected]. For other questions check our partnered communities list, or use the search function.


6) No US Politics.
Please don't post about current US Politics. If you need to do this, try [email protected] or [email protected]


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 2 years ago
MODERATORS
 

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?

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 56 points 3 months ago (3 children)

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.

[–] [email protected] 14 points 3 months ago* (last edited 3 months 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.

[–] [email protected] 11 points 3 months ago* (last edited 3 months ago) (3 children)

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?

[–] [email protected] 19 points 3 months ago (5 children)

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
[–] [email protected] 8 points 3 months ago* (last edited 3 months ago)

Hooray!

look everyone, i figured it out using various methods, i'm a programmer now

load more comments (4 replies)
[–] [email protected] 8 points 3 months ago (2 children)

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.

[–] [email protected] 8 points 3 months ago* (last edited 3 months ago) (2 children)

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.

load more comments (2 replies)
load more comments (1 replies)
[–] [email protected] 3 points 3 months 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.

[–] [email protected] 5 points 3 months 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.

[–] [email protected] 28 points 3 months ago (1 children)

It took me more time to read this thread than it did for me to learn the basics of Bash scripting.

Do like we did back in the day, RTFM

[–] [email protected] 7 points 3 months ago* (last edited 3 months ago) (3 children)

man bash is over 64,000 lines. we may also have different IQs, mine more suitable to asking profound philosophical questions to DeepSeek R1 (see https://lemmy.world/post/24838347 for example) and yours more suitable to learning bash scripting through electro-osmosis

for everyone downvoting me, i have tried to get better at linux! don't think of me as a lazy linux user, think of me as among the best windows users who switched to linux

[–] [email protected] 10 points 3 months ago

You don't have to learn every command all at once, just hone in on the basic things you need to start with.

Besides, Bash scripting is basically just taking the commands you'd manually type into the terminal and putting them together into a script file.

So, learn just enough terminal commands to manually accomplish your goal first, then copy/paste those commands into a text file, and you're already ¾ of the way there.

https://www.freecodecamp.org/news/shell-scripting-crash-course-how-to-write-bash-scripts-in-linux/

load more comments (2 replies)
[–] [email protected] 12 points 3 months ago (1 children)

Probably a stupid comment, but still: if you're a coder, you might be quicker just writing such a script yourself. Just fetch the links, slice them up, sort them by version and wget the one with the highest number.

If you're not a coder, maybe someone here can help out?

load more comments (1 replies)
[–] [email protected] 9 points 3 months ago (1 children)

Dude just stitch stack overflow answers together like the rest of us

[–] [email protected] 3 points 3 months ago (4 children)

i dont go there anymore after what they did to luigi. i'll take ignorance over evil any day.

[–] [email protected] 5 points 3 months ago

But you'll use AIs? I don't think they are much better

[–] [email protected] 4 points 3 months ago* (last edited 3 months ago) (1 children)

Think there's much better hills to die on. But you do you.

[–] [email protected] 3 points 3 months ago

this is the hill

load more comments (2 replies)
[–] [email protected] 9 points 3 months ago (1 children)

AI isn't stupid because it doesn't possess any intelligence to begin with, the term "AI" is just a marketing misnomer.

Language Models are essentially really advanced Markov Chain generators. Once you understand that, you'll realize why your question is like "I keep asking these water mills to make me a cup of coffee, but they all taste like dirt": wrong tool for the job, it just happens to be tangentially related.

You're also asking if there's a way to precisely word a request so that the computer will do what you want it to do. Luckily for you, there is! It's a trick that's been around for ~60 years and it's called "programming languages"

[–] [email protected] 3 points 3 months ago (1 children)

Yes, but I need an interface between my brain at my IQ level and the programming language to get it to work... which apparently why I need to use a bunch of non-sense generating Markov chains...

[–] [email protected] 5 points 3 months ago (1 children)

That interface is called a manual or tutorial, and there are many better ones than neural networks

[–] [email protected] 4 points 3 months ago (4 children)

when i first started linuxing linux, i tried to read man man, but it was over 700 lines

my primary linux skills are whip-its and watching netflix. i'm sort of at the lower-skill end of the linux userbase. i don't know if there's any way to every change that, so why try?

load more comments (4 replies)
[–] [email protected] 8 points 3 months ago (1 children)

AI certainly can do it. But here's the thing with generative AI: the answer is only as good as the question you ask. If you don't know exactly what to ask for and which details are important, the AI doesn't know what you meant to ask and can't infer that. AI usually does not pick up implied context that an experienced person would. A person would be able to make an educated guess about what you actually meant and answer that question.

As someone with 20 years of programming experience, I would recommend against using AI to learn to program. You're asking something that doesn't actually know how to program to show you how to do it. From my experience with coworkers using AI, it doesn't improve their work; it simply accelerates the rate at which they can produce low quality work.

Once you're more skilled than the AI, you can use it to speed up menial tasks, like generating boilerplate and stubbing things out. It absolutely will be wrong in some ways, and you need to be able to tell when it's wrong and know how to fix it.

[–] [email protected] 3 points 3 months ago (1 children)

You're probably right, but I'm not actually trying to learn to program. I learn programming and linux on an as needed basis, but I just keep learning more of it when I want to do stuff.

If I can't get AI to figure this out for me, I am not sure if it's worth it to me to learn substantially more about bash programming just to bypass going to a webpage. It would probably be like 4 days of learning. From the page listing the torrents in a spreadsheet, I am guessing it would be easy to figure out how to list them, delete the ones without LTS in the name, order them by number and delete everything but the highest number. An LLM could probably help me with that task. I still don't know if I have the IQ/insight amount to get it to a working level, so it's also a gamble.

It just seems like an LLM should be able to do all of this. This is sort of the quintessential trivial programming task that an LLM should be able to easily do.

[–] [email protected] 5 points 3 months ago (1 children)

So the thing is, if you learn enough about bash to bypass going to this webpage, it'll also help you bypass going to other webpages. What you learn now will help you in the future.

[–] [email protected] 3 points 3 months ago

i don't know if i'm capable of longitudinal thinking like that. my style is more like why not have some delicious and nutritious candy and then sleep for 8 hours?

[–] [email protected] 7 points 3 months ago (3 children)

@[email protected] I bet there is a RSS feed for Ubuntu releases. Instead of using AI to get the link you would need to read consume the feed.

load more comments (3 replies)
[–] [email protected] 6 points 3 months ago (1 children)

In my experience, Chat GPT is much better at the general programming patterns and concepts than specific API implementations. Especially less commonly used ones, where it often gives a solution that only looks reasonable but uses the totally wrong methods. I guess it's similar with scraping the HTML of the Ubuntu releases page to get the latest torrent. It doesn't know the exact HTML layout, so it guesses what is a likely one, even though it is wrong.

[–] [email protected] 2 points 3 months ago (1 children)

AI models are great for troubleshooting and understanding concepts or figuring out approaches but in actual implementation they seem weak to me. I've heard people saying how AI is replacing much of coding and I'm not really a coder but I can't understand how that would be currently possible with the responses I see from AI,

[–] [email protected] 2 points 3 months ago

It replaces the first steps, so Hello World, figuring out primes etc., but it will very likely fail with any (larger) existing codebase and frameworks. And the thing it can figure out - eg. implement quick sort - are probably implemented much better anyway.

[–] [email protected] 5 points 3 months ago

Just write it yourself 🤦‍♂️

[–] [email protected] 5 points 3 months ago (1 children)

S4:e6: "Bender Should Not Be Allowed on TV"

load more comments (1 replies)
[–] [email protected] 4 points 3 months ago

Isn't this something you use rss for?

[–] [email protected] 4 points 3 months ago (1 children)

The AI will provide methods you could try, but ultimately a human will need to review and edit the code.

[–] [email protected] 4 points 3 months ago* (last edited 3 months ago) (5 children)

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?

[–] [email protected] 4 points 3 months ago* (last edited 3 months ago) (3 children)

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.

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.

load more comments (3 replies)
[–] [email protected] 3 points 3 months ago* (last edited 3 months ago) (5 children)

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+%

load more comments (5 replies)
load more comments (3 replies)
[–] [email protected] 4 points 3 months ago (1 children)
[–] [email protected] 2 points 3 months ago

this makes this a much easier task, although i'm still not sure if i'll end up figuring it out. thank you.

[–] [email protected] 3 points 3 months ago* (last edited 3 months ago) (1 children)

You are a powerful terminal assistant. You will answer in the most helpful possible way and provide the user with Linux bash commands to accomplish their tasks. Use Google and internet search to fetch all necessary information. Always format your answer in markdown format.

User question: How do I download the latest Ubuntu ISO torrent? Make sure it's the latest version from ubuntu.com Make sure to also include the curl or wget command to download the torrent file itself.

[–] [email protected] 3 points 3 months ago (1 children)

My LLMs don't have Internet access yet. I was trying to get https://github.com/open-webui/ to work in docker but struggled with the backend connecting with ollama, which was working. I mostly have been using LM Studio recently, which I don't think can go online for searching, or if it does I haven't figured that out yet.

[–] [email protected] 2 points 3 months ago* (last edited 3 months ago) (2 children)

Fair enough. Just without internet access, the entire task becomes impossible. It then has to make up some URL which will likely turn out to be not correct. Plus it doesn't really know what year or month it is...

So, with my prompt and ChatGPT, it returns the correct command.

[–] [email protected] 2 points 3 months ago (3 children)

so i should try to get open-webui working and then have it try to generate something. is there an equally good alternative to open-webui? I could keep trying to troubleshoot why it can't find ollama running on localhost:11434 or whatever it was, but I spent hours on it and there didn't seem to be a logical reason why it was happening, although there clearly was one and I just wasn't smart enough to figure it out.

load more comments (3 replies)
load more comments (1 replies)
[–] [email protected] 3 points 3 months ago

Most ppl in this section are corny af, not everyone has the aptitude to write something... 🤦‍♂️

[–] [email protected] 2 points 3 months ago (3 children)
load more comments (3 replies)
load more comments
view more: next ›