V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ech0x
V2EX  ›  macOS

各位都是经常 Brew cleanup 的吗?

  •  
  •   ech0x · 2018-08-30 07:10:36 +08:00 · 13850 次点击
    这是一个创建于 2307 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

    34 条回复    2021-01-19 16:41:19 +08:00
    qihu3721
        1
    qihu3721  
       2018-08-30 07:38:46 +08:00
    每天运行一次
    #!/bin/bash
    brew update && brew upgrade && brew cleanup
    idlerlestat
        2
    idlerlestat  
       2018-08-30 08:30:53 +08:00   ❤️ 3
    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
        3
    agagega  
       2018-08-30 08:46:14 +08:00 via iPhone
    128G,没办法
    wu67
        4
    wu67  
       2018-08-30 09:07:57 +08:00
    ```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
        5
    congeec  
       2018-08-30 09:21:01 +08:00
    brew up --cleanup
    belin520
        6
    belin520  
       2018-08-30 09:29:37 +08:00
    我也基本没有运行过,然后看到这个帖,尝试了下
    ==> This operation has freed approximately 889B of disk space.
    这,剧本不一样啊
    NSAtools
        7
    NSAtools  
       2018-08-30 09:39:33 +08:00
    This operation has freed approximately 105.0MB of disk space
    SKull4
        8
    SKull4  
       2018-08-30 09:41:05 +08:00
    ==> This operation has freed approximately 313.6MB of disk space.
    lddsb
        9
    lddsb  
       2018-08-30 09:41:51 +08:00
    如果你装了 rust 而且经常 brew upgrade 的话,你就会知道 brew cleanup 是多么重要。。
    lucifer9
        10
    lucifer9  
       2018-08-30 10:14:02 +08:00
    别忘了还有 brew prune
    MagicRabbit0503
        11
    MagicRabbit0503  
       2018-08-30 10:15:32 +08:00
    This operation has freed approximately 97.3MB of disk space.
    ech0x
        12
    ech0x  
    OP
       2018-08-30 10:41:45 +08:00
    @belin520 #6 我也不知道为什么我能有这么大
    haha1903
        13
    haha1903  
       2018-08-30 10:44:26 +08:00
    This operation has freed approximately 3.7GB of disk space.
    ChopinWong
        14
    ChopinWong  
       2018-08-30 10:45:41 +08:00
    brew update
    brew upgrade
    brew prune
    brew cleanup
    bjfane
        15
    bjfane  
       2018-08-30 11:46:13 +08:00
    This operation has freed approximately 64B of disk space. 没事就会清。 哈哈
    RoshanWu
        16
    RoshanWu  
       2018-08-30 12:17:12 +08:00
    alias bubo='brew update && brew outdated'
    alias bubc='brew upgrade && brew cleanup'
    alias bubu='bubo && bubc'
    ck65
        17
    ck65  
       2018-08-30 13:12:52 +08:00
    This operation has freed approximately 541.7MB of disk space.
    Baka9
        18
    Baka9  
       2018-08-30 13:17:08 +08:00
    This operation has freed approximately 7GB of disk space.

    第一次看到这个命令。。(
    DigDeeply
        19
    DigDeeply  
       2018-08-30 13:22:05 +08:00
    ==> This operation has freed approximately 8.9MB of disk space.
    czjackjin
        20
    czjackjin  
       2018-08-30 13:49:25 +08:00
    每天 upgrade,今天第一次看到可以 cleanup,多出来 2 个 g,128g 的 ssd,还是蛮可观的
    tyhunter
        21
    tyhunter  
       2018-08-30 14:09:48 +08:00
    先 upgrade 后 cleanup,清理出 500m 的空间
    zjb861107
        22
    zjb861107  
       2018-08-30 14:26:48 +08:00
    This operation has freed approximately 310MB of disk space.
    yeleiyu
        23
    yeleiyu  
       2018-08-30 16:51:27 +08:00
    This operation has freed approximately 67.1MB of disk space.


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

    prune 今年 deprecated 了

    #!/bin/bash
    brew update && brew upgrade && brew cleanup && brew cleanup --prune 3 # 清理早于 3 天的
    madao100
        33
    madao100  
       2020-12-07 09:51:17 +08:00
    @qihu3721 mark
    evam
        34
    evam  
       2021-01-19 16:41:19 +08:00
    brew prune
    Error: Unknown command: prune



    brew cleanup --prune 3
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3845 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 05:07 · PVG 13:07 · LAX 21:07 · JFK 00:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.