Why alpine-base 3.5.1 downgrade to 3.5.0 when I change to edge repository? - alpine-linux

I'm following https://wiki.alpinelinux.org/wiki/Edge to upgrade alpine 3.5.1 to edge. The /etc/apk/repository is
http://dl-2.alpinelinux.org/alpine/edge/main
http://dl-2.alpinelinux.org/alpine/edge/community
#testing http://dl-2.alpinelinux.org/alpine/edge/testing
And I do the following command:
apk upgrade --update-cache --available
Then my alpine is back to 3.5.0
cat /etc/alpine-release
3.5.0
If I change the /etc/apk/repository to
http://dl-2.alpinelinux.org/alpine/v3.5/main
http://dl-2.alpinelinux.org/alpine/edge/main
http://dl-2.alpinelinux.org/alpine/edge/community
#testing http://dl-2.alpinelinux.org/alpine/edge/testing
It back to 3.5.1, but gdk-pixbuf downgrading from 2.36.5-r0 -> 2.36.2-r0

It seems that Edge always reports 3.5.0. So that version number may not be reliable. I would say that this is standard for development versions.
$ docker run alpine:3.4 cat /etc/alpine-release
3.4.6
$ docker run alpine:edge cat /etc/alpine-release
3.5.0

Related

Install older package version in Alpine

