Nie można zainstalować pakietu R W Ubuntu 11.04 [zamknięty]

Jestem nowy w Linuksie i R.

Zainstalowałem R 2.12 w Ubuntu 11.04. Dzisiaj próbowałem zainstalować nowy pakiet, więc uruchomiłem następujące polecenie:

install.packages('XML')

Ale instalacja nie powiodła się i podała następujące informacje:

* 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

Ja też próbowałem:

sudo install.packages('XML')

Ale daje te same informacje o błędzie.

Ktoś może mi coś doradzić ? Z góry dzięki.
Author: csgillespie, 2011-10-14

2 answers

Instalacja.metoda pakietów

Musisz zainstalować pakiet ubuntu libxml2-dev więc w Shell prompt wpisz:

sudo apt-get update
sudo apt-get install libxml2-dev
Do tego będziesz potrzebował specjalnych mocy.

Metoda pakietów Ubuntu

Jak wspomnieli Richie i Dirk, możesz również użyć:

sudo apt-get install r-cran-xml

Jeśli pójdziesz tą ścieżką, polecam zajrzeć na stronę r Ubuntu sources , która zapewni, że masz aktualną wersję R i powiązane Pakiety r. To może to być ważne, jeśli używasz wersji LTS ubuntu.

 179
Author: csgillespie,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-10-14 15:24:04

Odpowiedź Colina jest poprawna w wąskim znaczeniu, ale jednocześnie błędna, jak można po prostu powiedzieć

 sudo apt-get install r-cran-xml

As XML jest jednym z pakietów CRAN dostępnych w Ubuntu. Do apt-cache search r-cran-* Zobacz innych.

 27
Author: Dirk Eddelbuettel,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-10-14 14:20:22