not found but exists

I’m trying to run rstudio-server on CentOS with the following flake.nix

  description = "shell flake for VSCode and RStudio";
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/4329d79dbab9f9ae6654c59ac428b8935eb7f7c5";
    flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils, nixgl }:
    flake-utils.lib.eachDefaultSystem (system:
      pkgs = import nixpkgs {
        inherit system;
      with pkgs; with rPackages;
      rpackage_list = [
      customRStudioServer = rstudioServerWrapper.override { packages =
    in {
    packages.rstudio-server = customRStudioServer;
    devShell = mkShell {
      nativeBuildInputs = [ bashInteractive ]; # pkgs.bashInteractive
      buildInputs =

When I run rserver --config-file myrserver.conf, The following error occurs.

/nix/store/rsf4q39glsn4rfcvlqjiiw27pl6pwz46-RStudio-1.4.1717/bin/rsession: error while loading shared libraries: cannot open shared object file: No such file or directory

If I do

ldd /nix/store/rsf4q39glsn4rfcvlqjiiw27pl6pwz46-RStudio-1.4.1717/bin/rsession

There is indeed no Only exists as follows. => /nix/store/1ghxrdlh0c5z6kgck5ciwymxphnw8j17-gfortran-9.3.0-lib/lib/ (0x00007feee0f9e000)

How can I fix this? Do I have to add It seems that contains only How can I solve this issue?

I believe this is from an ancient version of gcc (e.g. gcc 6), is the CentOS environment affecting the executable at all?

$[22:28:45] jon@nixos ~/projects/nixpkgs (master)
$ ls $(nix-build -A*
1 Like

Yes I’m guessing you’re running RHEL <=6 or the equivalent CentOS version, and you have your Nix library paths being clobbered by the system.

I had this exact issue on RHEL 6 for years.

1 Like