Forum › Forums › General › Tips and Tricks › List packages from antiX repo as “antix” release
- This topic has 0 replies, 1 voice, and was last updated Jul 31-10:03 pm by Xecure.
-
AuthorPosts
-
July 31, 2021 at 10:03 pm #64066Member
Xecure
WARNING: This is a technical thing I wanted to do and really helps nothing at all in normal day-to-day usage of antiX. I wanted to configure this to be able to see all available packages from the antiX repo without having to disable all other sources. It is good for nothing else.
PREFACE
I observed when using mx repository (placed as a source list for apt) that apt identifies its “release” as “mx”, even if using buster/bullseye codename. I figured out that the repo is configured (in the Release/InRelease files) like this:Origin: MX repository Label: MX repository Suite: mx Codename: busterSo, I figured out that “Suite:” is the parameter that tells APT that the release name is “mx”. This makes it very easy to target mx as the source for downloading and installing a package. Example:
sudo apt install -t=mx youtube-dl
This will force apt to first try and download the package from the mx repo, even if it is set as lower priority or if the package version is older.antiX repositories are configured this way:
Origin: antixlinux.com Label: antiX repository Suite: bullseye Codename: bullseyeWhere the “Suite” or Release name is set to the current Debian codename (in the example above, bullseye). So, if I search for all available packages for youtube-dl, for example, I get this:
$ apt list -a youtube-dl Listing... Done youtube-dl/testing,testing 2021.06.06-1 all youtube-dl/bullseye,bullseye 2021.04.07-1.0antix1 allIn this case, it is easy for me to identify the one coming from the official Debian bullseye repo (still listed as “testing”) vs the one from antiX’s “bullseye” repo, but once bullseye becomes the new stable, it will list both as “bullseye” (probably). And if I want to target one specific repo in the future, I will have to first check the package version and target it instead of simply telling apt to “get me the one from antiX repos”.
Asking the devs to reconfigure all the repositories and mirrors to “Suite: antix”, just because I want it so, would cause not only trouble for the devs (a lot of extra work) but may also cause mirrors to break and then antiX users all over the world will come looking for me to break my legs instead.
To avoid causing any trouble to anyone, I have created an apt hook and a small script to change the corresponding files inside my system to satisfy my curiosity and improve a bit my apt options.
SMALL SCRIPT
I created a small script (giving execution permissions) named update-antix-release-info to:
1. Restore the antiX Release information to its previous configuration (so that the release names match with the server for apt update to work).
2. After the package-list information has correctly updated, to change the release information to “antix”.#!/bin/bash SELECTED_OPTION="$@" LIST_OF_FILES="$(grep -i "Origin: antixlinux.com" /var/lib/apt/lists/* 2>/dev/null |cut -d":" -f1)" if [ ! -z "$LIST_OF_FILES" ]; then while read -r file; do case "$SELECTED_OPTION" in restore) SUITE_OPT="$(grep -m1 "^Codename: " "$file" | awk '{print $2}')" sed -i "s/^Suite:.*/Suite: $SUITE_OPT/" "$file" ;; update) sed -i 's/^Suite:.*/Suite: antix/' "$file" ;; *) exit 1;; esac done < <(echo "$LIST_OF_FILES") echo "Updated antiX release information" fiI saved the file inside /etc/apt/
APT HOOK
I created a file inside /etc/apt/apt.conf.d/ named 21-apt-update-antix-release that would trigger before and after apt update, The code:// Replace release information for antiX package lists APT::Update::Pre-Invoke {"/etc/apt/update-antix-release-info 'restore'";}; APT::Update::Post-Invoke-Success {"/etc/apt/update-antix-release-info 'update'";};EXECUTION
After running apt update, when I check for apt listing information for youtube-dl, now I see:$ apt list -a youtube-dl Listing... Done youtube-dl/testing,testing 2021.06.06-1 all youtube-dl/antix,antix 2021.04.07-1.0antix1 allAnd can see that the source of the second youtube-dl package is the antiX repos. I can even make youtube.dl install directly from the antiX repos with the command:
sudo apt install -t=antix youtube-dl
and it will specifically target the package in the antiX repo, (even if it is older), making my life easier.I don’t think anyone will be interested in this, but I leave it here for myself in the future (in case I forget). I was thinking about this problem today when I saw that anticapitalista had packaged the patched connman version I proposed in another thread (thanks for that), and wanted to find an easy way to directly target the anti packages directly, even if another (possibly newer) version of the same package is available from the Debian repos. It will also help me find all available packages from the antiX repos with the apt list command.
- This topic was modified 1 year, 9 months ago by Xecure. Reason: Fixed typo
antiX Live system enthusiast.
General Live Boot Parameters for antiX. -
AuthorPosts
- You must be logged in to reply to this topic.