Announcement

Collapse
No announcement yet.

Automatically delete cached update packages

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [CONFIGURATION] Automatically delete cached update packages

    Every time there's a software update I have to run Bleachbit as root to remove all the downloaded files left over from the install, sometimes this is nearly 10Gb of stuff taking up space on my / partition. I'm sure there used to be an option in update settings to automatically delete them after updating but for the life of me can't find it in Discover!

    Please refresh my failing memory
    Constant change is here to stay!

    #2
    See here.
    apt autoclean and the even more thorough apt clean are probably what you want..

    Comment


      #3
      Yes, I use them, often, but I'd rather the system clean up after itself

      I think I may have found the answer in an older tutorial:

      https://is.gd/iRcf2g

      sudo nano etc/apt/apt.conf.d/10periodic

      and set APT::Periodic::AutocleanInterval to 1
      Last edited by Beerislife; Mar 08, 2020, 01:21 AM.
      Constant change is here to stay!

      Comment


        #4
        Let us know if it works
        I don't sudo nano since Kate got clever, though ;·)

        Comment


          #5
          I use sudo nano and sudo mc quite a lot, I'm old fashioned like that! :-)
          Constant change is here to stay!

          Comment


            #6
            Hey, great tip!

            As for me, I use "sudo nano" so much I have an alias set to it. All I type is: sn

            Please Read Me

            Comment


              #7
              Originally posted by oshunluvr View Post
              As for me, I use "sudo nano" so much I have an alias set to it. All I type is: sn
              This would be nearly functionally the same, except safer:
              Code:
              export SUDO_EDITOR=nano
              alias sn='sudoedit'
              Regards, John Little

              Comment


                #8
                Originally posted by jlittle View Post
                This would be nearly functionally the same, except safer:
                Code:
                export SUDO_EDITOR=nano
                alias sn='sudoedit'
                And why is that safer on a machine in my home?

                Please Read Me

                Comment


                  #9
                  I suggested sudoedit rather than sudo nano...
                  Originally posted by oshunluvr View Post
                  And why is that safer on a machine in my home?
                  Two scenarios come to mind:
                  1. ^O to write out the file. Nano gives a warning, but if you might be expecting it.
                  2. Bugs in nano.

                  But, for me, it's an attitude, to minimize running as root. This attitude can be important when things are going wrong, or when one is bored or tired. I've seen costly screw-ups by people with different attitudes.
                  Regards, John Little

                  Comment


                    #10
                    So I clearly don't understand. Using nano as root is using nano as root, isn't it? What is the functional difference of launching "sudo nano" from setting nano as your sudo editor?

                    Please Read Me

                    Comment


                      #11
                      Originally posted by oshunluvr View Post
                      So I clearly don't understand. Using nano as root is using nano as root, isn't it? What is the functional difference of launching "sudo nano" from setting nano as your sudo editor?
                      sudoedit first makes a copy of the file, usually in /tmp, then you edit it running as yourself, then when you save if there's changes the file is copied over the root owned file.
                      Regards, John Little

                      Comment


                        #12
                        Originally posted by oshunluvr View Post
                        So I clearly don't understand. Using nano as root is using nano as root, isn't it? What is the functional difference of launching "sudo nano" from setting nano as your sudo editor?
                        if you use sudoedit, the editor itself is not running as root. You're basically editing a tempfile with the editor running as your regular user, only the final file write opertion is performed as root (overwriting the original with the tempfile).
                        More here: http://www.wingtiplabs.com/blog/post...3/13/sudoedit/

                        EDIT: jlittle was quicker to it

                        Comment


                          #13
                          Thanks, I think I understand the reasoning. If I "sudo nano" a critical system file and the operation is interrupted, it may leave behind a partially edited file and a lock file, potentially breaking the system. Where as by using "sudoedit" the same event would leave behind nothing (my tmp is in RAM).

                          I don't know why I've never encountered this advice before. Sounds like a no brainer...

                          Please Read Me

                          Comment


                            #14
                            Originally posted by oshunluvr View Post
                            I don't know why I've never encountered this advice before. Sounds like a no brainer...
                            Until a few months ago, if you tried sudo kate, it would say:
                            "Executing Kate as root is not possible. To edit files as root use: SUDO_EDITOR=kate sudoedit <file>."
                            Now it just says "Executing Kate as root is not possible."
                            It doesn't say "Just authenticate on save, donk", though

                            Comment


                              #15
                              I don't think it has helped much. Whenever I run Bleachbit as root on my KDE neon install it cleans around 8Gb of junk. On the boss's Kubuntu 18.04 machine it cleans about 400Mb. That's a big difference!
                              Constant change is here to stay!

                              Comment

                              Working...
                              X