Skip to content

Instantly share code, notes, and snippets.

@tejasbubane
Created December 19, 2020 19:28
Show Gist options
  • Select an option

  • Save tejasbubane/3897c43f9851f53cf7ef2fb114fa9405 to your computer and use it in GitHub Desktop.

Select an option

Save tejasbubane/3897c43f9851f53cf7ef2fb114fa9405 to your computer and use it in GitHub Desktop.

Revisions

  1. tejasbubane created this gist Dec 19, 2020.
    26 changes: 26 additions & 0 deletions arch-cleanup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # No need to run this everyday - once a month should be fine

    # Remove cache:
    sudo pacman -Scc
    yay -Scc

    # Remove unwanted dependencies:
    yay -Yc

    # Remove orphan packages
    sudo pacman -Qtdq | sudo pacman -Rns

    # Cleanup cache:
    du -sh ~/.cache
    rm -rf ~/.cache/*

    # Clean the journal:
    du -sh /var/log/journal
    sudo journalctl vacuum-time=1weeks

    # Update mirrors
    sudo reflector -c India -c Singapore -c France -c Germany --age 12 --completion-percent 100 --protocol https --sort rate --verbose --save /etc/pacman.d/mirrorlist

    # Update packages:
    sudo pacman -Syyu
    yay -Syu --devel --timeupdate