Error Permission denied when running brew cleanup

When I try to run `brew cleanup` I get:

Warning: Skipping atk: most recent version 2.34.1 not installed

Warning: Skipping git: most recent version 2.23.0_1 not installed

Warning: Skipping libgcrypt: most recent version 1.8.5 not installed

Warning: Skipping nspr: most recent version 4.23 not installed

Warning: Skipping nss: most recent version 3.46.1 not installed

Warning: Skipping poppler: most recent version 0.81.0 not installed

Error: Permission denied @ apply2files - /Users/iuliaulialiaia/Library/Caches/Homebrew/.cleaned

I can neither run other commands that uses `brew cleanup`, like `brew upgrade`:

...

==> `brew cleanup` has not been run in 30 days, running now...

Removing: /usr/local/Cellar/python@2/2.7.16... (3,750 files, 51.6MB)

Error: Permission denied @ apply2files - /Users/iuliaulialiaia/Library/Caches/Homebrew/.cleaned

P.S.: I cannot run homebrew as root:

Error: Running Homebrew as root is extremely dangerous and no longer supported.

As Homebrew does not drop privileges on installation you would be giving all

build scripts full access to your system.

MacBook Pro 13", macOS 10.14

Posted on Oct 30, 2019 12:27 AM

Reply I have this question too (8)

All replies

Drop Down menu

  1. Page 1 of 1

Page content loaded

User profile for user: VikingOSX

VikingOSX

 

User level:Level 9

(50,167 points)

 
macOSSpeciality level out of ten: 1

Oct 30, 2019 5:39 AM in response to iuliaulialiaia

At some point, I believe homebrew was suggesting one change the ownership and group of /usr/local to $(whoami):admin — which is what I have set (in Mojave) and homebrew just works for update, upgrade, and cleanup. A bit more of a PITA on Catalina though.

Reply Helpful

Thread reply - more options
User profile for user: Jmcgui

Jmcgui

 

User level:Level 1

(4 points)

Oct 30, 2019 8:45 AM in response to iuliaulialiaia

Guessing you are running Catalina then! It's changed the permissions model which has broken lots of stuff :(

This should work:

sudo chown -R $(whoami):admin /usr/local/* && sudo chomd -R g+rwx /usr/local/*

Then try brew cleanup

Reply Helpful

Thread reply - more options
User profile for user: mmongeau

mmongeau

 

User level:Level 1

(4 points)

Nov 1, 2019 8:39 PM in response to Jmcgui

The second command has a typo, it should be chmod instead of chomd

sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*

最新文章

  1. Java多线程系列--“JUC锁”03之 公平锁(一)
  2. 让 http 2来得更猛烈些吧
  3. Entity Framework中IQueryable, IEnumerable, IList的区别
  4. 自定义button
  5. log4net 添加自定义日志到数据库
  6. Notes of learning AutoLayout
  7. inline-block使标签间出现空白
  8. How to use HaploView
  9. c语言编程之栈(数组实现)
  10. 【转】C++ 内存分配(new,operator new)详解
  11. 二、python 函数
  12. Python 中的引用和类属性的初步理解
  13. STL之使用vector排序
  14. QWebEngineView拦截Url请求设置
  15. cxGrid_Q31584 cxgrid 拖放移动记录
  16. log4j日志记录级别是如何工作?
  17. IDEAL字体颜色修改
  18. Scrapy的piplines.py存储文件和存储mongodb
  19. 3,fiddler手机端的设置
  20. 黑客帝国效果赏析(包含ES6的语法)

热门文章

  1. JavaScript进行UTF-8编码与解码
  2. PB对象Event ID说明
  3. AspNetCore Redis实现分布式缓存
  4. [UOJ #140]【UER #4】被粉碎的数字
  5. golang--获取进程ID(windows)
  6. 转 Json数据格式化
  7. Bootstraps 4 引入报错 Error: Bootstrap tooltips require Tether
  8. iOS - xcode经常报的经典error解决办法大全
  9. iOS - Base64转图片&&图片转Base64
  10. TR-银行通信相关文档