• System Cleanup code idea and solutions


    I would like to get some input on what is good to keep system clean.

    On some discussiuon i find out that there are some lags in the code of system where you need to manually cleanup e.t.c. like for pacman cache… it will not be cleaned up and will grow till infinity…

    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    you can use paccache to do cleanup the cache:

    sudo paccache -rk 3
    
    ==> finished: 1 packages removed (disk space saved: 43.88 MiB)
    

    recommend is to keep 3 versions, what you will enable with the number after -rk

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • I never leave any version =

    sudo paccache -rk0

    ☺

  • For the sole fact that in my Ultrabox I have little space in /

    /dev/sdb2 29G 9,1G 19G 34% /
    

    not so in my home

    /dev/sda1        466G    12G  455G   3% /home
    
  • @n8bit oh yes having your docker images onto a usb stick and do run it just on a basic fuckin stable system with i3-wm …

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • Automatic pacman cache clean up exists since pacman was born. There’s nothing to invent.

    Simply use pacman’s hook, like this one:

    #==2012.02.15
    #--just created
    #--this folder
    #--and file
    
    [Trigger]
    Operation = Upgrade
    Operation = Install
    Operation = Remove
    Type = Package
    Target = *
    
    [Action]
    Description = Cleaning pacman cache...
    When = PostTransaction
    Exec = /usr/bin/paccache -rk 0
    
    #==
    

    The result is the empty cache upon each transaction termination:

    $ du /var/cache/pacman/ -h
    4.0K    /var/cache/pacman/pkg
    8.0K    /var/cache/pacman/
    $ 
    
  • @just said in System Cleanup code idea and solutions:

    There’s nothing to invent.

    🚬 of course!

  • I like this thread but i’m supper traumatized about destroying my system when i started using linux.

    At that time downgrading was such a complicated concept to me, like “where do i find a site to download an older version?”, “what the heck is this so-called downgrader?” etc etc.

    So i don’t like to clean the cache, maybe i need to create a script to keep the last 2 or 3 versions. When i have time though.

    Portergos site
    https://github.com/Portergos/portergos-iso

    Still in love with Antergos (default OS)
    I3wm

    Linux newbie since 06/2016

  • @fernandomaroto said in System Cleanup code idea and solutions:

    So i don’t like to clean the cache,…

    Yes, sure, and nobody forces you to clean the cache completely. You create and use pacman hooks according to your tastes and prefernces.

    …maybe i need to create a script to keep the last 2 or 3 versions. When i have time though.

    The paccache in the hook already does exactly that. There’s nothing to invent.

    I like to keep the cache completely clean. That’s why I use --keep level 0 witch paccache. You may --keep 1 to keep 1 pkg in cache for each installed pkg, or --keep 2 to keep 2 pkgs, or --keep 100 to keep 100. Any number of pkgs you wish.

  • @just Thanks for the enlightenments!

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • You can control how much cache is used in pamac-manager -> Preferences:

    0_1526632417944_pamac-cache.png
    By default 3 latest versions of each package is kept. Change it to smaller and save many GB of space.

    Please report issues including all details! ;-)
    Show files here: cat "file" | curl -F [email protected] https://ptpb.pw/?u=1
    and show the URL here.

  • @just said in System Cleanup code idea and solutions:

    The paccache in the hook already does exactly that. There’s nothing to invent.
    I like to keep the cache completely clean. That’s why I use --keep level 0 witch paccache. You may --keep 1 to keep 1 pkg in cache for each installed pkg, or --keep 2 to keep 2 pkgs, or --keep 100 to keep 100. Any number of pkgs you wish.

    thanks @just! So much to learn yet!

    Portergos site
    https://github.com/Portergos/portergos-iso

    Still in love with Antergos (default OS)
    I3wm

    Linux newbie since 06/2016

  • @manuel said in System Cleanup code idea and solutions:

    You can control how much cache is used in pamac-manager -> Preferences:

    0_1526632417944_pamac-cache.png
    By default 3 latest versions of each package is kept. Change it to smaller and save many GB of space.

    i think as pamac has no option to downgrade packages, thi option indicates only that if you press “clean cache” it will last the 3 last versions inside cache… but do not clean it automatic…

    [updates once a week] = [90% less problems]
    antergos:_rescue
    how to add system logs:
    wget http://bit.ly/2GCG9k2 && sh 2GCG9k2
    :handshake: donate antergos

  • Pacman hooks - like cache cleaning, in this thread - work independently from a tool, used to install, upgrade, remove packages.

    The cache will be cleaned always and in any case, whether it was filled in with packages by pacman, or by yaourt, aurman, pacmanxg, octopi, pamac, and similar.

  • @joekamprad said in System Cleanup code idea and solutions:

    https://wiki.archlinux.org/index.php/User:Allan/Pacman_Hooks

    Oops, I forgot to post a hooks howto. ArchWiki article is perfect, this is just a brief cleanup hook howto.

    • Create hooks dir

      sudo mkdir /etc/pacman.d/hooks
      
    • Create hook file

      sudo nano /etc/pacman.d/hooks/just-cleanup.hook
      
    • Add to it the following lines:

      #==2012.12.15
      #--just created
      #--this folder
      #--and file
      #--
      #--cleans pacman's
      #--cache completely
      
      [Trigger]
      Operation = Upgrade
      Operation = Install
      Operation = Remove
      Type = Package
      Target = *
      
      [Action]
      Description = Cleaning pacman cache...
      When = PostTransaction
      Exec = /usr/bin/paccache --remove --keep 0
      
      #==
      
    • Done.

    It’s that simple.

system112 cleanup2 solutions1 Posts 16Views 553
Log in to reply
Bloom Email Optin Plugin

Looks like your connection to Antergos Community Forum was lost, please wait while we try to reconnect.