Created
April 19, 2026 01:18
-
-
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.)
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 | |
| 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