Skip to content

Instantly share code, notes, and snippets.

@loretoparisi
Created June 19, 2025 20:12
Show Gist options
  • Save loretoparisi/37d4d6b5cab1ecb48341be7101608190 to your computer and use it in GitHub Desktop.
Save loretoparisi/37d4d6b5cab1ecb48341be7101608190 to your computer and use it in GitHub Desktop.
fix replit libstdc issue
#!/bin/bash
echo "Creating replit.nix file to fix libstdc++.so.6 issue..."
# Create replit.nix file
cat > replit.nix << 'EOF'
{ pkgs }:
pkgs.mkShell {
buildInputs = [
pkgs.python311Full
pkgs.cacert
pkgs.gcc
pkgs.libgcc
pkgs.stdenv.cc.cc.lib
pkgs.postgresql
];
}
EOF
echo "replit.nix created successfully."
# Check if .replit file exists and modify it
if [ -f ".replit" ]; then
echo "Commenting out [nix] section in .replit file..."
# Create backup
cp .replit .replit.backup
# Comment out the nix section
sed -i 's/^\[nix\]$/# [nix]/' .replit
sed -i 's/^channel = "stable_24_05"$/# channel = "stable_24_05"/' .replit
sed -i 's/^packages = \["cacert", "gcc"\]$/# packages = ["cacert", "gcc"]/' .replit
echo ".replit file modified successfully (backup saved as .replit.backup)"
else
echo "Warning: .replit file not found"
fi
echo ""
echo "Setup complete! The following changes were made:"
echo "1. Created replit.nix with required system dependencies"
echo "2. Commented out [nix] section in .replit file"
echo ""
echo "Please restart your Replit environment for changes to take effect."
echo "After restart, the libstdc++.so.6 library should be available."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment