Possible change to antiX updater

Forum Forums antiX-development Development Possible change to antiX updater

  • This topic has 33 replies, 9 voices, and was last updated Oct 3-10:40 am by PPC.
Viewing 15 posts - 1 through 15 (of 34 total)
  • Author
    Posts
  • #97346
    Member
    PPC

      Due to the problems that resulted in a few users losing the localization of the first layer of the menu, I began thinking about changing antiX updater, so it no longer asks if the default suggested action during the upgrade process should be followed. I created this semi-GUI script specially to be used by people that do not know how to use the Terminal (I know, people should know how to use it, but I think forcing them to do so only scares most people away), so, automating even further the process is in line with the spirit of the script…

      I know that “apt upgrade -y” should answer “yes” to all question (I read on-line that it doesn’t some times). I do not want that. I want the script to always follow the default answer (it may be “no”, sometimes).
      I found it very hard to find documentation about apt flags: “man apt” and “apt -h” or “apt –help” offered no help about that, I even spent a while combing through the official Debian documentation, and found nothing. I mean really nothing, about the flags. This, to me suggests that I’m not searching correctly- any tips about this would be great…
      I did find some suggestions online: http://raymii.org/s/tutorials/Silent-automatic-apt-get-upgrade.html and also http://askubuntu.com/questions/1364742/how-to-do-apt-upgrade-with-noninteractive

      I haven’t had the possibility to test if this kind of “automation” would answer correctly the questions the update process asks the user, when installing changes to the desktop defaults… My best suggestion would be running, in the Terminal something like this:

      sudo apt update && sudo apt -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" dist-upgrade

      I have 2 problems:
      1 – I do not know if anticapitalista would OK any such “automation” in this script (just to be clear- the user sees the terminal- that’s handy, say if grub is being updated and the user has to select the default drive to install it to- but general, usual questions should be answered without intervention from the user- instead of having the user press “enter” to select the default option – that, until now, I did not know was “confusing” to some users- but, then again, I have not updated any other OS for some years)
      2 – I lack the know-how to verify if the upgrade (dist-upgrade) command above will always select the default answer… Any help on documentation or help testing would be great!

      P.

      • This topic was modified 10 months, 3 weeks ago by Brian Masinick. Reason: typo correction
      #97364
      Member
      iznit
        Helpful
        Up
        0
        ::

        automation would answer correctly the questions the update process asks the user

        I want the script to always follow the default answer

        man debconf
        man debconf-show
        man debconf-get-selections
        man debconf-set-selections
        man dpkg-preconfigure http://old.reddit.com/r/debian/comments/bjbj4p/what_does_preconfigure_all_packages_with_debconf/
        sudo dpkg-reconfigure debconf ((( choose which frontend + the threshold priority level for questions )))

        #97371
        Member
        Robin
          Helpful
          Up
          2
          ::

          if this kind of “automation” would answer correctly the questions the update process asks the user

          I believe this is something simply not possible to do automatically. Each system is different, so there is no answer which matches all use cases. You’d need a sophisticated AI to calculate the proper answer for each of these questions, based on multiple individual findings. This is the reason why the question is posed during update process to the user. He must decide. If it would be different, these questions would not be present at all, then it could be decided by the package maintainer simply. So, you need to be completely clear about how and on which base your automatisation approach shall derive what the proper answer in each individual case is.

          Btw: You are right, “Yes” is not a good default answer.
          From man apt-get:

          --force-yes
                     Force yes; this is a dangerous option that will cause apt to
                     continue without prompting if it is doing something potentially
                     harmful. It should not be used except in very special situations.
                     Using force-yes can potentially destroy your system!

          Windows is like a submarine. Open a window and serious problems will start.

          #97571
          Member
          PPC
            Helpful
            Up
            0
            ::

            After some tweaks, I think this version of the new GUI antiX Updater is ready for testing – PLEASE DO NOT TEST IN A PRODUCTION SYSTEM!
            For those that can test the new GUI, please download the attachment, make it executable and run it.

            * Changes:
            Major changes:
            – The upgrade process should not ask the user for any input, under ordinary circunstances. It should always accept the default answer ( sometimes Yes, sometimes No) – I do not know how the script behaves, for example, if there’s an update to grub, that opens a cli program to let users perform selections – it should let that program open and wait for the user to perform the correct selection.
            – the upgrade command now includes “–fix-missing”, to be on the safe side [I assume there is no harm on always using this flag- am I wrong? Please, do correct me on that, I did not research that in detail)

            On the “paint job” completely superfluous side of the script:
            – Icons were added to all yad windows
            – The messages that appear if there are no updates available or after the system is updated should be more clear now.
            – The terminal that pops open to perform the upgrade has a warning on the title bar, warning users not to close that window (yep, that is a thing, it seems some users get scared of the evil black window and decide that the best course of action is to cast that evil demon back to the hell it came from- I wonder if those users ever disconnect their windows pc’s or android devices while they are updating?)
            – The update window was resized because, in my system it kept growing, because I added something with a name that was wider than the initial size of the window
            – Note for non english speaking users- If anticapitalista accepts this version, some strings will have to be translated again (because of the changes to the script)

            Edit 1: The reason for the “Major Changes” was, not just to make the GUI even simpler to use, some windows refugees think it’s too complex, to have to answer questions, even if all they need to do is press enter – they over think what they should do and assume if they say no they will be missing something important…
            I assume that this also stops problems like the recently discovered bug that makes some users lose the localization of the first layer of the menus (and I assume, also of the toolbar), because not changing any default template seems to avoid the bug…
            I do not particularly like to deprive users from choice, but it seems that the users that need this GUI the most are the ones that are scared of choices and want everything to be done automatically, by the computer… and this is as easy as it gets: click the “update” icon, enter your password, if asked to. Wait for the process to finish and then close the notification that there were no updates/the updates were applied.

            Edit 2: People that want to take full control of their system should always update from the terminal, like advised, by anticapitalista. (I confess I’m 50/50- if I’m doing something in the terminal, I check for updates there, if I’m working with a document or the web, I just click the Updater icon on my toolbar [ oh, I forgot to mention this, but I have to way to implement this on stock antiX: FT10 uses tint2’s toolbar’s feature that allows to run scripts at a set period, or when starting, to check, if the user so decided, when activating FT10, how long has been since the system checked for updates. If it’s been a week, a notification pops open, reminding users how long has been since the last update and asking if they want to run the Updater- this check is done once a day and is done completely off-line and is extremely light- I tried to find some easy way to do that on default antiX, without having a script always running or depending on cron or anacron)

            P.

            • This reply was modified 10 months, 2 weeks ago by PPC.
            • This reply was modified 10 months, 2 weeks ago by PPC.
            • This reply was modified 10 months, 2 weeks ago by PPC.
            #97583
            Member
            blur13
              Helpful
              Up
              0
              ::

              I dont use apt -y myself, but does this automatically say yes to all package upgrades? even if it entails removing some packages?

              If thats the case then there are a few issues. Some updates will completely wipe away a program and make it uninstallable (ie recently VLC). Thats easy to catch if prompted, but not much you can do anything about if auto yes. Also, since this is a systemd free distro, many packages have a systemd-free version. Arguably, if a package.0nosystemd1 is being upgrade to simply “package”, its better to wait until the new package.0nosystemd1 version appears.

              #97608
              Member
              xinomilo
                Helpful
                Up
                0
                ::

                – the upgrade command now includes “–fix-missing”, to be on the safe side [I assume there is no harm on always using this flag- am I wrong? Please, do correct me on that, I did not research that in detail)

                completely harmless.
                not sure how it runs along with dist-upgrade. never run it in the same upgrade command, usually running it after upgrade (eg. apt update && apt upgrade && apt -f install).
                and under some circumstances (eg. failed upgrade) that could fail too… a failed package upgrade needs attention/fix first, then apt install –fix-missing .

                I dont use apt -y myself, but does this automatically say yes to all package upgrades? even if it entails removing some packages?

                yes, apt dist-upgrade -y does that (=removing packages). apt upgrade -y doesn’t. (see : man apt)

                tbh, i don’t like automation when it involves system upgrades.. users should always keep an eye on what’s changing.
                so i would never use ‘-y’ flag or “Dpkg::Options::=–force-confold”, because that would mean that some packages could be removed, some daemons might have security vulnerabilities because of old config versions. eg. still using SSLv23, or old versions of sshd_config, or whatever.

                my 2c

                • This reply was modified 10 months, 2 weeks ago by xinomilo.
                • This reply was modified 10 months, 2 weeks ago by xinomilo.
                #97614
                Member
                PPC
                  Helpful
                  Up
                  0
                  ::

                  Thanks to blur13 and xinomilo.

                  My main problem in making the update process automatic is that simply running “apt update -y” can be dangerous, because “yes” may often not be the the default and safest answer to the question asked by apt.

                  As in most things in life, I compromised- I adapted the script so if updates are available, users are informed of how many updates there are available and also prompted to select (in a GUI) if they wish to proceed with the “Manual” option (i.e., running “apt dist-upgrade”, as the default script as done until this proposed change) or the “unattended” option, which is selected if the user presses the enter key. The unattended option uses the above mentioned dist-upgrade command, that I tested on my computers and produced no ill effects.

                  Note: since that what seems to confuse people not used to having complete control over what the system does is having too many choices, my current proposal solves that, by presenting a choice, in a GUI form, to always to with the defaults- literally, they press enter at the GUI so they do not have to do it possibly several times during the upgrade process, in the “dreaded terminal window”. In almost 100% of the upgrade processes, the terminal is there just to show the user what is being done, there’s no interaction at all with the terminal. That’s why I call this kind of scripts as “semi-GUI” (the user still sees the terminal, but does not have to type any command in it- it’s a nice way to educate users about how Linux works, without scaring “normies” too much).

                  P.

                  For those of you that want to contribute:
                  1- Please, if you can, test the script in a non critical system and select the unattended option, if updates are available (ideally use non persistent Live versions of antiX or Virtual Machines)
                  2- I’m open to suggestions: to avoid “doubt paralysis” should the script have a countdown, of say, 10 to 30 seconds and if the user does not make a selection, it automatically launches the unattended upgrade?
                  3- Do you think I should keep the names “Manual Upgrade” and “Unattended Upgrade”? Are they clear enough? Is “Automatic” better than “Unatended”? Should I add any more info to the prompt window?

                  Thanks in advance,

                  P.

                  Edit: because I was curious about how more “mainstream” OSes do updates, I just watched a short video on a guy using the GUI to update Ubuntu. I’ve not used (U)buntu for many years, and I had no recollection how the updates are done- it’s pretty similar to my proposed script: 1- you see an initial window with some kind of progress bar while apt update is doing it’s thing, 2- you see a window listing how many updates are available (and also plenty of options, like selecting the packages you want to update) and 3- A window showing the upgrade being done, without any intervention from the user (in Ubuntu’s case, a GUI window, in my case, a Terminal window, that shows about the same info as the detailed Ubuntu GUI window). I guess my proposed script does have the unexpected side effect of making the updater more “main stream”, while not making it any more resource intensive!

                  • This reply was modified 10 months, 2 weeks ago by PPC.
                  #97624
                  Member
                  marcelocripe
                    Helpful
                    Up
                    0
                    ::

                    Hello PPC.

                    I am grateful for this initiative.

                    The “yad-updater2023.zip” of 01-17-2023 made all the updates in antiX 22 full 64 bits on a LiveUSB without asking questions and did not change the menus of the first level (all were kept in pt_BR language). As we have several configurations with window managers or window managers + file managers, all desktops were checked, except the HerbstluftWM desktop because it does not have the menus, the first level menus were kept in pt_BR language. The text file containing the test details I sent you by private message.

                    The message in the title bar was great, I even know how I should write it so that all Brazilians understand that you can’t close the window during the antiX update.

                    Today I will test the “yad-updater2023-v2.zip” version.

                    Thank you very much.

                    marcelocripe
                    (Original text in Brazilian Portuguese language)

                    – – – – –

                    Olá PPC.

                    Eu agradeço por mais esta inciativa.

                    O “yad-updater2023.zip” do dia 17-01-2023 fez todas as atualizações no antiX 22 full de 64 bits em um dispositivo USB executável sem fazer perguntas e não alterou os menus do primeiro nível (todos foram mantidos em idioma pt_BR). Como temos várias configurações com gerenciadores de janelas ou gerenciadores de janelas + gerenciadores de aquivos, todos as áreas de trabalho foram verificadas, exceto a área de trabalho HerbstluftWM por não possuir os menus, os menus do primeiro nível foram mantidos em idioma pt_BR. O arquivo de texto contendo os detalhes dos testes, eu te enviei por mensagem particular.

                    A mensagem na barra de título ficou ótima, eu já até sei como deverei escrever para que todos os Brasileiros compreendam que não pode fechar a janela durante a atualização do antiX.

                    Hoje eu irei testar a versão “yad-updater2023-v2.zip”.

                    Muito obrigado.

                    marcelocripe
                    (Texto original em idioma Português do Brasil)

                    #97625
                    Forum Admin
                    anticapitalista
                      Helpful
                      Up
                      0
                      ::

                      Seems to work ok.
                      Minor changes needed (perhaps?)

                      1. How about loggy being put in its own hidden folder rather than just as a file?
                      2. A couple of typos/spelling

                      Unatended > Unattended
                      full control about > full control of

                      Philosophers have interpreted the world in many ways; the point is to change it.

                      antiX with runit - leaner and meaner.

                      #97626
                      Member
                      PPC
                        Helpful
                        Up
                        0
                        ::

                        @Marcelocripe – thanks for all the testing you do for my scripts!

                        To All: I think the script is now almost production ready, with this version 2.1.

                        Changes:
                        *Just cosmetic changes:
                        – I added images to all yad windows, and removed the image to the window that stated that there are updates available, because it may have induced users into thinking there was some kind of error
                        – I fixed the size of all windows
                        – I added formation to the test of the window that stated there are updates, to call attention of the user to the most important parts.
                        – I choose to use “Automatic” Upgrade and “Manual” upgrade – even without localization, these two option are easier to understand (and the text of the window does explain in some detail what each option does.

                        Note: for now I’m sticking with leaving the choice of what kind of upgrade should be performed entirely to the user- I know, now the GUI does force users to make a selection, but that’s only to save them the “trouble” of making selections on the terminal (that, for some reason, freaks some people out).
                        I think that the script’s looks are now much more polished than the previous version. Even if anticapitalista refuses the availability of the “automatic” mode, I’ll ask him to accept the cosmetic changes to the script – it never hurts, having a good looking tool, if it uses no extra system recources, right?

                        Personal note: I know that unattended upgrades are potentially dangerous, but my script aims to basically automate the task of users pressing the “enter” key, every time that the update process ask them questions, to accept the default answer. I’ve been using antiX for years, and, as far as I can remember, I’ve always choose the default answer, when upgrading my system and that never ever caused me problems, so I assume that, if the script’s “Automatic” Upgrade mode does what I intend it to do (always select the default answer) then users can update antiX for years on end, without having to make any selection on the Terminal window that pops out (hum… except for those nasty grub selection, clearly made for folks way geekier than me- I even tanked my antiX install once, on that account, and had to fix grub using my live pen-drive!)

                        As always, to all those that can, please test the script. If all goes well, I’ll contact anticapitalista directly and suggest that this updated version of the script should be put up for localization and included in the repository…

                        #97629
                        Member
                        PPC
                          Helpful
                          Up
                          0
                          ::

                          @anticapitalista – you posted your message while I was typing the previous post. I’m glad you that you tested the script and it performed well. I attach the latest version of the script.

                          Changes:
                          – I corrected a couple of typos/language errors (as per anticapitalista’s request)
                          – A temporary file (loggy) is now created in the /tmp folder and no longer pollutes the home folder of the user (as per anticapitalista’s request)
                          – I noticed that there was no GUI warning if the user entered the wrong sudo password and implemented that.

                          Possible future changes to the script: I’m assuming that localization of the title of the terminal window and the subsequent yad window may be problematic – I’ll only be sure of that after it’s localized and I can test that…

                          Probably during the week-end, I’ll try to place all the texts to be localized in variables, in the start of the script, so any future changes to the script do not require so much work from the localization team!

                          P.

                          #97632
                          Member
                          PPC
                            Helpful
                            Up
                            0
                            ::

                            I tested localizalizing the script and I had to perform a tiny change to the way the “Update completed” message is shown…
                            I also went for a statement that seems less “robotic”: “Your system is now updated.” (It’s a “translation” of what my phone tells me, when I have it updated),

                            so this version of the script *should* be bug free and all text should be fully “localizable” now… After the week-end, if no problems come up, I’ll recommend that anticapitalista puts if up for localization, so it can be included in antiX…

                            #97637
                            Moderator
                            Brian Masinick
                              Helpful
                              Up
                              0
                              ::

                              I just checked out the new script. When it completes, it reports (after I had previously updated the system):
                              “No updates were found
                              Your system is up to date
                              (with an OK button in the antiX – Updater yad window).

                              --
                              Brian Masinick

                              #97682
                              Member
                              PPC
                                Helpful
                                Up
                                0
                                ::

                                @anticapitalista

                                I’ve been testing my script in “automatic upgrade” mode and it’s been ok. Today was it’s real field test, with 44 updates available. As I’ve been doing, I clicked to “autoamticly upgrade” and I got an error, related to the “nano” package:

                                dpkg: erro ao processar o arquivo /tmp/apt-dpkg-install-z6UgHX/31-nano_7.2-1.0antix1_amd64.deb (--unpack):
                                 a tentar sobre-escrever '/usr/share/applications/nano.desktop', que também está no pacote desktop-session-antix 3.0.1
                                dpkg-deb: erro: o subprocesso colar foi morto pelo sinal (Túnel quebrado)

                                the error states that the nano.desktop file included in the nano.deb packahe already exists in the desktop-sesion-antiX package. The second line reports “Broken tunnel”

                                I’m assuming this is some kind of packaging error, and not caused, in my system, by the script trying to select the default answer when apt asks a question… Not even running “sudo apt upgrade –fix-missing” fixes this.
                                Is everyone else getting the same error, when using the terminal to performm this update?

                                Ever since I started using the GUI to update my system this was the first error I got, and I realized that I have not implemented error handling. I’m trying to do it now, with clear instruction for the user…

                                P.

                                #97684
                                Member
                                Xunzi_23
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Sir PPC you are not alone,
                                  found same, similar error but without report of broken tunnel. Other latest updates were not completed.
                                  After some trials then apt clean and entering just sudo apt install desktop-session-antix and continuing
                                  the problem was partialy cleared but nano update still gives below error.

                                  dpkg: Error editing archive /var/cache/apt/archives/nano_7.2-1.0antix1_amd64.deb (–unpack):
                                  Attempt to overwrite “/usr/share/applications/nano.desktop” which is also in package desktop-session-antix 3.0.1
                                  Errors occurred when editing:
                                  /var/cache/apt/archives/nano_7.2-1.0antix1_amd64.deb
                                  Error: Timeout was reached
                                  E: Sub-process /usr/bin/dpkg returned an error code (1)

                                Viewing 15 posts - 1 through 15 (of 34 total)
                                • You must be logged in to reply to this topic.