De 3rd party repo is niet nodig dan. Je kan ook offiele repo's gebruiken bijvoorbeeld van testing. Enz
Wat het te maken heeft. Stel programma A heeft PHP 4 nodig dan installeer je PHP 4 en maak je de pathways van programma A (symlink) je naar PHP 4 daarnaast pin je de upgrade vast enz. Dat hij niet verwijderd wordt maar ook niet geüpgrade.
Terwijl de rest gewoon op PHP 5 draait. Dit kun je met apt en Debian gewoon doen al is wat kennis van DPKG enz. Wel vereist. 😉
Ik heb even gezocht. Ik noemde het slinken maar het heet eigenlijk Pijpen volgens mij. In sommige gevallen moet je ook je pakketten hercompileren met nieuwe cflags (,oude methode)
https://stackoverflow.com...sions-on-the-same-machine
Package Managers - user-level
For a package manager that can install and manage multiple versions of python, these are good choices:
pyenv - only able to install and manage versions of python
asdf - able to install and manage many different languages
The advantages to these package managers is that it may be easier to set them up and install multiple versions of python with them than it is to install python from source. They also provide commands for easily changing the available python version(s) using shims and setting the python version per-directory.
This disadvantage is that, by default, they are installed at the user-level (inside your home directory) and require a little bit of user-level configuration - you'll need to edit your ~/.profile and ~/.bashrc or similar files. This means that it is not easy to use them to install multiple python versions globally for all users. In order to do this, you can install from source alongside the OS's existing python version.
Installation from source - system-wide
You'll need root privileges for this method.
See the official python documentation for building from source for additional considerations and options.
/usr/local is the designated location for a system administrator to install shared (system-wide) software, so it's subdirectories are a good place to download the python source and install. See section 4.9 of the Linux Foundation's File Hierarchy Standard.
Install any build dependencies. On Debian-based systems, use:
apt update
apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev libbz2-dev
Choose which python version you want to install. See the Python Source Releases page for a listing.
Download and unzip file in /usr/local/src, replacing X.X.X below with the python version (i.e. 3.8.2).
cd /usr/local/src
wget
https://www.python.org/ftp/python/X.X.X/Python-X.X.X.tgz
tar vzxf Python-X.X.X.tgz
Before building and installing, set the CFLAGS environment variable with C compiler flags necessary (see GNU's make documentation). This is usually not necessary for general use, but if, for example, you were going to create a uWSGI plugin with this python version, you might want to set the flags, -fPIC, with the following:
export CFLAGS='-fPIC'
Change the working directory to the unzipped python source directory, and configure the build. You'll probably want to use the --enable-optimizations option on the ./configure command for profile guided optimization. Use --prefix=/usr/local to install to the proper subdirectories (/usr/local/bin, /usr/local/lib, etc.).
cd Python-X.X.X
./configure --enable-optimizations --prefix=/usr/local
Build the project with make and install with make altinstall to avoid overriding any files when installing multiple versions. See the warning on this page of the python build documentation.
make -j 4
make altinstall
Then you should be able to run your new python and pip versions with pythonX.X and pipX.X (i.e python3.8 and pip3.8). Note that if the minor version of your new installation is the same as the OS's version (for example if you were installing python3.8.4 and the OS used python3.8.2), then you would need to specify the entire path (/usr/local/bin/pythonX.X) or set an alias to use this version.
[Reactie gewijzigd door rob12424 op 15 augustus 2021 19:47]