Linux cache fails when installing library for R - gdal - r

I run R Studio Server in a Redhat Linux virtual machine. I am trying to install the rgdal library in R with no success, and after reading many posts here on SO the proper fix to this issue is to install the following software on Linux:
yum install gdal-devel
yum install proj-devel
yum install proj-nad
yum install proj-epsg
but when I tried to do this I get the following error:
Loaded plugins: langpacks, rhnplugin
This system is receiving updates from Spacewalk server.
https://packages.microsoft.com/rhel/7/prod/repodata/repomd.xml: [Errno 14] curl#35 - "Encountered end of file"
Trying other mirror.
addons7 | 1.1 kB 00:00:00
base_7.4 | 1.3 kB 00:00:00
cliente7 | 871 B 00:00:00
epel_7 | 1.3 kB 00:00:00
latest7 | 1.3 kB 00:00:00
mysql7_57 | 871 B 00:00:00
remi7_55 | 871 B 00:00:00
remi7_56 | 871 B 00:00:00
remi7_safe | 871 B 00:00:00
softwarecollections7 | 1.1 kB 00:00:00
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
failed to retrieve repodata/primary.xml.gz from softwarecollections7
error was [Errno 14] curl#18 - "transfer closed with 954471 bytes remaining to read"
How can I resolve this? For instance, there is a suggestion of disabling the repo, but I don't know what I have to put in the "..." portion.

Related

how to install OpenStack on Ubuntu in 2022

On youtube there are many guides that show how to install openstack on ubuntu I have tried them and they seem not to work
For example with Devstack I fail every time the installation with .Stack.sh, with MicroStack I fail the initialization
I can't install OpenStack in any way!
could somebody help me?
I have installed openstack from various different ways but for me installing through Devstack is the easiest and the most convenient way to do it.
Let me share the installation steps that I use:
Firstly few prerequisites:
A fresh Ubuntu 20.04 installation (Ubuntu 18.04 Works)
8 GB RAM (4 GB RAM works)
4 vCPUs (2 vCPUs works)
Hard disk capacity of 20 GB (min 10 GB)
Step 1 : apt update -y && apt upgrade -y
Step 2: Create Stack user:
sudo adduser -s /bin/bash -d /opt/stack -m stack
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
su - stack
Step 3:
git clone https://git.openstack.org/openstack-dev/devstack
cd devstack
Step 4: Create devstack configuration file
vim local.conf
Paste this:
[[local|localrc]]
# Password for KeyStone, Database, RabbitMQ and Service
ADMIN_PASSWORD=admin
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
# Host IP - get your Server/VM IP address from ip addr command
HOST_IP=0.0.0.0
Step 5: ./stack.sh
The setup will take about 10-15 minutes depending upon your system. Once installation is complete you can access the dashboard using https://your-ip/dashboard
Note: Incase the stack.sh fails make sure to use ./unstack and ./clean.sh before you use stack.sh again.

Amazon linux install openvpn3-client

Trying to install openvpn3-client on my amazon Linux followed this documentation, facing below error
Packages skipped because of dependency problems:
openvpn3-13-0.beta1.el7.x86_64 from copr:copr.fedorainfracloud.org:dsommers:openvpn3
openvpn3-client-13-0.beta1.el7.x86_64 from copr:copr.fedorainfracloud.org:dsommers:openvpn3
openvpn3-selinux-13-0.beta1.el7.noarch from copr:copr.fedorainfracloud.org:dsommers:openvpn3
python36-dbus-1.2.4-4.el7.x86_64 from epel
python36-gobject-base-3.22.0-6.el7.x86_64 from epel
I have already installed epel following this
Amazon linux install openvpn3-client & dependencies as per
https://github.com/OpenVPN/openvpn3-linux
See the instructions on
https://community.openvpn.net/openvpn/wiki/OpenVPN3Linux how to
install pre-built OpenVPN 3 Linux packages on Debian, Ubuntu, Fedora,
Red Hat Enterprise Linux, CentOS and Scientific Linux.
1 solution was to switch from AWS Linux (lack of dependencies & updates) to Fedora on AWS. No longer have to build from source / add dependancices,
older versions had to add the repo as per the above.
When I did an upgrade to Fedora 36 the latest openvpn3-linux v18 client was built in. Did not have to manually upgrade / install it:
openvpn3-admin version --services
e.g: previous v17 suddenly stopped working spend 10 hours trying to debug
"Trying to install openvpn3-client" and reinstall:
openvpn3 config-import --config profile.udp.ovpn --persistent
openvpn3 config-manage --config profile.udp.ovpn --enable-legacy-algorithms true --show
openvpn3 session-start --config profile.udp.ovpn
openvpn3 sessions-list
openvpn3 session-manage --config profile.udp.ovpn --disconnect
Actually thinking it was a cipher AES-256-CBC legacy issue that others were having. It was not for some reason, permissions on install of the OpenVPN3 Linux client? as it was NOT creating a TUN.
So I made one myself (that was the actual issue) and it connected after asking for VPN Username & Password, no need to install again / reinstall afterall:
sudo ip tuntap add name tun0 mode tun
sudo ip link show
Other Amazon linux install openvpn3-client issues help is here: https://github.com/OpenVPN/openvpn3-linux/issues?q=cipher

