更改权限访问被拒绝brew链接imagemagick

问题描述 投票:1回答:2

Imagemagick未正确安装在我的计算机上。我有自制软件,在尝试链接时遇到了this post中列出的相同问题

Caseys-MacBook-Pro:~ CaseyJayne$ brew link imagemagick
Linking /usr/local/Cellar/imagemagick/7.0.8-13... 
Error: Could not symlink etc/ImageMagick-7/colors.xml
Target /usr/local/etc/ImageMagick-7/colors.xml already exists. You may want to remove it: rm '/usr/local/etc/ImageMagick-7/colors.xml'

To force the link and overwrite all conflicting files: brew link --overwrite imagemagick

To list all files that would be deleted:
  brew link --overwrite --dry-run imagemagick

我试过强制覆盖,但它没有用。

Caseys-MacBook-Pro:~ CaseyJayne$ brew link --overwrite imagemagick
Linking /usr/local/Cellar/imagemagick/7.0.8-13... 
Error: Could not symlink etc/ImageMagick-7/colors.xml
/usr/local/etc/ImageMagick-7 is not writable.
Caseys-MacBook-Pro:~ CaseyJayne$ brew link -f imagemagick
Linking /usr/local/Cellar/imagemagick/7.0.8-13... 
Error: Could not symlink etc/ImageMagick-7/colors.xml
Target /usr/local/etc/ImageMagick-7/colors.xml
already exists. You may want to remove it:
  rm '/usr/local/etc/ImageMagick-7/colors.xml'

To force the link and overwrite all conflicting files:
  brew link --overwrite imagemagick

我尝试删除并移动文件

Caseys-MacBook-Pro:~ CaseyJayne$ rm '/usr/local/etc/ImageMagick-7/colors.xml'
override rw-r--r--  root/wheel for /usr/local/etc/ImageMagick-7/colors.xml? yes
rm: /usr/local/etc/ImageMagick-7/colors.xml: Permission denied
Caseys-MacBook-Pro:~ CaseyJayne$ mv '/usr/local/etc/ImageMagick-7/colors.xml' ~/Desktop/
mv: rename /usr/local/etc/ImageMagick-7/colors.xml to /Users/CaseyJayne/Desktop/colors.xml: Permission denied

我尝试将整个etc文件的权限更改为755,将目录更改为755,将文件夹更改为644,并使用rmdir删除整个文件(所有列在链接帖子的注释中)。我用相同的输出再次完成整个过程。我跑了brew医生,并按照与imagemagick有关的所有事情的指示。

目前,干运行提供此输出:

Caseys-MacBook-Pro:~ CaseyJayne$ brew link --overwrite --dry-run imagemagick
Would remove:

/ usr / local / etc / / usr / local / bin / / usr / local / share /目录和子目录示例中的1020个文件:

/usr/local/etc/ImageMagick-7/colors.xml
/usr/local/bin/Magick++-config 
/usr/local/share/ImageMagick-7/locale.xml

更改权限或删除文件的最佳选择是什么?让我紧张的想法:手动显示隐藏的gui文件,将它们移动到垃圾桶,运行brew链接imagemagick,然后将它们从垃圾桶恢复到其他文件夹中?

此外 - 没有选择卸载imagemagick(sudo或yum开头)

我使用的是Mac OS High Sierra 10.13.6 Imagemagick 7.0.8-13 Homebrew 1.8.0

macos imagemagick homebrew chmod
2个回答
0
投票

您的用户对此文件没有任何权利,但如果您是计算机的管理员,则可以使用sudo将其删除:

sudo rm '/usr/local/etc/ImageMagick-7/colors.xml'

0
投票

Image Magick在我的隐藏文件中安装了大量文件。我的同事(多年来一直在编码,神经科学和工程学双博士)帮助我完成并手动删除任何形式的“魔法”。

我们一次做到这一点,以确保我们不会随意删除必要的东西。我几个月来一直在使用我的电脑而没有任何问题,并且会说这是最安全,最无缝的方式。 ^上面的解决方案没有卸载imagemagick放入我的计算机的所有东西,但只删除了一个项目。

© www.soinside.com 2019 - 2024. All rights reserved.