Created
February 27, 2025 20:11
-
-
Save dapize/d21343549f61fb9d8f438c021dc53ad0 to your computer and use it in GitHub Desktop.
Para que tableplus funcione correctamente en Debian 12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e # Detener el script si hay errores | |
GLIBC_VERSION="2.38" | |
INSTALL_DIR="/opt/glibc-$GLIBC_VERSION" | |
TABLEPLUS_BIN="/usr/local/bin/tableplus" | |
TABLEPLUS_DESKTOP_SYSTEM="/usr/share/applications/tableplus.desktop" | |
TABLEPLUS_DESKTOP_USER="$HOME/.local/share/applications/tableplus.desktop" | |
TABLEPLUS_DESKTOP_OPT="/opt/tableplus/tableplus.desktop" | |
echo "🚀 Instalando dependencias necesarias..." | |
sudo apt update | |
sudo apt install -y build-essential manpages-dev gawk bison wget tar nano locate | |
echo "📥 Descargando GLIBC $GLIBC_VERSION..." | |
cd /tmp | |
wget http://ftp.gnu.org/gnu/libc/glibc-$GLIBC_VERSION.tar.gz | |
tar -xvzf glibc-$GLIBC_VERSION.tar.gz | |
cd glibc-$GLIBC_VERSION | |
echo "🛠️ Compilando GLIBC $GLIBC_VERSION (esto tomará un rato)..." | |
mkdir build && cd build | |
../configure --prefix=$INSTALL_DIR | |
make -j$(nproc) | |
sudo make install | |
echo "✅ GLIBC $GLIBC_VERSION instalada en $INSTALL_DIR" | |
echo "🔍 Verificando instalación..." | |
$INSTALL_DIR/lib/ld-$GLIBC_VERSION.so --version | |
if [ ! -f "$TABLEPLUS_BIN" ]; then | |
echo "❌ TablePlus no está instalado en $TABLEPLUS_BIN" | |
echo "Por favor, instala TablePlus manualmente y ejecuta este script nuevamente." | |
exit 1 | |
fi | |
echo "🛠️ Configurando TablePlus para que use GLIBC $GLIBC_VERSION..." | |
TABLEPLUS_LAUNCH_CMD="$INSTALL_DIR/lib/ld-$GLIBC_VERSION.so --library-path $INSTALL_DIR/lib:/usr/lib/x86_64-linux-gnu/ $TABLEPLUS_BIN" | |
echo "✅ Creando alias en ~/.bashrc" | |
echo "alias tableplus='$TABLEPLUS_LAUNCH_CMD'" >> ~/.bashrc | |
source ~/.bashrc | |
echo "🖥️ Modificando accesos directos de TablePlus..." | |
if [ -f "$TABLEPLUS_DESKTOP_SYSTEM" ]; then | |
echo "📌 Modificando $TABLEPLUS_DESKTOP_SYSTEM" | |
sudo sed -i "s|Exec=.*|Exec=env LD_LIBRARY_PATH=$INSTALL_DIR/lib:/usr/lib/x86_64-linux-gnu/ $TABLEPLUS_LAUNCH_CMD|" "$TABLEPLUS_DESKTOP_SYSTEM" | |
fi | |
if [ -f "$TABLEPLUS_DESKTOP_USER" ]; then | |
echo "📌 Modificando $TABLEPLUS_DESKTOP_USER" | |
sed -i "s|Exec=.*|Exec=env LD_LIBRARY_PATH=$INSTALL_DIR/lib:/usr/lib/x86_64-linux-gnu/ $TABLEPLUS_LAUNCH_CMD|" "$TABLEPLUS_DESKTOP_USER" | |
fi | |
if [ -f "$TABLEPLUS_DESKTOP_OPT" ]; then | |
echo "📌 Modificando $TABLEPLUS_DESKTOP_OPT" | |
sudo sed -i "s|Exec=.*|Exec=env LD_LIBRARY_PATH=$INSTALL_DIR/lib:/usr/lib/x86_64-linux-gnu/ $TABLEPLUS_LAUNCH_CMD|" "$TABLEPLUS_DESKTOP_OPT" | |
fi | |
echo "🔄 Actualizando base de accesos directos..." | |
update-desktop-database ~/.local/share/applications/ | |
sudo update-desktop-database /usr/share/applications/ | |
echo "🎉 Todo listo. Ahora puedes ejecutar TablePlus con 'tableplus' o desde el menú de aplicaciones." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment