【发布时间】:2011-12-07 14:28:16
【问题描述】:
我是 Linux 和 R 的新手。
我在 Ubuntu 11.04 中安装了 R 2.12。今天我尝试安装一个新包,所以我运行了以下命令:
install.packages('XML')
但是安装失败并给出如下信息:
* installing *source* package ‘XML’ ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
No ability to remove finalizers on externalptr objects in this verison of R
checking for sed... /bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking for xml2-config... no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’
* removing ‘/home/spirit/R/i686-pc-linux-gnu-library/2.12/XML’
The downloaded packages are in
‘/tmp/RtmpoZYxnv/downloaded_packages’
Warning message:
In install.packages("XML") :
installation of package 'XML' had non-zero exit status
我也试过了:
sudo install.packages('XML')
但它给出了相同的错误信息。
谁能给我一些建议?
【问题讨论】:
-
安装
xml2-config? -
这个问题在 Ubuntu 14.04 中(再次)帮助了我
-
我不知道这个问题是否离题,但下面的答案也解决了我使用 Ubuntu Trusty Tahr 的问题。
-
应该将其移至 AskUbuntu 堆栈吗?这是一个与使用 R 或 RStudio 有关的问题(尽管它可能与其他软件一起出现?),这是由于 Ubuntu 中缺少所需的软件包造成的。根据我在右侧看到的“相关”列表,这似乎是一个很常见的问题。可以正确地问为什么 Ubuntu 缺少这些软件包?
-
@rickHenderson 它对其他 Linux 发行版也很有用。
标签: xml r ubuntu installation