So recently (5th September) the Alpine Linux package repo was updated to postgresql-client 12.4
I'm referencing version 12.3 in my Dockerfile (apk add postgresql-client=~12.3). Is it not possible to install that version now?
I'd like to update on my time and terms, why should I be forced to update now? Is there another repository I can add to use the older version?
Thanks
Unfortunately, Alpine packages are always updated in place to the latest version, and older versions are discarded. This could be painful, indeed...
Usually, when a package is updated, it's updated with all Alpine distro versions that it's compatible to. For example, postgresql-client was bumped to 12.4-r0 on edge, v3.12 and v3.11, but on Alpine v3.10 repos you'll still find 11.9-r0. In case this was enough, the old version could be installed from the desired repository, as long as it lasts, using:
apk add postgresql-client=11.9-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.10/main
However, since 12.3 doesn't live in the official Alpine repositories anymore, you could rely on an external Docker image, instead.
Luckily, the postgres official images has version tags, and you can find the desired Alpine image for 12.3:
$ wget -q https://registry.hub.docker.com/v1/repositories/postgres/tags -O - | jq -r '.[].name' | grep 12.3
12.3
12.3-alpine
Therefore, you can use FROM:postgres:12.3-alpine to get the desired version from.
In tougher cases, where the Alpine package version is updated, and couldn't be found in other images, the only resort may be building from source.
for example; the latest dnsmasq version ins 2.84-r0 at now, if you install 2.83-r0, will:
$ docker run --rm -ti alpine:3.13
$ apk add 'dnsmasq-dnssec==2.83-r0'
fetch https://mirrors.aliyun.com/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
fetch https://mirrors.aliyun.com/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
dnsmasq-dnssec-2.84-r0:
breaks: world[dnsmasq-dnssec=2.83-r0]
The best thing you can achieve is using repositories of the earlier releases, at the websiete https://pkgs.alpinelinux.org/packages to search the old version, will find 2.83-r0 in https://pkgs.alpinelinux.org/packages?name=dnsmasq&branch=v3.12.
so add the old repo
$ echo 'http://dl-cdn.alpinelinux.org/alpine/v3.12/main' >> /etc/apk/repositories
$ apk add 'dnsmasq-dnssec==2.83-r0'
fetch http://mirrors.aliyun.com/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://mirrors.aliyun.com/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/3) Installing gmp (6.2.0-r0)
(2/3) Installing nettle (3.5.1-r1)
(3/3) Installing dnsmasq-dnssec (2.83-r0)
Executing dnsmasq-dnssec-2.83-r0.pre-install
Executing busybox-1.31.1-r16.trigger
OK: 7 MiB in 17 packages
Another solution based on the answer of #valiano.
For upgrading postgresql to a newer version, it is recommended to use the higher version pg_dump binaries. But how to get these into your image?
This works for me:
Dockerfile:
ARG VERSION=10
ARG UPGRADE_VERSION=11
ARG TYPE
###############################################################
# Normal server
###############################################################
FROM postgres:${VERSION}-alpine AS server
RUN apk update \
&& apk add --upgrade apk-tools \
&& apk upgrade --available
COPY /rootfs/ /
###############################################################
# Upgrade version with upgrade executables
###############################################################
FROM postgres:${UPGRADE_VERSION}-alpine AS upgrade_version
RUN apk update \
&& apk add --upgrade apk-tools \
&& apk upgrade --available
###############################################################
# Add postgresql upgrade client executables to upgrade_server_layer
###############################################################
FROM server AS upgrade_server
RUN mkdir -p /usr/local/postgresql/upgrade
COPY --from=upgrade_version /usr/local/bin/pg* /usr/local/postgresql/upgrade/
###############################################################
# Final version
###############################################################
FROM ${TYPE}server AS final
Then build your normal server as:
docker build --build-arg TYPE= --build-arg VERSION=11 --build-arg UPGRADE_VERSION=12 -t my_normal_server:11 .
And a server with upgrade binaries, to make the dumpfile:
docker build --build-arg TYPE=upgrade_ --build-arg VERSION=10 --build-arg UPGRADE_VERSION=11 -t my_upgrade_server:10 .
Upgrade scenario if current version is postgresql 10 and you want to upgrade to 11:
Build an upgrade version and a normal version.
Stop the postgresql 10 container and replace it with the my_upgrade_version:10
Create a dumpfile with the /usr/local/postgresql/upgrade/pg_dump.
Create a new postgresql 11 container with my_normal_version:11 with access to the dumpfile and use pg_restore to restore the created dumpfile.
About making a dry single-point-of-entry for fixed package versions:
I use the following method, where I have an .env file where I store the PG major and minor version. I only need to update the .env-file entry with preferred version numbers and rebuild my images to upgrade the Postgres.
As long as the package is present with the corresponding version in the dockerhub and the PG version itself isn't deprecated by the alpine repositories or sth:
Step 1: Specify the PG version in .env file as single point of entry:
PG_MAJOR_VERSION=14
PG_MINOR_VERSION=5
Step 2: Reference the db-package inside the docker-compose:
services:
db:
image: postgres:${PG_MAJOR_VERSION}.${PG_MINOR_VERSION}-alpine
Step 3: Use the variables inside the Dockerfile itself if needed:
ARG RUBY_VERSION
ARG DISTRO_NAME
FROM ruby:${RUBY_VERSION}-${DISTRO_NAME}
# Need to define the args again:
ARG DISTRO_NAME
ARG PG_MAJOR_VERSION
RUN apk add --update build-base bash bash-completion libffi-dev tzdata postgresql$PG_MAJOR_VERSION-client postgresql$PG_MAJOR_VERSION-dev nodejs npm yarn
NB! The FROM clause loses the ARG-variables defined before it. Therefore if you need them later then you need to define them again after the FROM-clause. This issue is described in more detail in this Github issue
Depending on the packages you wish to install you can specify the minor version or other suffixes as needed (for ex for postgresql15-client-15.1-r0 and postgresql15-dev-15.1-r0: package etc)

(GVM) 10 on Alpine issue

While installing GVM10 on Alpine (Linux alp 5.4.12-1-virt) I get the following error after the command:
apk add gvmd gnutls-utils openvas-scanner greenbone-security-assistant python3 redis
ERROR: unsatisfiable constraints:
openvas-scanner (missing):
required by: world[openvas-scanner]
I'm actually sticking to this guide:
https://wiki.alpinelinux.org/wiki/Setting_up_GVM10
What should I do in order to solve the problem?
Thanks a lot
The openvas-scanner package is no longer available in Alpine version 3.11:
openvas-scanner on Alpine 3.11
openvas-scanner on Alpine 3.10 (6.0.0-r3)
The simplest solution is downgrading the Alpine base image to 3.10 (if you're running a Docker image and free to pick a different base). However, using an older Alpine base is not an ideal solution.
Alternatively, you can work around this limitation by installing openvas-scanner of the Alpine 3.10 repo:
apk add gvmd gnutls-utils greenbone-security-assistant python3 redis
apk add openvas-scanner --repository=http://dl-cdn.alpinelinux.org/alpine/v3.10/community
This seems to be working currently on Alpine 3.11.
It has the side of downgrading several gvm packages (below), but otherwise there are no installation issues.
(1/24) Downgrading gvm-libs (11.0.0-r1 -> 10.0.0-r1)
(2/24) Downgrading greenbone-security-assistant (9.0.0-r0 -> 8.0.0-r4)
(4/24) Downgrading gvmd (9.0.0-r1 -> 8.0.0-r3)

error: SERVER does not appear in AM_CONDITIONAL

I am trying to install Lustre on CentOS 7. I followed this link. When I try to run sh ./autogen.sh to generate the configure script I get the above error as illustrated below.
[root#localhost lustre-release]# sh ./autogen.sh
configure.ac:10: installing 'config/config.guess'
configure.ac:10: installing 'config/config.sub'
configure.ac:12: installing 'config/install-sh'
configure.ac:12: installing 'config/missing'
autoMakefile.am:127: error: SERVER does not appear in AM_CONDITIONAL
libcfs/libcfs/autoMakefile.am: installing 'config/depcomp'
Does anyone know how I can resolve this?
To build lustre from git use "autogen.sh" in the top level directory to setup the build environment:
$ bash autogen.sh
libcfs/libcfs/autoMakefile.am: installing 'config/depcomp'
$
Did you try downloading a pre-built package from https://downloads.whamcloud.com/public/lustre/ ? That is usually the easiest compared to building your own.
If you want to build your own Lustre code, which version of the source are you using? The latest code is available at git.whamcloud.com. Most users should use the LTS release (b2_10 branch currently), but if you are doing new development you should use the master branch.

Unable to install IHaskel kernel into Jupyter: "could not parse version number"

I've recently completed the installation instructions for Haskell, and have reached the final step where I run
ihaskell install
to install the IHaskell kernel into Jupyter. However at this point I'm stuck, with the error
Detected IPython, but could not parse version number.
ihaskell:
Ran commands:
which ipython
/usr/local/bin/ipython --version
which /usr/local/bin/ipython
Exception: ExitFailure 1
which makes no sense, since when I run those commands myself, I get a valid (and required) version number:
$ which ipython
/usr/local/bin/ipython
$ /usr/local/bin/ipython --version
4.0.0
$ which /usr/local/bin/ipython
/usr/local/bin/ipython
How do I proceed to install the IHaskell kernel into Jupyter?
This is a (soon to be addressed) limitation of the current version of IHaskell, which only supports IPhython 3.0.
Stepping back to 3.0 with
pip uninstall ipython
pip uninstall jupyter_core
pip install ipython[notebook]==3.0
will resolve the problem until IHaskell is updated, at which point it will be safe to restore the current version of IPython with
pip install ipython[notebook] --upgrade
Note that stepping back to 3.0 will result in view visible differences, though the expected location of settings files will change.

Install ruby 2.1.5 via rbenv

I already have rbenv version 0.4.0-97-gfe0b243 installed, that manages ruby version 2.1.1
Now, I also want it to manage ruby 2.1.5
But, when I do rbenv install --list then I see max ruby 2.1.2 and then 2.2.0-dev. What should I do for getting version 2.1.5 ?
The following code helped me get over the situation.
GOTO
cd ~/.rbenv/plugins/ruby-build
git pull
Now I can see 2.1.5 also listed in rbenv install --list
You can perform an upgrade on ruby-build.
$ brew update
$ brew upgrade rbenv ruby-build
$ rbenv install --list
Note: I have tested the following procedure on Ubuntu 16.04, it work for me. I am assuming that you have already installed the rbnev on your system successfully. To check is it working properly or not? run the command rbenv -v
it will give you output like this.
rbenv 1.0.0-33-gc7dcaf1
but in your System the version of rbenv version may be different.
Run the following command to install required version of ruby.
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
rbenv install --list
select appropiate available of ruby as per your requirement 2.1.5
rbenv install 2.1.5
rbenv global 2.1.5
rbenv rehash
ruby -v