
An APT Repository for Zettlr

Today, we are excited to offer you a new way to install Zettlr on your Debian- or Ubuntu-based computers: An official APT repository for the app! Instead of having to download our .deb
-files and installing them manually, you can now install Zettlr and keep it updated like any other piece of software that you have. We believe that this will greatly enhance your experience of using Zettlr.
What is an APT Repository?
If you haven’t heard the term before, an APT repository is a collection of programs for Debian-based operating systems, served in a way that the Debian package manager, aptitude
, can digest them. Aptitude is the standard way to install and update software on Debian-based operating systems. If you use a computer with an operating system that is based on Debian (including Ubuntu, Kubuntu, Xubuntu, and others), you are already using aptitude
, even though you may not have realized it yet.
APT repositories are the preferred way to install software on Debian. While on macOS and Windows, it is common to download programs from the developer’s website, on Debian it is preferred to retrieve software from such repositories.
Installing programs by directly downloading .deb
-files and manually installing them works, too. But this means that keeping them updated is more difficult, because your software manager does not know about this software. Apps that you use to keep your programs up to date — the various software center applications that come with Debian or Ubuntu — need to be aware of a program so that they can tell you that a new version is available. If you install a program outside your software center, it won’t be aware of it.
Therefore, using an APT repository is the preferred way to install software on Debian-based computers, because it means that you can keep Zettlr up-to-date alongside all your other programs.
How does the Zettlr APT Repository work?
The big reason for why Zettlr offers its own repository — and we haven’t been able to offer it until now — is that it is difficult to get software into the official repositories. Instead, most developers need to provide their own repositories from which users can install their software. This is no easy feat. The documentation for APT is sparse and difficult to parse, and there are various ways to set up repositories.
The Zettlr repository is what the documentation calls a “shallow” repository. It only features a single software application — Zettlr — and as such keeps all necessary files in a single folder on our server. Our server runs a small Shell script that performs a set of steps each week to update the repository:
- Retrieve the most recent releases of the app from our GitHub repository
- Extract the URLs to all
.deb
-files from them - Download any files that are not yet present in the repository
- Create a
Packages
index file based on these.deb
-files. - Create a
Release
index file based on thePackages
-file and sign all required files with our private GPG key
In addition, the repository contains the public part of the GPG-key that we use to sign the installers which you’ll need to add to your computer in order for it to be able to verify the files.
As you can see, the repository simply served the same files as we upload to our GitHub releases page. It simply offers them in such a way that enables you to keep Zettlr up to date alongside your other programs — fully automated.
How do you use it?
So, how can you use the repository? If you own a Debian-based computer, it involves only two steps. First, you need to set up the repository on your computer. To do so, follow the instructions in the repository itself. In case anything changes, we keep the instructions updated there.
Note: If you already have Zettlr installed, you should probably uninstall this version and then re-install it from our repository. Make sure to keep a backup of your configuration before doing so!
Here are the commands you need to run as of the publication date of this blog post. Please refer to the APT repository itself for up-to-date instructions.
# First, add our public key to APT
curl -s --compressed "https://apt.zettlr.com/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/zettlr_apt.gpg > /dev/null
# Second, add this repository to your sources
sudo curl -s --compressed -o /etc/apt/sources.list.d/zettlr.list "https://apt.zettlr.com/zettlr.list"
# Third, update APT so that it fetches the available files
sudo apt update
Once you have done so, you can install Zettlr like any other program:
sudo apt install zettlr
Finally, whenever there is a new version available, APT should automatically fetch its information, and whenever you update your software (regardless of whether you use the command line or a graphical application), it will automatically update Zettlr as well. If you do this regularly anyway, you can keep Zettlr up to date without spending any additional thought!
Final Thoughts
We hope that this new offer from our side will make your experience with using Zettlr more seamless and more comfortable than ever before.
If you have any concerns, or further questions, you can always reach the community and the developers on our community forum and our Discord server.
Happy writing!