2012-11-20 108 views
0

真的需要在這一個幫助。當我嘗試用cc來編譯,它顯示無法在ubuntu |中編譯cc,gcc沒有這樣的文件或目錄

-bash: /usr/bin/cc: No such file or directory 

,但所有必要的文件抄送,GCC,C++是目前在/ usr/bin目錄。我試圖安裝gcc-multilib包,之後我收到這個錯誤。 需要儘快修復它,因爲它運行一些重要的程序。 當我這樣做:update-alternatives --list cc,它顯示/usr/bin/gcc。然後我試着,update-alternatives --set cc /usr/bin/gcc,它給了 update-alternatives: warning: forcing reinstallation of alternative /usr/bin/gcc because link group cc is broken. update-alternatives: warning: not replacing /usr/bin/cc with a link.

回答

2

/usr/bin/cc應該是Ubuntu上的一個符號鏈接。檢查其目的地是否有效update-alternatives --list cc

update-alternatives --set cc /usr/bin/gcc(作爲root,sudo應該工作)應該修復它,如果/ usr/bin/gcc是一個有效的可執行文件。

+0

當我做到了:update-alternatives --list cc,它顯示'/ usr/bin/gcc '。當我更新替代品 - 設置cc/usr/bin/gcc時,它給了: - update-alternatives:警告:強制重新安裝替代/ usr/bin/gcc,因爲鏈接組cc已損壞。 update-alternatives:警告:不能用鏈接替換/ usr/bin/cc。 – sree127

+0

運行'ls -l/usr/bin/cc'。 GCC是否從軟件包管理器安裝? –

相關問題