2015-07-05 82 views
5

我嘗試使用自制安裝靈藥,我得到了以下錯誤BREW鏈接錯誤的libpng和的libtiff

==> Pouring libtiff-4.0.3.yosemite.bottle.tar.gz 
Error: An unexpected error occurred during the `brew link` step 
The formula built, but is not symlinked into /usr/local 

文件存在 - 在/ usr/local/lib目錄 錯誤:文件存在 - 在/ usr/local/lib目錄

我跑brew doctor,我看到這個

Warning: You have unlinked kegs in your Cellar 
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on 
those kegs to fail to run properly once built. Run `brew link` on these: 

libpng 
libtiff 

於是我就brew link libpng,我得到這個

Linking /usr/local/Cellar/libpng/1.6.17... Error: File exists - /usr/local/lib 

我不知道什麼是錯。任何幫助

+2

堆棧溢出有類似的問題,但有不同的包。你有嘗試過嗎?有些人建議運行「brew link -f libpng」,但你應該調查以確保它不會搞亂你的系統。 –

+0

@JoséValim我已經嘗試了其中的幾種解決方案,包括上面提到的解決方案。到目前爲止沒有運氣。 –

+0

如何'做brew'卸載libpng'然後'brew install libpng'。對'libtiff'也做同樣的事情。你嘗試過嗎? – Gjaldon

回答

0

看起來好像在你的/usr/local/lib文件夾中,現在有libpng符號,因此brew不想覆蓋它們。它是elixir的依賴關係,所以它暫停設置。

如果您正在使用的MacPorts或自制或手動安裝任何東西,然後依賴可能會發生衝突。以互相排斥的方式使用其中之一更好。

這是一個可行的選擇使用自制的整體,因爲易用性,如果你不打算從源代碼編譯軟件包。

Homebrew並不像您期望的那樣工作。默認情況下,它有一個基本目錄,用於安裝名爲Cellar的工件keg,雖然它是可配置的。通常情況下,你會二進制庫複製到/usr/local/bin,以/usr/local/lib,頭向/usr/local/include等等......然而,他們自制軟件安裝到自己的目錄,並創建對這些目錄的符號鏈接,而不是爲了使它們在功能同樣的方式。

您可能會發現brew doctor命令錯誤(或incompatibities)。它會告訴你符號/文件衝突。您可以手動將它們從文件系統中刪除,然後brew將創建指向其基本目錄的符號鏈接(在您的brew link $PACKAGE_NAME命令上)。

實驗

當我突然決定做在我的電腦就沒有輸出像一些意想不到的頭文件,所以一個簡單的brew doctor

Warning: Unbrewed header files were found in /usr/local/include. 
If you didn't put them there on purpose they could cause problems when 
building Homebrew formulae, and may need to be deleted. 

但是,它也指出,這些都是如果一切沒有意義工作原理:

Please note that these warnings are just used to help the Homebrew maintainers 
with debugging if you file an issue. If everything you use Homebrew for is 
working fine: please don't worry and just ignore them. Thanks! 

前幾行從輸出:

Unexpected header files: 
    /usr/local/include/node/android-ifaddrs.h 
    /usr/local/include/node/ares.h 
    ... 

這不是我的個人電腦,但它似乎是有人安裝node到這臺計算機(實際上用戶)手動。在這種情況下,試圖安裝它或者通過brew依賴於它的任何東西都會失敗,因爲即將到來的頭文件會與預安裝的文件衝突。