[lazy admin writings] Backporting a deb package with Debian Linux

More recent yt-dlp versions (direct download ones) are complaining about EJS and warn that the build-in solution in yt-dlp will be deprecated. I wanted to prepare for this future deprecation so I had looked at the options before. The recommended one is Deno but I prefer to install from deb packages as much as possible and Deno could not be found in the Debian packages repositories. Then I had noticed that QuickJS (by the software genius Fabrice Bellard) is in the repositories but only from Debian Trixie and newer. The computer I use yt-dlp has Debian Bookworm and I’m not yet ready or too lazy or some such to make the jump from Bookwork to Trixie now.

What to do ? First I thought about apt-pinning which worked nice many years ago but in more recent years my experience with it was a bit too messy or chaotic. Chaos is fine but not too often πŸ˜‰ So what then ?

Go Go Gadget! Backporting.

Years ago I had used backporting several times with Debian even for packages with a lot dependencies which meant backporting several other programs and libraries that the package depended on.

With QuickJS I expected things to be easy because Fabrice Bellard is a programmer which appears to avoid bloat and wants to use every bit as efficient as possible.

After a search engine search I quickly found what I needed, this page :

https://debian-handbook.info/browse/stable/debian-packaging.html

Let’s summarize how this backporting was aΒ  success :

I made sure I had compile tools installed.

# apt install build-essential

(# implies sudo or su to temporary have root privileges $ implies regular user)

Then installed the devscripts deb and one of the suggestions (dh-make) which I am not sure that it was actually needed :

# apt install devscripts dh-make

In /etc/apt/sources.list I added one new line (without the #)Β  :

# deb-src http://deb.debian.org/debian/ trixie main contrib non-free

Then ran # apt update

As regular user :

$ apt source quickjs

After this command had downloaded the source, navigate into the new directory.

$ cd quickjs-2025.04.26/

Now an optional step which you can omit.

$ dch –local +falcot

Then the big moment. I still was not sure whether it needed more dependencies so this could fail.

$ dpkg-buildpackage -us -uc

And the compiling started and finished well.

The result were in the directory above (After compiling it will also mention that)

it resulted among other in two deb files : quickjs_2025.04.26-1_amd64.deb and libquickjs_2025.04.26-1_amd64.deb

The final step of backporting and installing :

# dpkg -i quickjs*deb libquickjs_2025.04.26-1_amd64.deb

That looked good, no errors.

Then the first new step with yt-dlp :

$ yt-dlp_linux –js-runtimes quickjs:/bin/qjs [and YouTube link here]

(Syntax following :Β  https://github.com/yt-dlp/yt-dlp/wiki/EJS)

And there it was in the yt-dlp output, the final verdict, it worked! :

[youtube] [jsc:quickjs] Solving JS challenges using quickjs

[info] [YT-link part]: Downloading 1 format(s): 135+251

Of course this will be more difficult or even very difficult or almost impossible if the package you’d like to backport has many dependencies but

you never know unless you try! πŸ™‚