Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created July 20, 2022 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rms1000watt/f51472663c2488327709602d32e2870e to your computer and use it in GitHub Desktop.
Save rms1000watt/f51472663c2488327709602d32e2870e to your computer and use it in GitHub Desktop.
hello world dpkg
#!/usr/bin/env bash
if type -a ryan; then
echo ryan already installed
sudo apt remove ryan -y
fi
version="0.0.1"
sudo rm -rf "ryan-${version}" ||:
mkdir -p "ryan-${version}/DEBIAN"
mkdir -p "ryan-${version}/usr/local/bin"
cat << EOF > "ryan-${version}/usr/local/bin/ryan"
#!/usr/bin/env bash
echo hello world from ryan \$(date)
EOF
sudo chmod a+x "ryan-${version}/usr/local/bin/ryan"
cat << EOF > "ryan-${version}/DEBIAN/control"
Package: ryan
Version: ${version}
Architecture: all
Maintainer: ryan
Depends:
Installed-Size: 1
Homepage: github.com/rms1000watt
Description: ryan's hello world to dpkg
EOF
sudo chown -R 0:0 "ryan-${version}"
dpkg -b "ryan-${version}"
which ryan ||:
sudo dpkg -i "ryan-${version}.deb"
which ryan
ryan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment