34
submitted 2 months ago by superkret@feddit.org to c/archlinux@lemmy.ml
#!/usr/bin/env bash
echo -e '\nReading the news...\n'
        yay -Pw
echo -e '\nUpdating...\n'
        sudo pacman -Syu
echo -e '\nLooking for orphaned packages...\n'
        yay -Qtd
echo -e '\nLooking for obsolete packages...\n'
        url='https://aur.archlinux.org/rpc?v=5&'
        pacman -Qmq | sort >| /tmp/pkgs
        curl -s "${url}type=info$(printf '&arg[]=%s' $(cat /tmp/pkgs))" \
                | jq -r '.results[]|.Name' | sort | comm -13 - /tmp/pkgs
echo -e '\nLooking for changed config files...\n'
        sudo find /etc -name *.pac*
echo -e '\nDone.\n'
top 6 comments
sorted by: hot top controversial new old
[-] eric@lemmy.ca 7 points 2 months ago
[-] dessalines@lemmy.ml 3 points 2 months ago* (last edited 2 months ago)

Love this. One of those extremely satisfying terminal commands to pointlessly run over and over, so much so that I added it to my crontab so I don't do that 😭

[-] some_guy@lemmy.sdf.org 5 points 2 months ago

Switch to printf.

printf "%s\n" "text goes here"

[-] friend_of_satan@lemmy.world 5 points 2 months ago

Your echo statements should be put into a function so you don't have \n littered throughout your script.

Your url var could be improved. Why have it? If you really want it, why not put type=info in the var?

[-] infeeeee@lemm.ee 3 points 2 months ago

Nice, I have a similar one. Things I also do there:

  • flatpak update
  • tldr -u to update tldr pages
  • Check if reboot needed after kernel update, and display a notification about it
[-] CaptDust@sh.itjust.works 3 points 2 months ago

pacman-contrib has pacdiff and paccache I like to run at the end of my update scripts

this post was submitted on 14 Sep 2024
34 points (97.2% liked)

Arch Linux

7761 readers
1 users here now

The beloved lightweight distro

founded 4 years ago
MODERATORS