Skip to content

Instantly share code, notes, and snippets.

@KaKi87
Last active September 4, 2024 10:00
Show Gist options
  • Save KaKi87/f620788e9901abbfef4978eb7ad358b4 to your computer and use it in GitHub Desktop.
Save KaKi87/f620788e9901abbfef4978eb7ad358b4 to your computer and use it in GitHub Desktop.
dynapt experimental setup tutorial

dynapt — Experimental setup tutorial

Introduction

Welcome to the experimental setup tutorial for dynapt, the dynamic APT repository.

If you're reading this, you might be frustrated that an app you're using doesn't offer automated updates, by way of an APT repository, a PPA, or a Flatpak.

The first one of those options consists in creating a file server hosting DEB files to be downloaded by the APT package manager.

Which is what dynapt does, but on your local machine.

Additionally, it comes with the ability to wrap AppImage files into DEBs, and will in the future handle bare binaries.

Installation

dynapt is available as DEBs.

Download & install automatically :

wget https://git.kaki87.net/KaKi87/dynapt/releases/download/0.0.0-dev.af3fa0a/dynapt-$(dpkg --print-architecture).deb && \
sudo apt install ./dynapt-$(dpkg --print-architecture).deb

Or manually for amd64 (aka. x86_64) or arm64 (aka. aarch64).

General configuration

Now that dynapt is installed at /opt/dynapt, create a config.json file there : nano /opt/dynapt/config.json

And paste the following :

{
    "port": 3000,
    "concurrency": null,
    "apps": []
}

You may change the port number if 3000 is already used on your device (if you don't know then likely not).

This configuration will by default download & package all apps simultaneously for faster apt update execution. If your device has low power or low bandwith, change concurrency to 1 to only allow one downloading & packaging at a time (or a little more if you'd like).

Then, add dynapt as an APT repository (don't forget to change the port number if you previously did) :

echo "deb [trusted=yes] http://127.0.0.1:3000/ /" | sudo tee /etc/apt/sources.list.d/dynapt.list

And start it :

nohup dynapt &

Finally, make it start automatically at boot using cron :

crontab -l | { cat; echo "@reboot dynapt"; } | crontab -

App-specific configuration

Configuration for already tested apps are documented on a related issue/discussion, which you probably come from :

For the generic information :

  • apps is a JSON array that takes the following item properties :
    • name (string) : the name of the app ;
    • url (string) : direct download to a DEB or AppImage ;
      or
    • github (object) : GitHub release download info ;
      • repo (string) : repository in owner/name format ;
      • filter (string) : optional file name filter when multiple DEB/AppImage files available (e.g. for variant or architecture) ;
    • appimage (boolean or object) : set to true when using AppImage instead of DEB ;
      • bin (string) : optional command name to make available in /usr/bin ;
    • id (string) : auto-generated UUID, not to be provided by users, used to manage caching.

Troubleshooting

Logs

Get your latest log entry from /opt/dynapt/dynapt.log in addition to your APT command output to get help.

Clean cache

Run dynapt clean to remove all previously downloaded & packaged files, then run sudo apt update to re-download them again.

Manually update

To debug download issues without updating APT, run dynapt update.

To update APT only for the dynapt repository, run sudo apt update -o Dir::Etc::sourcelist="sources.list.d/dynapt.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0".

List packages

Run dynapt list to check the status of packages handled by dynapt.

Future updates

dynapt will be able to provide its own upgrades to APT as soon as released as stable. Until then, updates will have to be done manually. To get notified, subscribe to this gist or watch the self-hosted repository.

This manual setup will no longer be required once dynapt is stable, and will offer an optional step-by-step wizard instead.

Further support

Support will be provided to commenters here for as long as dynapt will remain experimental, since promotion occurs here, but questions and bug reports and feature requests are ideally welcome on the self-hosted repository, and will only be handled there as soon as dynapt is released as stable.

Proprietary apps

Here are some tested configurations for proprietary apps.

        {
            "name": "Discord",
            "url": "https://discord.com/api/download?platform=linux&format=deb"
        }
        {
            "name": "Free Download Manager",
            "url": "https://files2.freedownloadmanager.org/6/latest/freedownloadmanager.deb"
        }

Differences with deb-get & AM

deb-get is a package manager that fetches DEB files and AM is a package manager that fetches AppImage files.

Their fetching works similarly to dynapt's, but the difference is dynapt isn't a package manager : it interfaces with APT instead, letting you keep using your usual tools, whether that's apt, aptitude, Synaptic, your desktop environment's app store, etc.


Thank you for reading and for using dynapt ❤️

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