{"id":14067328,"url":"https://github.com/cran4linux/bspm","last_synced_at":"2026-01-29T20:04:39.663Z","repository":{"id":43772206,"uuid":"277500964","full_name":"cran4linux/bspm","owner":"cran4linux","description":"R Bridge to System Package Manager","archived":false,"fork":false,"pushed_at":"2024-10-08T11:44:36.000Z","size":5854,"stargazers_count":85,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-09T11:51:26.723Z","etag":null,"topics":["automation","linux","packages","r"],"latest_commit_sha":null,"homepage":"https://cran4linux.github.io/bspm","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cran4linux.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Enchufa2"}},"created_at":"2020-07-06T09:37:22.000Z","updated_at":"2025-12-06T06:44:35.000Z","dependencies_parsed_at":"2023-08-25T18:18:35.433Z","dependency_job_id":"6b2a02ab-b6a6-41ef-aaa7-ac41f3911418","html_url":"https://github.com/cran4linux/bspm","commit_stats":{"total_commits":114,"total_committers":2,"mean_commits":57.0,"dds":0.01754385964912286,"last_synced_commit":"96a06170b9f2da1be0c0a6b03c7cc89f5de667aa"},"previous_names":["cran4linux/bspm","enchufa2/bspm"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/cran4linux/bspm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cran4linux%2Fbspm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cran4linux%2Fbspm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cran4linux%2Fbspm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cran4linux%2Fbspm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cran4linux","download_url":"https://codeload.github.com/cran4linux/bspm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cran4linux%2Fbspm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","linux","packages","r"],"created_at":"2024-08-13T07:05:32.578Z","updated_at":"2026-01-29T20:04:39.639Z","avatar_url":"https://github.com/cran4linux.png","language":"R","funding_links":["https://github.com/sponsors/Enchufa2"],"categories":["R"],"sub_categories":[],"readme":"# bspm: Bridge to System Package Manager\n\n\u003c!-- badges: start --\u003e\n[![Build Status](https://github.com/cran4linux/bspm/workflows/build/badge.svg)](https://github.com/cran4linux/bspm/actions)\n[![Coverage Status](https://codecov.io/gh/cran4linux/bspm/branch/master/graph/badge.svg)](https://app.codecov.io/gh/cran4linux/bspm)\n[![CRAN\\_Status\\_Badge](https://www.r-pkg.org/badges/version/bspm)](https://cran.r-project.org/package=bspm)\n[![Downloads](https://cranlogs.r-pkg.org/badges/bspm)](https://cran.r-project.org/package=bspm)\n\u003c!-- badges: end --\u003e\n\nEnables binary package installations on Linux distributions.\nProvides functions to manage packages via the distribution's package\nmanager. Also provides transparent integration with R's install.packages()\nand a fallback mechanism. When installed as a system package, interacts\nwith the system's package manager without requiring administrative\nprivileges via an integrated D-Bus service; otherwise, uses sudo.\nCurrently, the following backends are supported: DNF, APT, ALPM.\n\nSee our contributed talk at _useR! 2021_:\n[[video](https://youtu.be/GMMGBlyl_ok?t=1170),\n[slides](https://cran4linux.github.io/bspm/slides/20210709-useR2021_talk.html)].\n\n## Installation\n\nInstallation from system repositories is preferred, mainly to avoid issues on\nSELinux-enabled systems (see [#19](https://github.com/cran4linux/bspm/issues/19)).\n\n- Follow these links if the target system is a desktop/server installation of\n  one of the supported distributions:\n  [Fedora](#fedora), [Ubuntu](#ubuntu), [openSUSE](#opensuse), [Arch](#arch).\n- If the target system is a containerized application (e.g., a Docker image),\n  refer to the [`rocker/r-bspm` images](https://github.com/rocker-org/rocker/tree/master/r-bspm).\n- If you are trying `bspm` in another distro, or you are packaging it as a\n  system package, please follow the general procedure below.\n\n### General procedure\n\nInstallation from source requires (apart from R) the folllowing Python bindings:\n\n|               | Package manager | DBus (\\*)              | GObject (\\*)      |\n|---------------|-----------------|------------------------|-------------------|\n| Fedora/RedHat | `python3-dnf`   | `python3-dbus`         | `python3-gobject` |\n| Ubuntu/Debian | `python3-apt`   | `python3-dbus`         | `python3-gi`      |\n|      openSUSE | `python3-dnf`   | `python38-dbus-python` | `python3-gobject` |\n|          Arch | `pyalpm`        | `python-dbus`          | `python-gobject`  |\n\n(*) Optional, only required if you plan to run `bspm` as a regular user\n(non-root) in a (systemd-based) desktop/server setting.\n\nThen, you should install `bspm` as a system package to be able to use it as a\nregular user. Download the latest version from CRAN or GitHub and proceed with\nthe installation (note `sudo`):\n\n```bash\n$ sudo R CMD INSTALL bspm_[version].tar.gz\n```\n\nFurther configuration options:\n\n- If you plan to run it only as root (e.g., in a docker container), then you\n  don't need the D-Bus service, so you can disable its installation by adding\n  `--configure-args=\"--without-dbus-service\"`.\n- If you are installing the package in a build root, instead of its final\n  destination, specify `--configure-vars=\"BUILD_ROOT=[path_to_build_root]\"` too.\n- By default, package prefixes and exclusions are automatically discovered from\n  system repositories, and this discovery mechanism is exposed so that the user\n  can install other packages if e.g. new repositories with other prefixes are\n  added. If you want to fix prefixes and exclusions and prevent exposing the\n  discovery mechanism, set `--configure-vars=\"PKG_PREF='prefix1- prefix2- ...'\"`\n  and `--configure-vars=\"PKG_EXCL='exclusion1 exclusion2 ...'\"`.\n\nTo enable it by default, put the following into the `Rprofile.site`:\n\n```r\n\u003e bspm::enable() # wrap it in suppressMessages() to avoid the initial message\n```\n\nThen, run `install.packages` as usual, and available system packages will be\nautomatically installed.\n\n### Fedora\n\nThere are thousands of binary packages available via the\n[iucar/cran](https://copr.fedorainfracloud.org/coprs/iucar/cran/) Copr repo.\nThe `bspm` package is available as `R-CoprManager`, and enabled by default:\n\n```bash\n$ dnf --version | grep -q dnf5 || sudo dnf install 'dnf-command(copr)'\n$ sudo dnf copr enable iucar/cran\n$ sudo dnf install R-CoprManager\n```\n\n### Ubuntu\n\n(Essentially) all of CRAN is available as binary packages via the\n[r2u](https://eddelbuettel.github.io/r2u/) repo:\n\n```bash\n$ . /etc/os-release # to get UBUNTU_CODENAME\n$ URL=\"https://raw.githubusercontent.com/eddelbuettel/r2u/master/inst/scripts\"\n$ curl -s \"${URL}/add_cranapt_${UBUNTU_CODENAME}.sh\" | sudo bash -s\n```\n\n### openSUSE\n\nThere are thousands of binary packages available via the\n[autoCRAN](https://build.opensuse.org/project/show/devel:languages:R:autoCRAN)\nOBS repo:\n\n```bash\n$ sudo zypper ar -r https://download.opensuse.org/repositories/devel:/languages:/R:/patched/openSUSE_Tumbleweed/devel:languages:R:patched.repo\n$ sudo zypper ar -r https://download.opensuse.org/repositories/devel:/languages:/R:/autoCRAN/openSUSE_Tumbleweed/devel:languages:R:autoCRAN.repo\n$ sudo zypper install R-patched python3-dnf python38-dbus-python python3-gobject\n$ sudo ln -s /etc/zypp/repos.d /etc/yum.repos.d\n```\n\nThen, install `bspm` as a system package from CRAN:\n\n```bash\n$ sudo Rscript -e 'install.packages(\"bspm\", repos=\"https://cran.r-project.org\")'\n```\n\nThen, to enable it system-wide (alternatively, use your `.Rprofile`):\n\n```bash\n$ echo \"bspm::enable()\" | sudo tee -a /usr/lib64/R/etc/Rprofile.site\n```\n\nSometimes, a restart is required so that the new systemd service is recognized.\n\n### Arch\n\nThere are thousands of binary CRAN and Bioconductor packages available via the\n[BioArchLinux](https://github.com/BioArchLinux/Packages) repo:\n\n```bash\n$ echo -e \"\\n[bioarchlinux]\\nServer = https://repo.bioarchlinux.org/\\$arch\" \\\n  | sudo tee -a /etc/pacman.conf\n$ sudo pacman-key --recv-keys B1F96021DB62254D\n$ sudo pacman-key --lsign-key B1F96021DB62254D\n$ sudo pacman -Syu r-bspm\n```\n\nThen, to enable it system-wide (alternatively, use your `.Rprofile`):\n\n```bash\n$ echo \"bspm::enable()\" | sudo tee -a /usr/lib64/R/etc/Rprofile.site\n```\n\n## Moving the user library\n\nAfter installing and enabling `bspm` in a system with a populated user library,\n_package shadowing_ will prevent system packages from loading, because the user\nlibrary takes precedence in `.libPaths()` (see `?bspm::shadowed_packages` for\nan utility to find shadowed packages). To solve this, it is necessary to\ninstall packages available in the system repos and remove them from the user\nlibrary, leaving there only GitHub packages, development versions, and so on.\nThis is achieved simply by calling `bspm::moveto_sys()`.\n\nAdditionally, `bspm` provides a script for mass-calling `bspm::moveto_sys()`\nfor several users and/or libraries, which allows sysadmins to easily deploy\n`bspm` in a multi-user server. The script, which requires `sudo` privileges,\nis called as follows:\n\n```bash\n$ Rscript -e bspm:::scripts mass_move user1 [user2 ...] [lib1 [lib2 ...]]\n```\n\nBy default, it does a dry run, meaning that it won't touch anything and will\njust report the user libraries found. To actually run the script, the `--run`\nflag must be provided:\n\n```bash\n$ Rscript -e bspm:::scripts mass_move --run user1 [user2 ...] [lib1 [lib2 ...]]\n```\n\n## Developing new backends\n\nNew backends for other package managers can be added to `inst/service/backend`.\nEach backend must implement the following functions:\n\n- `def discover() -\u003e dict({ \"prefixes\" : list, \"exclusions\" : list })`\n- `def available(prefixes : list, exclusions : list) -\u003e list`\n- `def install(prefixes : list, pkgs : list, exclusions : list) -\u003e list`\n- `def remove(prefixes : list, pkgs : list, exclusions : list) -\u003e list`\n\nThe last two functions receive a list of prefixes, a list of R package names and\na list of exclusions, and must return a list with those package names that could\nnot be processed (i.e., packages not found in the system repos). Any progress\nshould be reported to stdout.\n\n## Support and troubleshooting\n\nIf you are experiencing an issue that is not listed here, or the solution\ndid not work for you, please do not hesitate to open a ticket at our\n[GitHub issue tracker](https://github.com/cran4linux/bspm/issues).\n\n### Cannot connect to the system package manager\n\nSymptom: you tried to install a package and you got this message.\n\n```r\n\u003e install.packages(\u003csome_package\u003e)\nError in install.packages : cannot connect to the system package manager\n```\n\nThis usually happens when `bspm` was installed in the user library or, as a\nsystem package, it is not properly configured for some reason. The solution is:\n\n1. First and foremost, **uninstall** any copy of `bspm` in your user library.\n2. Reinstall with admin privileges, e.g.:\n\n```bash\n$ sudo Rscript --vanilla -e 'install.packages(\"bspm\", repos=\"https://cran.r-project.org\")'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcran4linux%2Fbspm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcran4linux%2Fbspm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcran4linux%2Fbspm/lists"}