Skip to content

Instantly share code, notes, and snippets.

@pierremonico
Forked from aviskase/Postman.desktop
Last active April 27, 2023 11:52
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save pierremonico/70ed579cfeb38dbc58bdd7168a4af027 to your computer and use it in GitHub Desktop.
Save pierremonico/70ed579cfeb38dbc58bdd7168a4af027 to your computer and use it in GitHub Desktop.
Install Postman
#!/bin/bash
cd /tmp || exit
echo "Downloading Postman ..."
wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz
tar -xzf postman.tar.gz
rm postman.tar.gz
echo "Installing to opt..."
if [ -d "/opt/Postman" ];then
sudo rm -rf /opt/Postman
fi
sudo mv Postman /opt/Postman
echo "Creating symbolic link..."
if [ -L "/usr/bin/postman" ];then
sudo rm -f /usr/bin/postman
fi
sudo ln -s /opt/Postman/Postman /usr/bin/postman
echo "Creating .desktop file..."
if [ -e "/usr/share/applications/Postman.desktop" ];then
sudo rm /usr/share/applications/Postman.desktop
fi
sudo mv Postman.desktop /usr/share/applications/Postman.desktop
echo "Installation completed successfully."
echo "You can use Postman!"
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@nchetan-zz
Copy link

This works :)

@junkystu
Copy link

junkystu commented Nov 3, 2017

Gotta hate apps that don't have a repo or provide a packaged installer. Thanks for this 🥇

@dimmg
Copy link

dimmg commented Nov 24, 2017

Good job! Thanks for this +1

@sparachi
Copy link

sparachi commented Dec 9, 2017

One more suggestion:: in terminal run chmod +x install-postman.sh
modify the script to have actual path to Postman.desktop for example sudo mv ~/Downloads/Postman.desktop /usr/share/applications/Postman.desktop

@sam-sla
Copy link

sam-sla commented Jun 12, 2018

The Icon path is no longer up-to-date!
I've forked and modified this a tiny bit so it downloads the .desktop file, to be able to just wget the install-postman.sh script and execute. Can check it here https://gist.github.com/sam-sla/56f6bc4ee9e317cf8eb4efca650a4e60

@harryi3t
Copy link

⚠️ ⚠️ ⚠️
@pierremonico Can you update your gist to

  1. Use some other directory than /opt/, since we have seen people having permission issues in this location. Because there is no write permission, auto-updates does not work when installed in this directory. Here's the link to the issue that people are facing because of this postmanlabs/postman-app-support#5039
  2. Include the information that Postman now supports auto-updates, and people should be using that instead of manually updating the app

More details:
The problem with using the command sudo tar -xzf postman.tar.gz -C /opt is that it does not remove the old files, just put the new files over the old. Doing this might make the Postman end up in an inconsistent state leading issues which are very difficult to debug and fix

Also, the gist from where this was forked has been updated accordingly https://gist.github.com/aviskase/e642248c35e400b56e2489430952369f

@sirkuttin
Copy link

the path for the icon is now:

/opt/Postman/app/resources/app/assets/icon.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment