如何安裝devtools的套件

708 views
Skip to first unread message

Liu

unread,
Jun 24, 2015, 5:02:03 AM6/24/15
to taiwa...@googlegroups.com
大家好,請教大家是否也有碰過同樣的問題~
最近想要使用Shinyapps.io,需要安裝"devtools"的套件,打了install.packages("devtools", dependencies = TRUE)
但是怎麼也安裝不起來:(

錯誤訊息是
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found Could not find libxml2. Please install libxml2-devel (rpm) or libxml2-dev (deb). ERROR: configuration failed for package ‘xml2’ * removing ‘/home/yiting/R/i686-redhat-linux-gnu-library/3.1/xml2’ Warning in install.packages : installation of package ‘xml2’ had non-zero exit status ERROR: dependency ‘xml2’ is not available for package ‘rversions’ * removing ‘/home/yiting/R/i686-redhat-linux-gnu-library/3.1/rversions’ Warning in install.packages : installation of package ‘rversions’ had non-zero exit status ERROR: dependency ‘rversions’ is not available for package ‘devtools’ * removing ‘/home/yiting/R/i686-redhat-linux-gnu-library/3.1/devtools’ Warning in install.packages : installation of package ‘devtools’ had non-zero exit status The downloaded source packages are in ‘/tmp/Rtmpvz0ZSk/downloaded_packages’


目前的作業系統是centOS,R及R-Studio版本已安裝到最新,
上網查了一下,嘗試過以下網頁的指令,

在linux上打了 yum install libxml2-devel ,但是出現"程式記憶體區段錯誤 (core dumped)" 的錯誤訊息

這一篇使用sudo yum -y install libcurl libcurl-devel 的指令,但還是無法解決安裝的問題

也到了這邊下載下面的zip/tgz檔,強制install它,package裡是出現了"devtools",但是卻無法library。


以上,請教大家如何安裝devtools的套件,感謝!

Wush Wu

unread,
Jun 24, 2015, 10:03:23 PM6/24/15
to taiwa...@googlegroups.com
**Could not find libxml2. Please install libxml2-devel (rpm) or libxml2-dev (deb).**

你要先解決這個問題。

> 在linux上打了 yum install libxml2-devel ,但是出現"程式記憶體區段錯誤 (core dumped)" 的錯誤訊息

這要去查詢libxml2相關資源。
我的經驗是,也許把套件列表更新一下就可以解決了。或是自己下載原始碼,然後建置安裝也可以。

Wush

Liu於 2015年6月24日星期三 UTC+8下午5時02分03秒寫道:

He-chien Tsai

unread,
Jun 24, 2015, 11:14:12 PM6/24/15
to taiwa...@googlegroups.com
你翻翻其他CRAN安裝包的CRAN checks就會發現, 多數安裝包都會特地對fedora跟debian作建構測試, 但完全沒有在centos上的測試
你要用centos的話就只能自求多福, 可能會有不少函式庫要在沒有依賴管理器的狀況下, 需要你自行處理依賴並建構
改用Fedora才不會夜長夢多, Fedora有對科學計算用途有大力支持, 像是R或Python搞數值計算又依賴原生函式庫的, 相關依賴已經處理好, 不大會出包
centos是伺服器用途, 比較少在更新安裝包, devtools在2015-05-09更新, centos上的函式庫很可能沒跟上

devtools的CRAN checks上有Fedora建構成功的紀錄:
ftp://cran.r-project.org/pub/R/web/checks/check_results_devtools.html


Liu於 2015年6月24日星期三 UTC+8下午5時02分03秒寫道:

Liu

unread,
Jun 25, 2015, 9:39:41 AM6/25/15
to taiwa...@googlegroups.com
謝謝兩位大大提供的建議~
最後更新了libxml的版本,參考了這一篇 http://superuser.com/questions/444626/how-to-upgrade-libxml-on-centos

將版本改為2.7.6

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz                                                                                             
tar -xvf libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
./configure
make
sudo make install
終於更新成功,也順利安裝了devtools的套件。
謝謝!

Reply all
Reply to author
Forward
0 new messages