Archlinux package management strategies: Difference between revisions

From wikinotes
(Created page with "The painful parts of arch are mostly related to libraries: * python updates take a while to reach all packages (so they get installed to the wrong site-packages) * libva updates may be too new for makemkv etc * qt updates are sometimes problematic as well To mitigate this, I've been exposing old versions of the libraries to my package-repo * ex. installing python-311 when python-3.12 became default")
 
No edit summary
Line 6: Line 6:
To mitigate this, I've been exposing old versions of the libraries to my package-repo
To mitigate this, I've been exposing old versions of the libraries to my package-repo
* ex. installing python-311 when python-3.12 became default
* ex. installing python-311 when python-3.12 became default
= Python Upgrades =
<blockquote>
== Failures ==
<blockquote>
{{ expand
| Install python-${old} alongside python-${new} and replace shebangs
|
The problem is that most of the dependencies will have been already moved over to the new python version.
<syntaxhighlight lang="bash">
# EXPLANATION:
    # list installed python3.11 packages
    packages=$(pacman -Qoq /usr/lib/python3.11)
    # list executables for these python packages
    executables=$(for f in $(pacman -Qoq /usr/lib/python3.11); do; pacman -Ql $f; done | grep -E '/bin/.')
# replace shebang with python3.11 for all python3.11 packages
for x in $(for f in $(pacman -Qoq /usr/lib/python3.11 | grep -v python311); do; pacman -Ql $f; done | grep -E '/bin/.' | awk '{ print $2 }') ; do; sudo sed -i 's^#!/usr/bin/python^#!/usr/bin/python3.11^' "$x" ; done
</syntaxhighlight>
}}
</blockquote><!-- Failures -->
</blockquote><!-- Python Upgrades -->

Revision as of 22:32, 5 May 2024

The painful parts of arch are mostly related to libraries:

  • python updates take a while to reach all packages (so they get installed to the wrong site-packages)
  • libva updates may be too new for makemkv etc
  • qt updates are sometimes problematic as well

To mitigate this, I've been exposing old versions of the libraries to my package-repo

  • ex. installing python-311 when python-3.12 became default

Python Upgrades

Failures

Install python-${old} alongside python-${new} and replace shebangs


The problem is that most of the dependencies will have been already moved over to the new python version.

# EXPLANATION:
    # list installed python3.11 packages
    packages=$(pacman -Qoq /usr/lib/python3.11)

    # list executables for these python packages
    executables=$(for f in $(pacman -Qoq /usr/lib/python3.11); do; pacman -Ql $f; done | grep -E '/bin/.')

# replace shebang with python3.11 for all python3.11 packages
for x in $(for f in $(pacman -Qoq /usr/lib/python3.11 | grep -v python311); do; pacman -Ql $f; done | grep -E '/bin/.' | awk '{ print $2 }') ; do; sudo sed -i 's^#!/usr/bin/python^#!/usr/bin/python3.11^' "$x" ; done