#! /opt/R/arm64/bin/Rscript args <- commandArgs(TRUE) foo <- installed.packages(args[1])[, c("Package", "Version")] saveRDS(foo, args[2])