- This topic has 30 replies, 7 voices, and was last updated Feb 7-2:17 pm by VW.
-
AuthorPosts
-
February 7, 2020 at 3:13 am #32507Member
PPC
::Now I’m just wondering why I am running “dist-upgrade” when I should be using “upgrade”?
Very good question! The answer is: because anticapitalista recommends it, actually the script should use “apt-get”, not just “apt”:
How do I keep the system up-to-date? antiX is set up using Debian Stable repositories by default. This allows users to keep their system up to date with regular upgrades. antiX recommends using apt-get update followed by apt-get dist-upgrade in a terminal. Synaptic is also available for those that prefer a gui tool.(from: http://download.tuxfamily.org/antix/docs-antiX-19/FAQ/index.html )
It was also my first time performing a upgrade with this latest version of the script. I don’t know why I almost held my breath, running it 🙂
Anyone as any suggestion or is everyone fine with the final message that pops up after the upgrade? I thought about making it multilingual and/or using a icon (like a green “check” image)…
There are only 3 things that may need to be translated (I have no concrete idea how to do this without bloating the code):
– The initial warning that appears when the user runs the script, warning that a Network connection is needed (I put it there just in case this script ends up being used to automatically check for updates and it begins running there’s no internet available – ex: laptops in a place without wi-fi, desktops without a permanent internet connection)
– The message that pops up when there’s no updates available ( my OS is in Portuguese, almost every single output from apt update is translated, except for the last line that says “All packages are up to date.”, in english. I checked andthat line is translated in severallanguages… If it’s translated in the language the user is using, there’s a problem: because the script checks for the expression “up to date” in the output from “apt update” before running “apt upgrade”, if that message is in a different language, the script ends up always performing “apt update”- no big problem, but it reduces slightly the benefits of using it… I can solve that, forcing the “apt update” to always run with it’s output in english (env LANGUAGE=en gksudo apt update), but it makes the script slightly less “universal”…
– The final pop up window when “apt dist-upgrade” is done, says “Finished”. Any good suggestions for a multilingual output? I considered simply using every language I know about or could use a on-line translator… So the final pop up window would have a dozen lines sayingFinished. (english) Terminado. (pt, pt-br, spanish) Fini. (french) (etc)...Using at least these 4 languages would make sure at least most of the occidental antiX users would understand the message… but that also seemed it would bloat the script too much… Most people using a computer, even more, Linux, will understand what “Finished” and “ok” mean, right?
P.
- This reply was modified 3 years, 3 months ago by PPC.
February 7, 2020 at 3:36 am #32508MemberPPC
::ppc wrote: I would rather click the “antiX updater” icon when I feel like it!
while I fully understand that position I must point out:The starting point was posts on DW complaining about no notification of available updates.
The latest script gives an excellent one click upgrade but unfortunately has not adressed the original issue.
Which means the complaints will not be stilled.
My scripting skills are far worse than those pertaining to communication, will see if I can get a notifier working,
at least for our group purposes. Probably a wider audience would lynch me. 😉Hi, Moddit:
No big scripting skills needed: I already tested using yad-updater to perform daily checks… The how to is available over at the “DistroWatch user reviews Thread” and could be adapted to run this script: https://www.antixforum.com/forums/topic/distrowatch-user-reviews/page/2/#post-32256For clarity sake, I think it’s useful to also put it here (also adapting it a bit)…
How-to use this script to periodically check for updates:
1 – Make a back up copy of /usr/local/bin/yad-updater (if it installed in your system) and replace yad-updater with this updated version of the script, doing something like this:
sudo cp /path/to/script/script.sh /usr/local/bin/yad-updater2 – Make sure that the cron deamon is enabled, either at startup or manually:
ex: Manually, open the terminal and run:sudo service cron startIf you want for the cron deamon to always run, just put that line in your startup script ( using C.C. -> Edit … ICEWM … -> “startup” tab) and restart antiX.
3 – Create the script you want to run, open a text file and paste there:
#!/bin/bash DISPLAY=:0 /usr/local/bin/yad-updaterOR, if you want a confirmation prompt before trying to check for updates:
(NOTE: the forum software mangles the code, after the yad command every option (title, center, buttons and text) starts with a double “minus” character, not the “–” character)#!/bin/bash
DISPLAY=:0 yad –title ‘antiX updater’ –center –button=gtk-yes:’yad-updater’ –button=gtk-no:1 –text “Check for system updates now?”3- Save it in your home folder under the name “auto-check-for-updates.sh”, make it executable.
4- Copy the script you just created to the “/etc/cron…” folder you want ( cron.daily , cron.weekly , cron.monthly )
Ex: if you want the user to be reminded to check for updates every day:sudo cp ~/auto-check-for-updates.sh /etc/cron.dailyDone!
Note1: the “DISPLAY=:0 ” part of the script is needed to run the script on screen (if you don’t use that, yad-updater won’t show up on screen at the scheduled time)
Note2: Skidoo’s previous suggestion about using the “acron” command instead of “cron” is very nice.
The cons: the user has to install the “acron” package. That “bloats” the OS a tiny bit (it’s a small package)
The pros: if the computer is not on at the time the deamon tries to check for updates, the next time the computer is turned on, it (if I understand the command correclty – I’ve never tested it) it should then check for updates…P.
- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
February 7, 2020 at 5:21 am #32514MemberPPC
::My scripting skills are far worse than those pertaining to communication, will see if I can get a notifier working,
at least for our group purposes. Probably a wider audience would lynch meHi- I already posted a reply here, but I noticed it’s missing… So here’s the version from my personal notes…
No great scripting skills need, Moddit:Mini How-to automatically get periodical checks for system updates using yad-updater:
1- Back up your current yad-updater script, if any (it’s /usr/local/bin/yad-updater ).
Replace any older version of the script with the newer script available in pastebin ( this example asssumes that you created the script in your home folder, and named yad-updater-final.sh):
Open the terminal and run:sudo cp ~/yad-updater-final.sh /usr/local/bin/yad-updater2- Make sure that the cron deamon is enabled, either at startup or manually:
To start it manually (valid only for the current session) open the terminal and run:sudo service cron startTo always make antiX always runs the cron deamon and check for periodical updates, paste the above command in your startup file AND restart antiX.
3- Create the script you want to run, in our case:
#!/bin/bash DISPLAY=:0 /usr/local/bin/yad-updaterOR, if you want a (a veryyy minimal) confirmation prompt (I’ve not yet tested this code but it should work)
(NOTE: the reason I don’t use a confirmation prompt is that there’s one “ugly” one already- a gksudo window pops up when yad-updater runs. If I don’t want to run it, I just close the window. But that can be confusing for newbie users that don’t understand what that window means…)
NOTE: the forum mangles the code, before each yad option (title, center, width and buttons) is always a double minus sign, not a the character that gets displayed here;#!/bin/bash
DISPLAY=:0 yad –title “Check for updates?” –center –width=250 –button=gtk-yes:”DISPLAY=:0 yad-updater” –button=gtk-no:14- Save the script in your home folder under the name “auto-check-for-updates.sh”, make it executable.
5- To make the cron deamon perform daily check for updates (you can also choose “weekly” or “monthly”, changing the last word of the command bellow):
sudo cp ~/auto-check-for-updates.sh /etc/cron.daily6- Done!
To disable the periodical check for updates simply delete the file from the cron folder that you placed it in (in step 5)
Note: running daily checks for updates is the safer bet for all users, but weekly is less invasive…
- This reply was modified 3 years, 3 months ago by PPC.
- This reply was modified 3 years, 3 months ago by PPC.
February 7, 2020 at 7:40 am #32524Moderator
Brian Masinick
::Nice work again! Clean, easy to understand instructions too. I will check out the new script later today and pass on any additional comments.
--
Brian MasinickFebruary 7, 2020 at 8:16 am #32525MemberPPC
::Just something that I found strange. I was cleaning up my /etc/cron.daily folder when I decided to take a peek at some files there. One caught my eye: check out the file /etc/cron.daily/1-quick-live-update
If seems that the antiX dev team began thinking about allowing automatic updating the system about 2 years ago…
Line 47 – 51 are:# APT::Periodic::Update-Package-Lists “0”;
# – Do “apt-get update” automatically every n-days (0=disable)
#
# APT::Periodic::Download-Upgradeable-Packages “0”;
# – Do “apt-get upgrade –download-only” every n-days (0=disable)I didn’t spend much time examining this file but it seems to be a inactive cron job to perform daily updates and even upgrades…
@Moddit – You may want to try editing this file uncommenting line 47 and setting it to “1” instead of “0”?
P.
February 7, 2020 at 8:21 am #32526Member
VW
::VW wrote:
Now I’m just wondering why I am running “dist-upgrade” when I should be using “upgrade”?
Very good question! The answer is: because anticapitalista recommends it, actually the script should use “apt-get”, not just “apt”:
Actually it is because last weekend I decided to update all three of my computers to antiX19. I forgot to backup bash_aliases and thus was kinda forced into using a back-up from the days when antix was rolling and thus used apt-get update && apt-get dist-upgrade. So far all three computers are running OK, and the printer too, and my iPad is connected and working and that is the sole screw-up I made. I also got networking up and running. And unlike some ancient rock stars I ain’t been moaning how difficult having Parkinsons makes life as in my left hand is next to ******* useless.
“These are the times that try men's souls" - Thomas Paine
February 7, 2020 at 8:35 am #32527Member
VW
::And if you think running your script is easier and faster than using a bash alias; well you have just got to be out of your tree. The object of life is to make things quicker and easier, not to have lots of bells and whistles shouting “How great PPC is!”
“These are the times that try men's souls" - Thomas Paine
February 7, 2020 at 8:51 am #32528Member
VW
::Just what the world needs; another script-kiddie!
“These are the times that try men's souls" - Thomas Paine
February 7, 2020 at 9:21 am #32529Moderator
Brian Masinick
::Feedback below on uncommenting the script, changing the values, and also feedback below on running the most recent antix_gui_updater_-_bug_free.sh script.
Just something that I found strange. I was cleaning up my /etc/cron.daily folder when I decided to take a peek at some files there. One caught my eye: check out the file /etc/cron.daily/1-quick-live-update
If seems that the antiX dev team began thinking about allowing automatic updating the system about 2 years ago…
Line 47 – 51 are:# APT::Periodic::Update-Package-Lists “0”;
# – Do “apt-get update” automatically every n-days (0=disable)
#
# APT::Periodic::Download-Upgradeable-Packages “0”;
# – Do “apt-get upgrade –download-only” every n-days (0=disable)I didn’t spend much time examining this file but it seems to be a inactive cron job to perform daily updates and even upgrades…
@Moddit – You may want to try editing this file uncommenting line 47 and setting it to “1” instead of “0”?
P.
Note: if you are going to update and upgrade using this method, you may want to uncomment both of the lines containing APT::Periodic:: and change the 0 to a 1; otherwise you may not end up performing both the update and the upgrade, assuming the activation of these lines results in running the update and upgrade scripts.
Also, I have some feedback on the tool. I found that it works fine on both of my antiX systems (runit and “Full”). I also copied the scripts to my Debian system and my MX system to see if they’d work. On MX, the answer is a definite yes, but gksudo has to be changed to gksu because I don’t have gksudo available on my MX system and the repos I have currently enabled don’t have it either. On Debian, yad wasn’t installed so I installed it, but their version of yad doesn’t work right with the script. If you do want to get it working on Debian I can share the error output (I’ll have to run it again for you). Otherwise if we are primarily concerned with these scripts for antiX they are fine as is. The documentation (in the script and in this thread) is nicely done. Thanks!
--
Brian MasinickFebruary 7, 2020 at 10:01 am #32534MemberPPC
::@Masinick – Thanks for your input!
– About the “1-quick-live-update” script – I don’t want to try changing it myself, and as far as I read those lines I mentioned, if uncommented and set to “1” those variables allow antiX to perform daily updates but only download the updates, BUT not install them… At first glance I didn’t find a way for the system to perform the “full” update.
Since Moddit is so set into trying to “automate” the update process for a group of users, I figured that already existing script could help achieving that… I think that Moddit is looking for something along those lines, but ideally the script would perform a silent “apt update” daily and, if a update was found should prompt the user to perform the upgrade…
– Thanks for checking if my script worked “universally”, as I intended it. The only 2 OS’s I use are antiX and MX-Linux, so, as long as the script runs fine on both systems, I’m ok with that!
I didn’t yet got to testing it in MX, so it’s good to know that I only have to adapt one single line!
It’s a bit of a shame that it doesn’t work in pure Debian… I almost called the script “Debian Updater” but I thought it sounded too presumptuous, and also confusing for the crowd it’s intended – users that don’t like using the terminal to perform updates, if they are new to Linux, may not really understand the connection between Debian and antiX and MX, so “antiX Updater” seemed a more exact name! (Besides I know that pure Debian does not include, out of the box yad and gksudo… I never thought that their version of yad could have any problem running such a basic script- probably some problem with the “pulsating” part of the script, but, never mind…)@Moddit – re-reading your comment about scripting ability, I think you meant you want to create the script I originally mentioned at the DW thread- a script to allow users to choose if they want to have automatic periodical updates and if so, how often should antiX check for updates, right?
My mini how-to is meant directly for users that want to “set and forget” periodical updates, not for a “general” use…
I learned everything I know about scripting from on-line examples, and often have to look on-line how to do the most basic scripting tasks, but if you want help, drop me a line and I’ll try to help out any way I can, ok?P.
February 7, 2020 at 10:56 am #32540Member
VW
::almost held my breath, running it
You been a drama queen long?
“These are the times that try men's souls" - Thomas Paine
February 7, 2020 at 1:08 pm #32541Moderator
Brian Masinick
::And if you think running your script is easier and faster than using a bash alias; well you have just got to be out of your tree. The object of life is to make things quicker and easier, not to have lots of bells and whistles shouting “How great PPC is!”
I don’t think that we’re talking about what is faster or easier. We already noted that there are several short alias commands to perform apt and apt-get commands.
To me this is a script coding exercise for those who are interested. Many of us already have fast ways to perform system changes, myself included. At the same time there are others who enjoy experimenting with scripts. Though this isn’t my every day approach, I do appreciate it when people write tools.
In any case I would rather encourage different ways of doing things. We don’t have to put every idea into our distribution, but we can share them in the forum and make available the ideas that the development team approves and let the ideas receive forum feedback. Clearly this idea has a few followers and some strong opposition too. It’s still reasonable to allow for the discussion and sharing to take place. Those who are not interested are not forced to take the scripts or even follow the discussion.
--
Brian MasinickFebruary 7, 2020 at 1:47 pm #32543Moderator
Brian Masinick
::Hi, everyone: new and bug free version (and I choose a final “apt dist-upgrade” pop up message that simply says “Finished”, so not to confuse newbies. Advanced users can read the output of the terminal window or check the apt log…)
I changed the sudo from gksudo to lxqt-sudo, removed the pulsating feature (but forgot to remove the comment about the pulsation),
shortened the lines so that the script can be read in a window of moderate size, touched the .loggy
file so that it will exist whether created in advance or not, and left the remaining functional logic intact. I did put in backslashes for the
long lines that I shortened, but this does not alter the workflow, just the appearance.See if it’s useful for anyone. Remember, nobody HAS to use this; we’re just having a friendly discussion where we’re experimenting with some scripts.
Arguably it is quicker to simply use existing alias commands to run the various apt commands; again, this is just a code scripting exercise “Just For Fun” and exercise, not something that is expected to be widely implemented; that is completely up to the reader.You can get my hack here (it’s definitely just a hack!) 🙂
- This reply was modified 3 years, 3 months ago by Brian Masinick. Reason: took out the pulsing feature so it works on Debian
--
Brian MasinickFebruary 7, 2020 at 2:17 pm #32545Member
VW
::Brian Masinick wrote
I don’t think that we’re talking about what is faster or easier.
Don’t tell me you also noticed his lack of respect for anticapitalista?
Without anti, there would be no antiX at all.
But we must expect you yanks to stick together, eh?
Hey, “We’ve been abused; the world has changed” like you did after 911!
The world didn’t change, it just caught up with Planet America, and Planet America surely deserves all it has coming to it, and you can bet that both I, and anti agree on that little matter.
“These are the times that try men's souls" - Thomas Paine
-
AuthorPosts
- The topic ‘Fully GUI script to update antiX’ is closed to new replies.