Skip to content

Instantly share code, notes, and snippets.

@jmarhee
Created April 19, 2026 01:18
Show Gist options
  • Select an option

  • Save jmarhee/0cae095d04ca557730ff5f81c92a9514 to your computer and use it in GitHub Desktop.

Select an option

Save jmarhee/0cae095d04ca557730ff5f81c92a9514 to your computer and use it in GitHub Desktop.
Convert and Install Obsidian from deb package to rpm-based install (https://obsidian.md/download) (rather than AppImage, Flatpak, etc.)
#!/bin/bash
DEB_PATH=$1
for tool in alien rpmbuild; do
if ! command -v $tool &> /dev/null; then
echo "ERROR: $tool not found"
exit 1
fi
done
sudo alien -r -g -v $DEB_PATH && \
EXTRACTED_DIR=$(ls -td -- */ 2>/dev/null | head -1)
cd $EXTRACTED_DIR && \
SPEC_FILE=$(ls *.spec 2>/dev/null | head -1)
sudo sed -i 's/Summary:/Summary: obsidian/' $SPEC_FILE && \
sudo rpmbuild --target=x86_64 --buildroot $PWD -bb $SPEC_FILE
RPM_PATH=$(find ../ -name "*.rpm" -type f 2>/dev/null | grep -v ".src.rpm" | head -1)
if [ -n "$RPM_PATH" ]; then
echo ""
echo "Created: $RPM_PATH"
read -p "Install the resulting RPM? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo rpm -ivh --nodeps --nosignature "$RPM_PATH"
fi
else
echo "RPM file not found"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment