Anaconda installs packages with an incorrect order

Issues related to configuring your network
User avatar
moradiv
Posts: 20
Joined: 2019/04/18 09:34:53

Anaconda installs packages with an incorrect order

Post by moradiv » 2019/04/18 12:52:49

Hi,
We are creating our CenOS 7.5 image which contains about 500 packages, most of them are from CentOS 7.5 disk, and some of them are packages that are built in out environment.
On some of the created images, the packages that are installed by anaconda, get installed with incorrect order, even though the package has "Requires" and its dependencies are defined - anaconda installs it before the dependencies are installed which cause the image installation to fail.
This issue happens only on some of our created images, and we didn't find the reason why.
For example, while anaconda installs the ISO packages, one of our packages get installed much earlier than it should be installed. there are many packages that should be installed before which don't get installed (defined in its spec under "Requires" but anaconda installs it before requirements are installed).

- the image is created using the command
mkisofs -o "${ISO_FILE}" -b isolinux.bin -c boot.cat -no-emul-boot -V "ISO" -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/
- anaconda is vanilla and no customization is made
- happens on approximately 40% of our images, which means 2 images without any change - 1 has the issue and 1 hasn't.

Please help me figure out why it happens, and why package gets installed by anaconda without installing its dependencies first?

Thanks,
Mor.
Attachments
anaconda_error.png
anaconda_error.png (41.56 KiB) Viewed 499 times

User avatar
TrevorH
Forum Moderator
Posts: 25548
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Anaconda installs packages with an incorrect order

Post by TrevorH » 2019/04/18 13:00:45

Can you reproduce this with the 7.6 media as supplied by CentOS (not rebuilt)?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
moradiv
Posts: 20
Joined: 2019/04/18 09:34:53

Re: Anaconda installs packages with an incorrect order

Post by moradiv » 2019/04/18 13:38:51

Thank you for your reply,
My organization's product is based on CentOS 7.5, and currently all its packages, features and tests are running on it. We will upgrade the OS in the future, but right now it is based on 7.5 which started having this issue about 4 months ago. I didn't find any related change that might cause it.
The awkward thing is that it happens only to about 40% of our created images.
Let's say package ZZZ supposed to be installed and has in its spec file "requires: YYY" - on some of the images anaconda will install it in the right order (first YYY and then ZZZ). but on other, anaconda installs ZZZ before YYY is installed - which causes the package and anaconda to fail.

User avatar
TrevorH
Forum Moderator
Posts: 25548
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Anaconda installs packages with an incorrect order

Post by TrevorH » 2019/04/18 13:44:24

CentOS 7.5 is unsupported and has had no updates since the release of 7.6 over 6 months ago. It is not safe to use.

We do not support home-spun media at all. If you cannot recreate this with the standard media then it's your problem not ours.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
remirepo
Posts: 327
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: Anaconda installs packages with an incorrect order

Post by remirepo » 2019/04/18 14:19:39

> Let's say package ZZZ supposed to be installed and has in its spec file "requires: YYY" - on some of the images anaconda will install it in the right order (first YYY and then ZZZ). but on other, anaconda installs ZZZ before YYY is installed - which causes the package and anaconda to fail.

Probably you need Requires(pre): YYY
Remi's Repository - Forum - Blog

User avatar
moradiv
Posts: 20
Joined: 2019/04/18 09:34:53

Re: Anaconda installs packages with an incorrect order

Post by moradiv » 2019/04/18 14:41:25

Thanks you for the response,
I also tried that solution or using "Requires (pre)", and it didn't work :(
I mean it has the same behavior - anaconda skips the requirements just on about 40% of the created iso files.

aks
Posts: 2706
Joined: 2014/09/20 11:22:14

Re: Anaconda installs packages with an incorrect order

Post by aks » 2019/04/18 18:56:00

Post your spec file, at least then we may get some insight.

User avatar
moradiv
Posts: 20
Joined: 2019/04/18 09:34:53

Re: Anaconda installs packages with an incorrect order

Post by moradiv » 2019/04/21 06:36:34

This is the RPM spec:

Code: Select all

%define __os_install_post    \
    /usr/lib/rpm/redhat/brp-compress \
    %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}} \
    /usr/lib/rpm/redhat/brp-strip-static-archive %{__strip} \
    /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
    /usr/lib/rpm/brp-python-bytecompile \
%{nil}

Summary:	My rpm
Name:		MyRpm
Version:	%version
Release:	1
License:	Commercial
Group:		Applications/Internet
Requires:	sed coreutils shadow-utils coreutils util-linux sudo YYY
Requires(pre):	/usr/bin/sudo /usr/bin/su /bin/echo /usr/sbin/groupadd /usr/sbin/useradd /bin/cp /opt/YYY/YYY_created_file
Prefix:		%{server_base}
BuildArch:  noarch

%description
My RPM installation

%pre
. /etc/profile.d/YYY.sh
module_include YYY_module
# Do some pre stuff ...

%post
# Do some post stuff ...

%preun

# Pre Uninstall stuff ...

%postun
# Removing users/mounts and other stuff ...

%files
%defattr(-,myuser,myuser)
%{server_base}
%config(noreplace) %{server_base}/%{name}/conf/*
%config(noreplace) %{server_base}/%{name}/keystores/*
%config(noreplace) %{server_base}/%{name}/properties 
On the installation issue that, this RPM is installed before YYY rpm is installed. The RPM installation fails within the "pre" stage, where loading /etc/profile.d/YYY.sh which does not exist.
One of the things I tried is adding the YYY rpm name into "Requires(pre)". When it didn't help I also tried specifying one of the YYY's file into "Requires(pre)".
Note that this issue occurs only on 40% of the created ISO files, on the other 60% the installation order is correct.

Thanks in advance for the help.

User avatar
moradiv
Posts: 20
Joined: 2019/04/18 09:34:53

Re: Anaconda installs packages with an incorrect order

Post by moradiv » 2019/04/22 07:29:57

Any idea why it happens?

aks
Posts: 2706
Joined: 2014/09/20 11:22:14

Re: Anaconda installs packages with an incorrect order

Post by aks » 2019/04/22 08:12:27

Off the bat, don't specify your Requires as a list of files, provide package names. If the file (say /bin/sudo) exists, that is satisfied, regardless if all the libraries and so on are there. Enforce ordering with mandating that the critical (YYY as you call it) package is installed in the spec for package ZZZ.

Have a look at https://docs.fedoraproject.org/en-US/pa ... criptlets/ for order of execution and https://rpm.org/user_doc/dependencies.html for dependencies with versioning.

Post Reply