You can do it according to the artix installation as follows:
sudo -i
pacman -Sy pacman-contrib artix-archlinux-support
sed -i 's/#ParallelDownloads = 5/ParallelDownloads = 5/' /etc/pacman.conf
sed -i '$a \\n[universe] \n Server = https://universe.artixlinux.org/$arch' /etc/pacman.conf
sed -i '$a \\n[omniverse] \n Server = http://omniverse.artixlinux.org/$arch' /etc/pacman.conf
sed -i '$a \\n # Arch \n[extra] \n Include = /etc/pacman.d/mirrorlist-arch' /etc/pacman.conf
sed -i '$a \\n[community] \n Include = /etc/pacman.d/mirrorlist-arch' /etc/pacman.conf
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacnew
cp /etc/pacman.d/mirrorlist-arch /etc/pacman.d/mirrorlist-arch.pacnew
sed -i 's/#Server/Server/' /etc/pacman.d/mirrorlist-arch.pacnew
cat <<EOF >> /usr/bin/update-mirrors
#!/bin/bash
rankmirrors -v -n 10 /etc/pacman.d/mirrorlist.pacnew | tee /etc/pacman.d/mirrorlist &&
rankmirrors -v -n 10 /etc/pacman.d/mirrorlist-arch.pacnew | tee /etc/pacman.d/mirrorlist-arch
EOF
chmod +x /usr/bin/update-mirrors
cat <<EOF >> /usr/bin/update-artix
#!/bin/bash
pacman -Sc --noconfirm &&
pacman -Syu --noconfirm
EOF
chmod +x /usr/bin/update-artix
exit
Quick guide:
sudo update-mirrors
sudo update-artix
Lines for conky or whatever;
Last update Date:
awk '/pacman -Syu --noconfirm/' /var/log/pacman.log | tail -1l | cut -b 4-11
Last update Time:
awk '/pacman -Syu --noconfirm/' /var/log/pacman.log | tail -1l | cut -b 13-20
New packages:
checkupdates | wc -l
For the record, this alone is potentially dangerous and not recommended, not to mention the rest of the scripts.
Users should learn pacman or leave the administration to those who know it.
Have you checked that?
Can you back up your statement?
Drinking water is already potentially dangerous; after all, you can drown.
I have tested with: artix-lxde-runit-20211018-x86_64.iso
man pacman
Yes, "unless you want to run pacman from a script", but not an auto-update script which would be run on a schedule. Updates can be faulty and fail, leaving user unaware.
Additionally, often very important information is printed by pacman hooks.
User is required to read that information and act on it. Example: installing artix-archlinux-support.
Testing a script which works with one snapshot of a rolling release distro proves nothing.
This script has all the qualities of a "red button". Worse, the button is now hidden.
Thank you for teaching me. I read Pacman manpage, artix was not even a thought.
Yes, I know what I am doing.
From your post it is only clear that it is dangerous to disregard the terminal output, nothing more.
My first post is also not meant for normal users.
To the output of
artix-archlinux-support there is from me:
sed -i '$a \\n # Arch \n[extra] \n Include = /etc/pacman.d/mirrorlist-arch' /etc/pacman.conf
sed -i '$a \\n[community] \n Include = /etc/pacman.d/mirrorlist-arch' /etc/pacman.conf
and now I want to know what is dangerous about the two lines and why Pacman doesn't do it.
I won't write anything more about the rest, you can be afraid or try it out, I couldn't care less. :)
It is unclear who it is meant for.
Less knowledgeable users won't learn anything from it, since it abstracts away system updates while also hiding the errors. Their systems could become unusable without them knowing why.
More knowledgeable users know enough about upgrading to
avoid such shorthands. They (rightfully) want to be in control over what is happening during such a critical procedure.
Black boxes such as this one are harmful because they hide what is done from the user. User should know what packages are upgraded or installed and why. User should know if the installation failed and why. User should know if their /etc/pacman.conf is not well configured or the mirrorlist should be updated. User should be in control over whether rankmirrors is applied and how it is applied.
Pacman prompts are there for a reason; otherwise tools with similar functionality would already be a part of Arch and Artix. Those are also some of the reasons why tools like pamac or LARBS are not officially supported by Artix. They do things without user control or interaction, and those users ask for help with the distro, not with the opinionated black boxes.
Users should manage their configuration files, that is the whole point of those files. They dictate how the programs installed on their system will behave.
And what if pacman.conf is changed? What if it needs to be updated in some way not predicted by your script? And so on.
It is not meant for the new or as you call them less experienced at all.
Thinking before you act, reading wikis or using terminal just causes headaches and is a waste of time.
I would terribly miss the shitstorm threads about misplaced programs. both in the repositories and on the installation media.
And because no one needs headaches and I would also miss the posts about slow downloads, no updates or dead servers, I've hidden the post on the HOWTO board.
I wrote this for myself, for whom else?
Because it may well be that my self-built installation media will be damaged could be lost due to tornadoes, tsunamis, volcanic eruptions, earthquakes, meteorite showers, global warming, ice ages or other unpleasant events.
I learned something from it