CentOS 7 安装 R 包报错,解决缺少 libcurl openssl libxml2

3 篇文章 0 订阅

由于在服务器上新装 CentOS7 系统,缺少一些 lib,因此在安装一些 R 包的时候 出现一系列报错。安装 R 包时最重要的报错信息在第一条,缺啥包会提示地很清晰。

比如本人在安装 tidyverse 的时候

install.packages("tidyverse", INSTALL_opts = c('--no-lock'))

出现以下报错:

缺少 libcurl

Package libcurl was not found in the pkg-config search path. Perhaps
you should add the directory containing `libcurl.pc’ to the
PKG_CONFIG_PATH environment variable No package ‘libcurl’ found

这说明本机没有 curl 和相关开发工具,因此用以下命令进行安装
在官网( https://curl.haxx.se/download.html )找到最新 curl 的版本和下载地址

wget -c https://curl.haxx.se/download/curl-7.65.0.tar.gz
tar  -zxf  curl-7.65.0.tar.gz
cd curl-7.65.0
./configure
make
sudo make install
sudo yum install libcurl-devel

缺少 openssl

ERROR: configuration failed for package ‘openssl’

此报错说明缺少 openssl 依赖,使用以下命令解决

yum install openssl
yum install openssl-devel

缺少 libxml-2.0

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

此报错说明缺少 libxml2 依赖,使用以下命令解决

yum install libxml2
yum install libxml2-devel
  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是在 CentOS 7 上编译安装 PHP 7.4 的步骤: 1. 安装依赖项 ```bash sudo yum update sudo yum install -y epel-release sudo yum install -y gcc gcc-c++ make autoconf automake libtool \ bison re2c libxml2-devel openssl-devel bzip2-devel \ libcurl-devel libpng-devel libjpeg-devel libwebp-devel \ libxpm-devel freetype-devel gmp-devel libmcrypt-devel \ openldap-devel libtidy-devel libxslt-devel ``` 2. 下载 PHP 7.4 ```bash wget https://www.php.net/distributions/php-7.4.24.tar.gz ``` 3. 解压缩文件 ```bash tar -zxvf php-7.4.24.tar.gz cd php-7.4.24 ``` 4. 配置编译选项 ```bash ./configure --prefix=/usr/local/php-7.4 \ --with-config-file-path=/usr/local/php-7.4/etc \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-mysqli \ --with-pdo-mysql \ --with-iconv-dir \ --with-freetype \ --with-jpeg \ --with-png \ --with-webp \ --with-xpm \ --with-zlib \ --with-libxml-dir \ --with-gd \ --with-openssl \ --with-mhash \ --with-xmlrpc \ --with-curl \ --with-imap-ssl \ --with-ldap \ --with-ldap-sasl \ --with-mcrypt \ --with-readline \ --with-tidy \ --with-xmlrpc \ --with-xsl \ --enable-bcmath \ --enable-calendar \ --enable-exif \ --enable-ftp \ --enable-gd-jis-conv \ --enable-gd-native-ttf \ --enable-inline-optimization \ --enable-intl \ --enable-mbstring \ --enable-opcache \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-wddx \ --enable-zip \ --enable-mysqlnd \ --enable-shared \ --enable-static \ --disable-debug ``` 5. 编译安装 ```bash make sudo make install ``` 6. 配置 PHP ```bash sudo cp php.ini-production /usr/local/php-7.4/etc/php.ini sudo cp /usr/local/php-7.4/etc/php-fpm.conf.default /usr/local/php-7.4/etc/php-fpm.conf sudo cp sapi/fpm/php-fpm.service /etc/systemd/system/ sudo systemctl enable php-fpm.service sudo systemctl start php-fpm.service ``` 现在,PHP 7.4 应该已经成功安装并运行在你的 CentOS 7 系统上了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值