Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Add `apt autoremove`

    Feature Requests
    apt ubuntu
    6
    21
    530
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robi
      robi last edited by girish

      As Cloudron does automatic security and system updates, it should also clean up unused packages as apt suggests with autoremove

      Life of Advanced Technology

      1 Reply Last reply Reply Quote 3
      • nebulon
        nebulon Staff last edited by

        Currently we use the ubuntu system cron to take care of that. But I agree it was so far far from optimal, especially around kernel updates, which seem to pollute the /boot partition.
        I think we have to build our own mechanism there, essentially our own cron which runs the appropriate apt commands.

        Does anyone here have more experience with this?

        rmdes 1 Reply Last reply Reply Quote 0
        • rmdes
          rmdes @nebulon last edited by rmdes

          @nebulon I think this : sudo apt autoremove --purge
          should be enough to clean up old kernels safely
          edit : The above commands only work on newer systems as all old Linux kernels and headers automatically flagged as no more needed, and thus can be purged.

          this link has all the different ways to remove old kernels safely : https://www.cyberciti.biz/faq/ubuntu-18-04-remove-all-unused-old-kernels/

          necrevistonnezr 1 Reply Last reply Reply Quote 0
          • necrevistonnezr
            necrevistonnezr @rmdes last edited by necrevistonnezr

            @rmdes
            Cloudron is on 16.04, so

            sudo purge-old-kernels && sudo apt autoremove && sudo apt autoclean
            

            should be correct IMHO.

            mehdi 1 Reply Last reply Reply Quote 1
            • mehdi
              mehdi App Dev @necrevistonnezr last edited by

              @necrevistonnezr said in Add `apt autoremove`:

              Cloudron is on 16.04

              Cloudron runs currently on both 16.04 and 18.04, and soon on 20.04

              necrevistonnezr 1 Reply Last reply Reply Quote 2
              • necrevistonnezr
                necrevistonnezr @mehdi last edited by

                @mehdi Right! I even asked for 18.04 back in the day ! 🤖 Alzheimers....

                1 Reply Last reply Reply Quote 0
                • girish
                  girish Staff last edited by

                  I assume this feature is to autoremove stuff is only for removing old kernels? I have to say I have not seen the issue of boot filling up in Ubuntu 18. Has anyone hit this in bionic?

                  Also, ubuntu security updates does not add new packages (only updates existing ones). So, AFAIK, this feature is only for removing kernels and nothing else. I am happy to add some button (instead of an automated cron).

                  mehdi rmdes 2 Replies Last reply Reply Quote 0
                  • mehdi
                    mehdi App Dev @girish last edited by

                    @girish autoremove removes packages which were installed automatically (as dependencies of other packages you installed), and which are not needed anymore.

                    For example, if you install package A manually at version 1.0, which depends on package B, then at a later point in time A gets updated to 2.0 which does not depend on B anymore. Well in this case, B stays installed, but is not necessary, and autoremove removes it.

                    girish 1 Reply Last reply Reply Quote 1
                    • girish
                      girish Staff @mehdi last edited by

                      @mehdi Right, but I meant in the context of Cloudron why does one ever need to 'autoremove'? Since Cloudron itself doesn't install packages once installed. Is this for the use case of people installing some packages outside of Cloudron (if so, is it then wise to autoremove stuff?)?

                      mehdi 1 Reply Last reply Reply Quote 0
                      • mehdi
                        mehdi App Dev @girish last edited by

                        @girish In cloudron's case, yeah I don't see anything other than kernels off the top of my head where this could apply, but it's still possible for dependencies of other packages.

                        In any case, I have personally never seen a case where autoremove broke stuff.

                        girish 1 Reply Last reply Reply Quote 0
                        • girish
                          girish Staff @mehdi last edited by girish

                          @mehdi hmmm, I went back and checked and indeed the install script does not call autoremove in the end, maybe it should.

                          This feature request started with "As Cloudron does automatic security and system updates", so I just want to point out that neither of those require auto-remove since additional packages are not installed and the security updates are very conservative and not dramatic (like removing deps etc). So, except for this kernel stuff, we don't need autoremove, I think. I don't completely understand why ubuntu itself doesn't have a mechanism for this. Happy to be corrected here though 🙂

                          robi 1 Reply Last reply Reply Quote 0
                          • rmdes
                            rmdes @girish last edited by

                            @girish have seen this, but like 2 years ago ?😳

                            1 Reply Last reply Reply Quote 0
                            • robi
                              robi @girish last edited by

                              Wow this really exploded while I slept.

                              @girish That is not a correct conclusion.
                              @mehdi is correct above.

                              Even with Cloudron not installing anything new, the system will over time end up with orphaned dependencies that can be removed. This includes old kernels.

                              It will not harm the system, only keep it less cluttered and do the right thing(tm). 😉

                              Please do the needful. 🤗

                              Life of Advanced Technology

                              1 Reply Last reply Reply Quote 1
                              • mehdi
                                mehdi App Dev last edited by

                                Even if not automatic, I think a button do to it manually would do the job.

                                That plus a warning for admins that the boot partition is nearly full would cover a great majority of usecases i think

                                robi 1 Reply Last reply Reply Quote 1
                                • robi
                                  robi @mehdi last edited by

                                  @mehdi Why give the admin yet another button when it can be eliminated altogether? I'd rather do it on CLI then.

                                  Point is, I don't want to see autoremove whenever I run apt or have to deal with kernels filling up for poorly planned partitions or side-effects of OS vendor releasing lots of kernels and not cleaning up.

                                  Life of Advanced Technology

                                  necrevistonnezr 1 Reply Last reply Reply Quote 0
                                  • necrevistonnezr
                                    necrevistonnezr @robi last edited by

                                    @robi said in Add `apt autoremove`:

                                    Point is, I don't want to see autoremove whenever I run apt or have to deal with kernels filling up for poorly planned partitions or side-effects of OS vendor releasing lots of kernels and not cleaning up.

                                    If autoremove gets integrated in the Cloudron apt update routine, you wouldn't "see" it?!

                                    robi 1 Reply Last reply Reply Quote 0
                                    • robi
                                      robi @necrevistonnezr last edited by robi

                                      @necrevistonnezr No, as it would be run regularly in the background.

                                      Hence when I run apt install blah manually, it has a low chance of finding it needs to remove something via autoremove.

                                      Life of Advanced Technology

                                      mehdi 1 Reply Last reply Reply Quote 0
                                      • mehdi
                                        mehdi App Dev @robi last edited by

                                        @robi said in Add `apt autoremove`:

                                        Hence when I run apt install blah manually

                                        Aren't you not supposed to install stuff manually on cloudron?

                                        necrevistonnezr 1 Reply Last reply Reply Quote 3
                                        • nebulon
                                          nebulon Staff last edited by girish

                                          Indeed one shouldn't (install manually) to avoid breaking on updates, but in the end it is still ones own server 😉

                                          1 Reply Last reply Reply Quote 0
                                          • necrevistonnezr
                                            necrevistonnezr @mehdi last edited by

                                            @mehdi Exactly, we're talking about Cloudron background routines, not manual installing on the server.

                                            1 Reply Last reply Reply Quote 0
                                            • robi
                                              robi last edited by

                                              Are you telling me that apt install screen is going to break updates? 😆

                                              Life of Advanced Technology

                                              1 Reply Last reply Reply Quote 0
                                              • First post
                                                Last post
                                              Powered by NodeBB