Skip to content

Instantly share code, notes, and snippets.

@tadd
Created September 16, 2020 02:30
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 tadd/32a7f601ce9ca8eee58656a535e1f3cd to your computer and use it in GitHub Desktop.
Save tadd/32a7f601ce9ca8eee58656a535e1f3cd to your computer and use it in GitHub Desktop.
Repack .deb from nodesource for Debian bullseye
#!/bin/bash
set -e
ver=local1
if [ $# != 1 ]; then
echo $0: one argument of .deb needed >&2
exit 1
fi
set -x
mkdir -p newpack oldpack/DEBIAN
dpkg-deb -x $1 oldpack
dpkg-deb -e $1 oldpack/DEBIAN
sed -i "s/\(Version:.*\)$/\1-$ver/; s/python-minimal/python2-minimal/" oldpack/DEBIAN/control
dpkg-deb -Z xz -b oldpack newpack
deb=$(echo newpack/*.deb)
mv $deb .
rm -rf newpack oldpack
set +x
echo repacked as $(basename $deb)
@tadd
Copy link
Author

tadd commented Sep 16, 2020

@tadd
Copy link
Author

tadd commented Sep 16, 2020

Of course, you cannot use the official setup script https://deb.nodesource.com/setup_14.x directly for bullseye. Here is a patch:

--- setup_14.x.orig	2020-09-16 11:37:46.371570416 +0900
+++ setup_14.x	2020-09-16 11:38:34.824177549 +0900
@@ -270,6 +270,7 @@
 check_alt "Pardus"        "onyedi"   "Debian" "stretch"
 check_alt "Liquid Lemur"  "lemur-3"  "Debian" "stretch"
 check_alt "Astra Linux"   "orel"     "Debian" "stretch"
+check_alt "Debian"        "bullseye"    "Debian" "buster"
 
 if [ "X${DISTRO}" == "Xdebian" ]; then
   print_status "Unknown Debian-based distribution, checking /etc/debian_version..."

@tadd
Copy link
Author

tadd commented Oct 20, 2020

Update: It seems that the official script of nodejs seems to support bullseye as is.
This hack is no more needed, now we're all happy ;)

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