Werden wir Helden für einen Tag

Home | About | Archive

The oldest R version one can still run today

Posted on Jan 30, 2023 by Chung-hong Chan

Update: 2023-02-01 2023-02-02

This is a quick note about an experiment I did this afternoon. You might know that the oldest version of R that RStudio still supports is 3.0.0. For the Rocker project, the oldest r-ver image they still provide is 3.1.0.

So, it is still quite easy to run R even with the early minor versions in the 3.x series in 2023. But what’s the oldest version one can still run on a modern computer? Well, there is only one way to find out.

Docker and compiling R

It is not quite meaningful to install old version of R on my own Linux environment actually. I haven’t tried but probably I can’t even get some 3.x versions working. So, my safest bet is to use Docker. I have written about Docker for several time on this blog already so I won’t repeat. For this experiment, I used some Ubuntu and Debian images. And for your information, it is still comfortable to run Ubuntu 14.04 and Debian Stretch in 2023. One can still access the Deb repositories of 14.04 and Stretch. The LTS support for the two have long been ended. Ubuntu 14.04 will EOL next year. Debian Stretch reached already EOL last year (June 30, 2022) but the Deb repository is still accessible. So, I consider in this experiment these two are “the oldest” Docker images that I can still “use”. Older images are actually available, but it is not trivial do “apt-get” with them. I suspect that I can still make Debian Jessie (now the “oldoldoldstable” version) to work. But too lazy to dig any deeper.

The experiment was to set up a Docker container, download the source code of R with wget and then compile and install. I tested the 2.x series. I don’t even want to think about 1.x series, which the newest was 2004-06-21.

Compiling R from source is actually not as difficult as many sources have allegedly written. It boils down to a few steps on a DEB-based system.

## install the dependencies of R and wget, sudo if needed
apt-get update -qq && apt-get build-dep r-base-dev -y && apt-get install wget -y
wget https://cran.r-project.org/src/base/R-2/R-2.15.3.tar.gz
tar -xf R-2.15.3
cd R-2.15.3
./configure ; make
make install

Findings


This is the hottest feature of R 2.5.0

The oldest minor version I can still compile and install on Ubuntu 18.04 LTS is 2.11.0 (2009-10-26). Consider the fact that 2.11.0 was already 8 years old when 18.04 was released, it is actually pretty amazing. With 16.04 LTS, the oldest I can still compile is 2.7.0 (2008-04-22). But compiling 2.6.0 actually just limited by the fact that X is not available. If the above configuration step changes to ./configure --without-x, I can compile and install 2.6.0. In fact, the oldest version I can still compile is 2.5.0 (2007-04-24). I couldn’t go any older because I encountered this problem, which is too arcane for me to solve. And how deep Ubuntu 14.04 LTS and Debian Stretch can go are the same, i.e. 2.5.0. I can’t go any deeper 1.

So, it is pretty safe to say that the oldest version of R one can still compile and install comfortably today is 2.5.0 (2007-04-24) 2. Consider the fact that 14.04 will reach its EOL next year, the best version for compiling 2.5.0 in the near future is Ubuntu 16.04 LTS. We are still able to apt-get with 16.04 until April 2026. So, I hope the conclusion from this experiment will hold true until April 2026.

Dockerfile R 2.5.0

For any reason you want to try R 2.5.0, here is the Dockerfile.

FROM ubuntu:16.04
ENV TZ UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo $TZ > /etc/timezone \
	&& sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list \
	&& apt-get update -qq \
	&& apt-get build-dep r-base-dev -y \
	&& apt-get install wget locales -y

RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
	&& locale-gen en_US.utf8 \
	&& /usr/sbin/update-locale LANG=en_US.UTF-8

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8

RUN wget https://cran.r-project.org/src/base/R-2/R-2.5.0.tar.gz \
    && tar -xf R-2.5.0.tar.gz \
	&& cd R-2.5.0 \
	&& ./configure --without-x ; make \
	&& make install

CMD ["R"]

But can it run Crysis tidyverse?

No. The oldest version of tidyverse was released on 2016-09-09. ggplot2 is okay though.

Update

While I was sleeping, I always wondered: Can I go deeper?

The oldest Ubuntu image from the official source is Lucid (10.04). It is actually possible to make apt-get work by modifying the sources.list. Basically, the idea is to change the URIs from http://archive.ubuntu.com/ubuntu to http://old-releases.ubuntu.com/ubuntu.

Of course, all security experts would advise against running something like this. But I did it for science. And I didn’t put it on the Internet as one of those Internet of Shit outdated garbage.

So, with the still official Lucid, I still could not compile R 2.4.0. I think the underlying C libraries of 10.04 (LTS support stopped in April 2015), after apt-get update, are more or less the same as relative newer Ubuntu releases, e.g. 14.04.

In order to go deeper, the only way is to use an even older version of Linux. I was thinking about Virtual Box and install the ISO. But I still like the rapid turnaround of Docker. So, I went to the dark side and used some unofficial images. Against, copy and paste the above security experts’ advise here.

The oldest one can find is Dapper (6.06 LTS). And surprisingly, it works. And I can compile R 2.4.0 with it.


It's like defeating a monster

The next obvious question is: How deep can it go further? Again, there is only one way to find out. And with this ancient version of Ubuntu, the procedures are actually very consistent. The only difference is that wget is too old to probably do the https authentication. The error message actually told me what to do: wget --no-check-certificate.

And the oldest version I can still compile with Dapper is R 1.3.1 (2001-08-31) 3. The new monster version is R 1.3.0. I can actually make, but can’t make install R 1.3.0.

As you can see from this screenshot, sessionInfo() is not a function in R 1.3.1.

Dockerfile R 1.3.1

For any reason you want to try R 1.3.1, here is the Dockerfile.

FROM icomputer7/ancient-ubuntu-docker:dapper
ENV TZ UTC

COPY sources.list /etc/apt/sources.list

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt-get update -qq && apt-get build-dep r-base-dev -y && apt-get install wget locales -y

RUN echo "en_US.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local && dpkg-reconfigure locales

ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8

RUN wget https://cran.r-project.org/src/base/R-1/R-1.3.1.tgz  --no-check-certificate \
    && tar -xf R-1.3.1.tgz \
	&& cd R-1.3.1 \
	&& ./configure --without-x ; make \
	&& make install

CMD ["R"]

And actually, for it to work, you also need to have sources.list, as follow:

deb http://old-releases.ubuntu.com/ubuntu dapper main multiverse restricted universe
deb http://old-releases.ubuntu.com/ubuntu dapper-backports main multiverse restricted universe
deb http://old-releases.ubuntu.com/ubuntu dapper-proposed main multiverse restricted universe
deb http://old-releases.ubuntu.com/ubuntu dapper-security main multiverse restricted universe
deb http://old-releases.ubuntu.com/ubuntu dapper-updates main multiverse restricted universe
deb-src http://old-releases.ubuntu.com/ubuntu dapper main multiverse restricted universe
deb-src http://old-releases.ubuntu.com/ubuntu dapper-backports main multiverse restricted universe
deb-src http://old-releases.ubuntu.com/ubuntu dapper-proposed main multiverse restricted universe
deb-src http://old-releases.ubuntu.com/ubuntu dapper-security main multiverse restricted universe
deb-src http://old-releases.ubuntu.com/ubuntu dapper-updates main multiverse restricted universe

But can it run Crysis ggplot2?

No, it can’t. The oldest version of ggplot2 in existence was released on 2007-06-10. For the predecessor ggplot, the oldest was released on 2006-04-06. I tried to install ggplot from source (and I needed to resolve dependencies manually). reshape could be installed, but load failed. So, no ggplot.

In fact, the R News (now: R Journal) reported in June 2001 that “The number of packages on CRAN has grown over 100 recently”. A package that I know and I can make it work in R 1.3.1 is sna and calculated some Eigenvector Centrality…

Or writing some R code with the underscore operator.

And why one shouldn’t use snake case (back then).

Is it possible to go any deeper?

It is actually still possible. But it already reaches the point I don’t want to dig deeper anymore. Theoretically speaking, one way is not to use Docker and use virt-manager to install the oldest Ubuntu version available: 4.10. Veronica of “Veronica Explains” demos that it is possible. If I switch to Debian, the oldest ISO available is 2.0 (1998). And it almost reaches the oldest Linux distribution I have ever used: Red Hat 5.0 (1997, when I was 16). But I remember this video by NCommander…

Update 2

Dirk Eddelbuettel pointed me to this presentation by Roger Bivand. In the presentation, Roger Bivand used WINE to run the Windows version of R 1.0.0 (2000-02-29) on Linux.

Roger Bivand then pointed me to his another presentation, where R 0.49 (1997-04-23) is running on Fedora 27.

Update 3

The rcheology project suggests that R 1.0.1 can be compiled with Debian Woody (Debian 3.0), which Docker image is available.

Update 4

Following the information from rcheology, I can get R 1.3.0 compiled with Debian Woody. And then the oldest version that I can still compile is R 1.2.3 (2001-04-26).

The Dockerfile.

FROM debian/eol:woody
ENV TZ UTC

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && apt-get update -qq && apt-get install wget locales build-essential r-base-dev tclx8.3-dev tk8.3-dev xvfb xbase-clients x-window-system-core -y

RUN wget http://cran.r-project.org/src/base/R-1/R-1.2.3.tgz \
    && tar -zxf R-1.2.3.tgz \
    && cd R-1.2.3 \
    && ./configure --without-x ; make \
    && make install

CMD ["R"]

  1. I have tried 32 bit version of 16.04, the same. 

  2. For your info, we are still talking about GWB and Tony Blair in April 2007. Well, Merkel in Germany. 

  3. That was before the 9-11 attacks. 


Powered by Jekyll and profdr theme