Is there any way to automatically update R on Mac OS X to the latest patched version (R-Patched) on a daily basis or some predetermined intervals?
My impression is that compiling from source is the most (only?) reliable way to get the most recent patched version, but I could be wrong about this. A simple shell script to download the latest patched version and recompile would be:
curl -o /tmp/R-patched.tar.gz ftp://ftp.stat.math.ethz.ch/Software/R/R-patched.tar.gz
tar xzvf /tmp/R-patched.tar.gz
cd /tmp/R-patched
./configure
make
cp bin/R <old_R_binary_location>
You could then use crontab to run this at regular intervals. I don't find the crontab man page to be very helpful, so I always end up referring back to guides such as this one.
I have a bash script that installs the daily patched build from http://r.research.att.com. Installed libraries remain untouched, except for those in core.
I update manually, but you could set up a cron job as #bnaul suggests. I'm not sure how it will handle the need for sudo'ing, however. You might have to move your R out of /Library/Frameworks and then change the script accordingly.
#!/bin/bash
curl -s http://r.research.att.com/R-2.13-branch-leopard-universal.tar.gz | sudo tar fvxz - -C /
Related
As sometime I am trying to compile a full version (with all options) of rsync on MacOS (please, do not ask why I want to do it - if you can help me clear and directly, thank you so much. Otherwise, do not waste your time).
I found a really helpful script made by "junsionzhang" (https://gist.github.com/junsionzhang), which in my option is simple and direct. Thank you junsionzhang!
Even being a good script, clear, step-by-step, there are some steps that does not work for me (and I tried a lot and for a while).
Here is the script (at Oct, 16, 2022):
#Compile rsync 3.0.7
#Follow these instructions in Terminal on both the client and server to download and compile rsync 3.0.7:
#Download and unarchive rsync and its patches
cd ~/Desktop
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.1.2.tar.gz
tar -xzvf rsync-3.1.2.tar.gz
rm rsync-3.1.2.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.1.2.tar.gz
tar -xzvf rsync-patches-3.1.2.tar.gz
rm rsync-patches-3.1.2.tar.gz
cd rsync-3.1.2
#Apply patches relevant to preserving Mac OS X metadata
patch -p1 <patches/fileflags.diff
patch -p1 <patches/crtimes.diff
patch -p1 <patches/hfs-compression.diff
#Configure, make, install
./prepare-source
./configure
make
sudo make install
#Verify your installation
/usr/local/bin/rsync --version
#By default, rsync will be installed in /usr/local/bin.
#If that isn't in your path, you will need to call your new version of rsync by its absolute path (/usr/local/bin/rsync).
The three patches lines does not work for me. After patching the fileflags, the rsync patched can not me "prepared", and of course, not be configured. The others, crtimes.diff and hfs-compression.diff, does not exist on the TAR package.
So, questions:
Trying to compile the 3.2.6 version os MacOS Big Sur (11.7), what do I need and which is the right/correct way and steps to patch, update and have the "correct"version?
How do I (correctly) compile and install the all the libraries to have a real full rsync version, with all features available (ACL support, Xattr support, xxhash, zstd, lz4, openssl crypto, and so on...)?
I would like to update and contribute to a new "junsionzhang" script version, making options to install a simple/standard version (rsync only) and options to install the libraries and choose for a "more complete" version, and help another Mac users and the community. How can I make this bash script?
How to install gawk, mawk, nawk, awk ( and where from (what are the differences): gawk, mawk, nawk?
Some libraries I already have installed (which I do not know if I did them right) seems to be outdated. How to I update them?
When running "./prepare-source", i get this: "make: Nothing to be done for `conf'.". Does this is right?
Thank you all! I really appreciate for all help I can get!
Completely untested (I don't run MacOS).
URLs to access the source code:
Source Version Tarballs: https://rsync.samba.org/ftp/rsync/src/
Git repository: https://github.com/WayneD/rsync
might need these pre-requisites (from INSTALL.md):
brew install automake
brew install xxhash
brew install zstd
brew install lz4
brew install openssl
code to download and extract (to ~/Desktop/rsync-3.2.6):
# Download the relevant version of Rsync and the same version of
# Rsync patches, extract them and apply the "suggested"
# patches from the original script:
cd ~/Desktop
# Rsync
curl -O https://rsync.samba.org/ftp/rsync/src/rsync-3.2.6.tar.gz
tar -xzvf rsync-3.2.6.tar.gz
rm rsync-3.2.6.tar.gz
# Patches
curl -O https://rsync.samba.org/ftp/rsync/src/rsync-patches-3.2.6.tar.gz
tar -xzvf rsync-patches-3.2.6.tar.gz
rm rsync-patches-3.2.6.tar.gz
apply the "suggested" patches, light the blue touch paper and stand back:
cd ~/Desktop/rsync-3.2.6
# Apply patches relevant to preserving Mac OS X metadata
patch -p1 <patches/fileflags.diff
patch -p1 <patches/crtimes.diff
patch -p1 <patches/hfs-compression.diff
# Configure, make, install
./prepare-source
./configure
make
sudo make install
# Verify your installation
/usr/local/bin/rsync --version
I am trying to create a completely portable version of R for Mac that I can send to users with no R on their system and they can essentially double click a command file and it launches a Shiny application. I'll need to be able to install packages including some built from source (and some from GitHub).
I am using the script from this GitHub repository (https://github.com/dirkschumacher/r-shiny-electron/blob/master/get-r-mac.sh) as a starting point (it's also pasted below), creating a version of R, but (A) I find that when I try to launch R it gives me an error not finding etc/ldpaths and (B) when I try to launch Rscript it runs my system version -- I run `Rscript -e 'print(R.version)' and it prints out 4.0 which is my system version of R rather than the version 3.5.1 which the shell script has downloaded and processed.
I've experimented with editing the "R" executable and altering R_HOME and R_HOME_DIR but it still runs into issues when I try to install packages to the 3.5.1 directory.
Can anyone provide some guidance?
(By the way docker is not an option, this needs to be as simple as possible end-users with limited technical skills. So having them install docker etc won't be an option)
#!/usr/bin/env bash
set -e
# Download and extract the main Mac Resources directory
# Requires xar and cpio, both installed in the Dockerfile
mkdir -p r-mac
curl -o r-mac/latest_r.pkg \
https://cloud.r-project.org/bin/macosx/R-3.5.1.pkg
cd r-mac
xar -xf latest_r.pkg
rm -r r-1.pkg Resources tcltk8.pkg texinfo5.pkg Distribution latest_r.pkg
cat r.pkg/Payload | gunzip -dc | cpio -i
mv R.framework/Versions/Current/Resources/* .
rm -r r.pkg R.framework
# Patch the main R script
sed -i.bak '/^R_HOME_DIR=/d' bin/R
sed -i.bak 's;/Library/Frameworks/R.framework/Resources;${R_HOME};g' \
bin/R
chmod +x bin/R
rm -f bin/R.bak
# Remove unneccessary files TODO: What else
rm -r doc tests
rm -r lib/*.dSYM
Happy to help you get this working for your shiny app. You can use this github repo for Electron wrapping R/Shiny... just clone, and replace the app.R (for your other packages you need to install them in the local R folder after cloning and then running R from the command line out of the R-Portable-Mac/bin folder...
Try it with the Hello World app.R that is included first
https://github.com/ColumbusCollaboratory/electron-quick-start
And, then installing your packages in the local R-Portable-Mac folder runtime. Included packages by default...
https://github.com/ColumbusCollaboratory/electron-quick-start/tree/master/R-Portable-Mac/library
Your packages will show up here after install.packages() from the command line using the local R-Mac-Portable runtime.
We have been working on a R Addin for this also...
https://github.com/ColumbusCollaboratory/photon
But, note the add-in is still a work in progress and doesn't work with compiled R packages; still have to go into the local R folder and runtime on the command line and install the packages directly into the local R folder libpath as discussed above.
Give it a try and let us know through Github issues if you have any questions and issues. And, if you've already posted out there, sorry we haven't responded as of yet. Would love to communicate through the photon Add-In for this to get it working with compiling packages (into the libPath)--if you have the time to help. Thanks!
I've followed the instructions to install the stable branch of Virtuoso Open Source 7 on Ubuntu 16.04. There don't appear to be any errors throughout the process of —
./autogen.sh
CFLAGS="-O2 -m64"
export CFLAGS
./configure
make
make install
However, when I go to /usr/local/virtuoso-opensource/var/lib/virtuoso/db (which contains only virtuoso.ini) and run —
virtuoso-t -f &
The first time I do this the terminal just vanishes. When I reopen the terminal and run the same again it just reads The program 'virtuoso-t' is currently not installed. You can install it by typing: apt install virtuoso-opensource-6.1-bin.
I've tried installing both 7 stable and develop from github and both produce the same result. I'd rather use 7 but tried installing 6 via the ubuntu package and conductor wouldn't work for me - not having much luck all round, one of those days.
Thanks for assistance you can provide.
Sounds like you didn't adjust your $PATH variable after make install.
$PATH should include the path to the directory which contains the virtuoso-t, or you can include that path in the launch command, e.g. —
/path/to/virtuoso-t -f -c /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini &
(Note that the develop/7 branch is recommended over stable/7 at the moment, due to the number of fixes there.)
I have a package that previously only targeted RPM based distros for which I am now building .deb packages for Debian based distros.
The aim is to simulate a test installation from user-space that is isolated from the system you are building on. It may be multi-user and you do not want to require root access just to build the software. Many of our tests simulate the installation directory structure already. This is for the next step up to simulate an actual installation using packages built.
For the RPM packages I was able to create test installations using:
WSDIR=/where/I/want/my/tests/to/run
rpmdb --initdb --dbpath "$WSDIR"/rpmdb
rpm --relocate /opt="$WSDIR"/opt --dbpath $WSDIR/rpmdb -i <package>.rpm
The equivalent in the Debian world is something like:
dpkg --force-not-root --admindir=$WSDIR/dpkg --root=$WSDIR/install --install "$DEB"
However, I am stuck over the equivalent to the rpmdb --initdb step.
Note that I can just unpack the archive using:
dpkg-deb -x "$DEB" $WSDIR/install
But I would prefer to be closer to how a real package is installed.
Also I don't think this will run preinstall and postinstall scripts.
Similar questions have suggested using deboostrap to create a chroot environment but this creates a complete new installation. As well as being overkill it is too slow for an automated test. I intend to use this for quick tests of the installation package prior to further testing in actual test environments.
My experiments so far:
(cd $WSDIR/dpkg && mkdir alternatives info parts triggers updates)
cp /var/lib/dpkg/status $WSDIR/dpkg/status
have at best resulted in:
dpkg: error: unable to access dpkg status area: No such file or directory
which does not indicate clear what is wrong.
So how do you create a dpkg admin directory?
Cross posted as https://superuser.com/questions/1271145/how-do-you-create-a-dpkg-admin-directory
Update 24/11/2017
I've tried copying using the dpkg dir from an environment created by [cowdancer][1] (which uses deboostrap under the hood) or copying the real one from /var/lib/dpkg but I still get the same error message so perhaps the error (and/or the --admindir option) doesn't mean quite what I think it means.
Note that:
sudo dpkg --force-not-root --root=$WSDIR/install --admindir=/var/lib/dpkg --install "$DEB"
does work. So it is something to do with the admin dir.
I've also retitled the question as "How do you create a dpkg admin directory" is interesting question but the answer is not necessarily the solution to my problem.
The minimal way to create a dpkg database is something like this:
$ mkdir -p db/{updates,info}
$ touch db/{status,diversions,statoverride}
If you want to use that as non-root, currently the best way is to use fakeroot.
$ mkdir -p fsys
$ PATH=/sbin:/usr/sbin:$PATH fakeroot dpkg --log=/dev/null --admindir=db --instdir=fsys -i pkg.deb
But take into account that passing --root after --admindir or --instdir will reset those paths, which is I think the problem you have been having here.
Also using sudo and --force-not-root does not make much sense? :) And is definitely less confined than using just fakeroot. In the near future it will be possible to run dpkg fully unprivileged in some local tree.
I eventually found an answer for this. Thanks to Guillem Jover for some of this.
Pasting a copy of it here:
mkdir fake
mkdir fake/install
mkdir -p fake/dpkg/info
mkdir -p fake/dpkg/updates
touch fake/dpkg/status
PATH=/sbin:/usr/sbin:$PATH fakeroot dpkg --force-script-chrootless --log=`pwd`/fake/dpkg.log --root=`pwd`/fake --instdir `pwd`/fake --admindir=`pwd`/fake/dpkg --install *.deb
Some points to note:
--force-not-root is not enough. fakeroot is required.
ldconfig and start-stop-daemon must be on the path.
(hence PATH=/sbin:/usr/sbin:$PATH)
The log file needs to be relocated from the default /var/log/dpkg.log
The order of arguments is significant. If used --root must be before --instdir and --admindir.
The admindir is supposed to have a the installation dir as a prefix.
If the package contains any pre or post installation scripts (preinst,postinst) then --force-script-chrootless is required as these scripts are normally run via chroot() which gives operation not permitted when attempted under fakeroot.
For a quick test of trivial dependencies, you can directly install on the system using 'dpkg -i' then 'dpkg -P' and 'apt-get autoremove' to purge the package and clean the dependencies.
An other more secure but slower solution could be to use the autopkgtest package:
https://people.debian.org/~mpitt/autopkgtest/README.package-tests.html
I am trying to automate an Aerospike database installation using saltstack version 2015.5.2 on an Ubuntu machine.
The following is the process of manual installation that I want to automate. (I'll only mention the key steps to keep it simple)
Download Aerospike
wget -O aerospike.tgz
http://aerospike.com/download/server/latest/artifact/ubuntu12
extract the contents of the package
tar -xvf aerospike.tgz
Install Aerospike Server & Tools
cd aerospike-server-community-3.5.15-ubuntu12.04
./asinstall
Start Aerospike
/etc/init.d/aerospike start
Step 3 performs the actual installation which includes installation of 2 packages: aerospike-server-community and aerospike-tools.
Now in the saltstack state file I want to check if both the packages are already present on server, and in that case do not execute the ./asinstall command in step 3.
How can I involve that condition in my automated process?
I recommend you read requisites in salt before going on because you can find many interesting things there.
Furthermore,what you really need, in my opinion is: UNLESS, because if you already have these packages on your system they should not be installed. Unless can be used together with the pkg keyword, but for you the rpm -q package_name might work just as well.
It should look something like this:
start_process:
cmd.run:
- name: 'write here your command'
- unless:
- rpm -q package1,package2
I would like to provide a small comment to the answer, but my reputation does not allow me, so I apologize in advance for this.
This line:
- rpm -q package1,package2
Should actually be:
- rpm -q package1 package2