RCurl and Curl giving different version of Curl on R (ubuntu)

I am trying to use the Curl and RCurl packages to connect to an sftp server to download/upload files. I have managed to get it to work using RCurl, but for some reason Curl won't work returning errors such as:
> curl_upload("test.png", "sftp://usr:pwd#sftp.xx.xx:22/test.png")
* Protocol "sftp" not supported or disabled in libcurl
* Closing connection -1
Error in curl_fetch_memory(url, handle = h) :
Protocol "sftp" not supported or disabled in libcurl
However if I use RCurl it works:
ftpUpload(what = "test.png",
to = "sftp://usr:pwd#sftp.xx.xx:22:22/test.png")
OK
0
If I try RCurl::curlVersion() I get version 7.74.0 and support for sftp, but if I run curl::curl_version() I get version 7.58.0 and no support for sftp.
I suspect I have two installations of curl but cannot figure out how to fix it. Any help appreciated!
Ideally I need to get one package working on both windows and ubuntu as the code will be used across platforms. Haven't figured out how to use RCurl to access the sftp on Windows hence trying to get Curl to work on Ubuntu.
Update
I still cannot figure it out. I uninstalled RCurl and Curl packages and reinstalled from source and now both show
$version
[1] "7.58.0"
As #Dirk Eddelbuettel says this is because libcurl-*-dev is an older version. Will be very grategul if anyone has any suggestions on how to install an updated libcurl-*-dev.
Solved
Details below. Thanks to Dirk for the pointers.
Welcome to StackOverflow. Your question left out a few important details:
First: which version of Ubuntu are you running? This matters because different versions of Ubuntu will have different R versions even though it can then still matter (read on).
Second: how do you typically install your CRAN packages? Ubuntu has (depending on the version you run, newer ones have more) between several hundred to almost one-thousand r-cran-* packages that come pre-made. And the date of their compilation will likely determine which libcurl version was used.
Third: Do you use the Rutter PPAs? That is a corollary to the previous question. You can get about 5000 more r-cran-* packages thanks to Michael's work. See the README for more.
Fourth: If it matters, you can always install from source ensuring a common libcurl. You can of course always re-install a package from CRAN directly forcing the use of the libcurl-*-dev you currently have.
Example:
$ Rscript -e 'print(c(RCurl::curlVersion()$version,
+ curl::curl_version()$version))'
[1] "7.68.0" "7.68.0"
$
on this machine where I tend to always install from source, and they apparently both updated the same day (when I updated to R 4.0.*, likely):
$ ls -ld /usr/local/lib/R/site-library/{RCurl,curl}
drwxrwxr-x 8 edd staff 4096 Apr 26 2020 /usr/local/lib/R/site-library/curl
drwxrwxr-x 14 edd staff 4096 Apr 26 2020 /usr/local/lib/R/site-library/RCurl
$
Finally got it. Thanks to Dirk and others. I followed the instructions here: https://askubuntu.com/questions/995815/curl-not-accepting-sftp with some additional steps from here: sftp protocol with RCurl - last step, how to change R path to libcurl from usr/lib to usr/local/lib
cd /tmp
wget https://curl.se/download/curl-7.74.0.tar.gz
tar -xzf curl-7.74.0.tar.gz
cd curl-7.74.0
sudo apt install --reinstall libcurl4-openssl-dev
CPPFLAGS=-I/usr/local/include
LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
LIBS="-ldl"
./configure --disable-shared --with-libssh2
make
sudo make install
After this, curl -V should show the latest version with sftp included.
Then I copied all of the new libs from /usr/local/lib to /lib:
cp /usr/local/lib/lib* /lib
Then in R:
remove.packages(c("RCurl", "curl"))
install.packages("RCurl", type = "source")
install.packages("curl", type = "source")
I had to do the above a couple of times after restarting the R session, but in the end it worked.
curl::curl_version()$version
[1] "7.74.0"
curl::curl_version()$protocols
[1] "dict" "file" "ftp" "ftps" "gopher" "http" "https" "imap" "imaps" "ldap" "ldaps" "mqtt" "pop3"
[14] "pop3s" "rtmp" "rtsp" "scp" "sftp" "smb" "smbs" "smtp" "smtps" "telnet" "tftp"

OpenVAS installation and running errors

