MyNixOS website logo
Description

Linux Distribution Properties.

In order to provide unified access to Linux distribution details in R, this package wraps the various files and commands that may exist on a system. It is similar in spirit to the 'lsb_release' command and the 'Python' package of the same name.

distro

R build status

The goal of distro is to provide a standardized interface to version and other facts about the current system's Linux distribution. It is similar in spirit (though far more limited in scope) to the Python distro package.

Different Linux distributions and versions record version information in a number of different files and commands. The lsb_release command line utility standardizes some of the access to this information, but it is not guaranteed to be installed. This package draws from the various possible locations of version information and provides a single function for querying them.

Installation

To install distro from CRAN,

install.packages("distro")

You can install a development version with:

remotes::install_github("nealrichardson/distro")

Example

There is only one public function in the package:

distro::distro()

# $id
# [1] "ubuntu"
#
# $version
# [1] "16.04"
#
# $codename
# [1] "xenial"
#
# $short_version
# [1] "16.04"

Contributing

Does distro fail to produce the expected result on your system? We've tried to make it easy to extend the tests to accommodate new distributions and ways of expressing distribution information. That way, you can add information from your system to the tests as a way of setting up a minimum reproducible example.

  • If your system has lsb_release installed, see tests/test-lsb-release.R for how to record the results of the command with different flags.
  • If your system does not have lsb_release, you probably have an /etc/os-release file. Copy the contents of your /etc/os-release to the tests/os-release directory and we can set up a test using that.
  • If your system has neither of those but has an /etc/system-release file, see tests/test-system-release.R for how to provide the contents of that file in a test
  • If your system has none of these, please open an issue!
Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows