ech0x
V2EX  ›  macOS

各位都是经常 Brew cleanup 的吗?

  •  
  •   ech0x · Aug 30, 2018 · 15404 views
    This topic created in 2988 days ago, the information mentioned may be changed or developed.

    前几天,brew cleanup 了一下,磁盘突然多出了 24 个 G。

    各位都是经常性的 brew cleanup 的吗?

    34 replies  •  2021-01-19 16:41:19 +08:00
    qihu3721
    qihu3721
    Aug 30, 2018
    1
    每天运行一次
    #!/bin/bash
    brew update && brew upgrade && brew cleanup
    idlerlestat
    idlerlestat
    Aug 30, 2018❤️3
    2
    update() {
    if hash brew 2>/dev/null; then
    echo "Updating Homebrew"
    brew update
    echo "Upgrading Homebrew"
    brew upgrade
    echo "Upgrading Homebrew Casks"
    brew cu -a -y
    echo "Some additional cleaning"
    brew cleanup -s
    find $(brew --cache) -maxdepth 2 -type f -delete
    fi
    }
    agagega
    agagega
    Aug 30, 2018 via iPhone
    3
    128G,没办法
    wu67
    wu67
    Aug 30, 2018
    4
    ```bash
    echo "$ brew update..."
    brew update

    echo "$ brew upgrade..."
    brew upgrade

    echo "$ brew cleanup..."
    brew cleanup

    echo "$ npm upgrade -g"
    npm upgrade -g

    caskapp=`brew cask list`

    for app in $caskapp
    do
    echo "$ try upgrae" ${app}
    brew cask upgrade $app
    done
    ```
    自己写的的渣渣脚本
    congeec
    congeec
    Aug 30, 2018
    5
    brew up --cleanup
    icanfork
    icanfork
    Aug 30, 2018
    6
    我也基本没有运行过,然后看到这个帖,尝试了下
    ==> This operation has freed approximately 889B of disk space.
    这,剧本不一样啊
    NSAtools
    NSAtools
    Aug 30, 2018
    7
    This operation has freed approximately 105.0MB of disk space
    ShanghaiLinchong
    ShanghaiLinchong
    Aug 30, 2018
    8
    ==> This operation has freed approximately 313.6MB of disk space.
    lddsb
    lddsb
    Aug 30, 2018
    9
    如果你装了 rust 而且经常 brew upgrade 的话,你就会知道 brew cleanup 是多么重要。。
    lucifer9
    lucifer9
    Aug 30, 2018
    10
    别忘了还有 brew prune
    MagicRabbit0503
    MagicRabbit0503
    Aug 30, 2018
    11
    This operation has freed approximately 97.3MB of disk space.
    ech0x
    ech0x
    OP
    Aug 30, 2018
    12
    @belin520 #6 我也不知道为什么我能有这么大
    haha1903
    haha1903
    Aug 30, 2018
    13
    This operation has freed approximately 3.7GB of disk space.
    ChopinWong
    ChopinWong
    Aug 30, 2018
    14
    brew update
    brew upgrade
    brew prune
    brew cleanup
    bjfane
    bjfane
    Aug 30, 2018
    15
    This operation has freed approximately 64B of disk space. 没事就会清。 哈哈
    RoshanWu
    RoshanWu
    Aug 30, 2018
    16
    alias bubo='brew update && brew outdated'
    alias bubc='brew upgrade && brew cleanup'
    alias bubu='bubo && bubc'
    mogita
    mogita
    Aug 30, 2018
    17
    This operation has freed approximately 541.7MB of disk space.
    Baka9
    Baka9
    Aug 30, 2018
    18
    This operation has freed approximately 7GB of disk space.

    第一次看到这个命令。。(
    DigDeeply
    DigDeeply
    Aug 30, 2018
    19
    ==> This operation has freed approximately 8.9MB of disk space.
    czjackjin
    czjackjin
    Aug 30, 2018
    20
    每天 upgrade,今天第一次看到可以 cleanup,多出来 2 个 g,128g 的 ssd,还是蛮可观的
    tyhunter
    tyhunter
    Aug 30, 2018
    21
    先 upgrade 后 cleanup,清理出 500m 的空间
    edsion996
    edsion996
    Aug 30, 2018
    22
    This operation has freed approximately 310MB of disk space.
    yeleiyu
    yeleiyu
    Aug 30, 2018
    23
    This operation has freed approximately 67.1MB of disk space.


    不常用,所以能释放的空间也很有限啊~~~~
    livc
    livc
    Aug 30, 2018
    24
    ==> This operation has freed approximately 1GB of disk space.
    vjnjc
    vjnjc
    Aug 30, 2018 via Android
    25
    原来能这样啊,多谢分享
    1002xin
    1002xin
    Aug 30, 2018
    26
    想起来 up 一次
    dif
    dif
    Aug 31, 2018
    27
    256 没办法,更新一次执行一次。
    AnyISalIn
    AnyISalIn
    Aug 31, 2018
    28
    ==> This operation has freed approximately 270.9MB of disk space.
    Yantasf
    Yantasf
    Aug 31, 2018
    29
    最近刚研究了一下 launchctl 写了一个超简单的定时任务,每天固定时间更新清理一下 brew,顺便提醒我订外卖
    yuanxing008
    yuanxing008
    Sep 1, 2018
    30
    从未执行过、、、待会试试。。不过我 2T 的盘应该不怎么需要经常执行吧。。
    thiswind
    thiswind
    Nov 15, 2019
    31
    @lucifer9
    @ChopinWong 现在新版本里面 prune 被 deprecated 了,新的写法要加上一个天数,比如早于 3 天的:brew cleanup --prune 3
    thiswind
    thiswind
    Nov 15, 2019❤️1
    32
    @qihu3721

    prune 今年 deprecated 了

    #!/bin/bash
    brew update && brew upgrade && brew cleanup && brew cleanup --prune 3 # 清理早于 3 天的
    madao100
    madao100
    Dec 7, 2020
    33
    @qihu3721 mark
    evam
    evam
    Jan 19, 2021
    34
    brew prune
    Error: Unknown command: prune
    ❌


    brew cleanup --prune 3
    ✅
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1440 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 73ms · UTC 18:21 · PVG 02:21 · LAX 10:21 · JFK 13:21
    ♥ Do have faith in what you're doing.