I've installed Greenbone Security Assistant Version 9.0.1 (OpenVAS) by this instruction on my VirtualBox's Ubuntu 20.4.
sudo apt install postgresql
sudo add-apt-repository ppa:mrazavi/gvm
sudo apt install gvm
greenbone-nvt-sync
sudo greenbone-scapdata-sync
sudo greenbone-certdata-sync
Unfortunately, it does not works.
When I'm trying to create a task by Wizard, I have the task completed just in moment, with an empty log. And that's all.
I've tried three commands:
systemctl status ospd-openvas # scanner
systemctl status gvmd # manager
systemctl status gsad # web ui
Everything is okay, except ospd-openvas. The status is green and active, but there are some errors too:
Jul 20 15:00:27 alex-VirtualBox ospd-openvas[833]: OSPD - openvas:
ERROR: (ospd_openvas.daemon) Failed to create feed lock file
/var/run/ospd/feed-update.lock. [Errno 2] No such file or directory:
'/var/run/ospd/feed-update.lock'
From the error message it looks like the directory /var/run/ospd/ does not exist.
Create the directory and try to restart the service.
In ubuntu 20.04 /var/run points to /run which is a temporary file system. That means that if you create the directory /var/run/ospd manually, it will be gone after the next reboot. To fix it permanently (in case the missing directory is the issue), please refer to this post.
This may help some people with some of the issues I've been facing:
mkdir -p /var/run/ospd/
touch /var/run/ospd/feed-update.lock
chown gvm:gvm /var/run/ospd/feed-update.lock

Homebrew: lack permissions when installing

I'm trying to write my first formula, for the Rserve package in R: https://www.rforge.net/Rserve/ .
So far I have this:
# Documentation: https://docs.brew.sh/Formula-Cookbook
# https://www.rubydoc.info/github/Homebrew/brew/master/Formula
class Rserve < Formula
desc "Rserve acts as a socket server (TCP/IP or local sockets) which allows binary requests to be sent to R."
homepage "http://www.rforge.net/Rserve/"
url "https://cran.r-project.org/src/contrib/Rserve_1.7-3.tar.gz"
sha256 "f6d636c736c3f16487d9987e54554fe0c55257b9bc0671b43e536d832e513027"
depends_on "r"
depends_on "gettext"
def install
system("whoami")
system("#{HOMEBREW_PREFIX}/bin/R CMD install --configure-args=\"CPPFLAGS=-L#{HOMEBREW_PREFIX}/opt/gettext/lib LDFLAGS=-I#{HOMEBREW_PREFIX}/opt/gettext/include\" .")
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! For Homebrew/homebrew-core
# this will need to be a test that verifies the functionality of the
# software. Run the test with `brew test Rserve`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system "false"
end
end
The error I get is:
==> Downloading https://cran.r-project.org/src/contrib/Rserve_1.7-3.tar.gz
Already downloaded: /Users/kwilliams/Library/Caches/Homebrew/downloads/690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz
==> Verifying 690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz checksum
tar xf /Users/kwilliams/Library/Caches/Homebrew/downloads/690e0934dcba3770ba80b743f7b2c9cee0250434ed17cc7949bc1eee74d5b170--Rserve_1.7-3.tar.gz -C /private/tmp/d20190114-99089-11isfza
cp -pR /private/tmp/d20190114-99089-11isfza/Rserve/. /private/tmp/rserve-20190114-99089-b57ji6/Rserve
chmod -Rf +w /private/tmp/d20190114-99089-11isfza
==> whoami
kwilliams
==> /usr/local/bin/R CMD install --configure-args="CPPFLAGS=-L/usr/local/opt/gettext/lib LDFLAGS=-I/usr/local/opt/gettext/include" .
* installing to library ‘/usr/local/lib/R/3.5/site-library’
Error: ERROR: no permission to install to directory ‘/usr/local/lib/R/3.5/site-library’
==> Formula
Path: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/rserve.rb
==> Configuration
HOMEBREW_VERSION: 1.9.2-5-g44f4f36
ORIGIN: https://github.com/Homebrew/brew
HEAD: 44f4f36c0db693000410fe664b250a90325f4e32
Last commit: 4 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: de1ecc1d981de9d5165ea9e96242c32023d14d7c
Core tap last commit: 4 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION: 1
HOMEBREW_LOGS: /Users/kwilliams/Library/Logs/Homebrew
CPU: octa-core 64-bit kabylake
Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 11.0.1, 1.8.0_192
macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1
XQuartz: 2.7.11 => /opt/X11
The permissions on /usr/local/lib/R/3.5/site-library should allow me to install there, though:
% ls -al /usr/local/lib/R/3.5/site-library
total 0
drwxr-xr-x 2 kwilliams admin 64 Jan 14 13:38 ./
drwxr-xr-x 3 kwilliams admin 96 Jan 14 13:38 ../
If I put myself in a directory where the Rserve tarball has been freshly expanded, then manually run the command /usr/local/bin/R CMD install --configure-args="CPPFLAGS=-L/usr/local/opt/gettext/lib LDFLAGS=-I/usr/local/opt/gettext/include" ., I don't get the error about "no permission to install to directory".
What's different about the environment that Homebrew is running that command, compared to me running it in a shell, that causes it to fail when run automatically?
My brew doctor output is clean, except for a warning that my docker keg is unlinked, which I assume is unrelated.
Figured it out - there's a sandbox (sandbox-exec, I think) in place that restricts writing to the filesystem outside the prefix directory:
https://discourse.brew.sh/t/potential-permission-issues-in-a-formula-im-writing/3707
I'll need to figure out the correct way to write files to /usr/local/lib/R/3.5/site-library, or symlink them to there from the Cellar directory, or whatever it is.

Resources