Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: How does zypper configure from rpm?

  1. #11
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,669

    Default Re: How does zypper configure from rpm?

    Quote Originally Posted by kitman View Post

    1. Adding a repo (easy)
    2. How does yast/zypper read the various files in the repo?
    3. Does yast/zypper access the source rpm at the same time to get the spec file when installing a program?
    4. When do the databases in /var/lib/rpm get updated and by what files.
    5. How does yast/zypper detect an updated program? (from the https://download.opensuse.org/update/... site?)
    6. too many questions


    Just put this down to curiosity rather than a problem.

    Thanks again,
    Chris.
    WARNING: the following is an "AFAIK educated guess" open to correction by those that really know how things are done. Use it only as a starting point if you have nothing better than this.


    1. Adding a repo (easy)
    2. How does yast/zypper read the various files in the repo?
      Starts from the metadata in https://download.opensuse.org/update.../oss/repodata/ the main file being xxxx-primary.xml.gz
      A local copy is stored at /var/cache/zypp/raw/repo-update/repodata
      If need be, the metadata tells what is available for download and where to find it.
    3. Does yast/zypper access the source rpm at the same time to get the spec file when installing a program?
      No, unless you actually installed the source files of course.
    4. When do the databases in /var/lib/rpm get updated and by what files.
      I don't really know, but apparently most files there get updated when you update your system.
    5. How does yast/zypper detect an updated program? (from the https://download.opensuse.org/update/... site?)
      When the metadata shows that a newer version is available compared to what is actually installed on the system.
    6. too many questions
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

  2. #12
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,890

    Default Re: How does zypper configure from rpm?

    As an addition, I suggest that you try to understand the difference between RPM packages and the tool rpm that manages them and zypper. You can see zypper as one step higher above rpm.

    E.g. when you install a package with rpm, it will install it. But when you install it with zypper, zypper will check for the dependencies mentioned in the package and automatic add them to the list of packages to be installed (it will tel you you though to give you the opportunity to bail out). Zypper will detect conflicts (and offer you solutions), etc.

    (I talk about zypper here, but the same about YaST > Software management. Both are user interfaces to zypplib, the real workhorse).
    Henk van Velden

  3. #13

    Default Re: How does zypper configure from rpm?

    On 09/01/2018 09:16 PM, kitman wrote:
    >
    > Hi all and thank you for the replies. Using the rpm switch --scripts
    > does indeed show me the spec file pre and post install scriptlet that I
    > was after:
    >
    >
    > Code:
    > --------------------
    > chris@asus-rog:~> rpm -q --scripts lightdm
    > preinstall scriptlet (using /bin/sh):
    > /usr/sbin/groupadd -r lightdm 2> /dev/null || :
    > /usr/sbin/useradd -r -g lightdm -s /bin/false -c "LightDM daemon" \
    > -d /var/lib/lightdm lightdm 2> /dev/null || :
    > postinstall scriptlet (using /bin/sh):
    > # Special trick: migrate users from lxdm to lightdm
    > # see https://lists.opensuse.org/opensuse-.../msg00417.html
    > . /etc/sysconfig/displaymanager
    > if [ -z "$DISPLAYMANAGER" -o "$DISPLAYMANAGER" = "lxdm" ] ; then
    > sed -i 's/^DISPLAYMANAGER=".*"/DISPLAYMANAGER="lightdm"/' /etc/sysconfig/displaymanager
    > fi
    > postuninstall scriptlet (using /bin/sh):
    > if [ "$1" -eq 0 ]; then
    > . /etc/sysconfig/displaymanager
    > if [ "$DISPLAYMANAGER" == "lightdm" ] ; then
    > sed -i 's/^DISPLAYMANAGER="lightdm"/DISPLAYMANAGER=""/' /etc/sysconfig/displaymanager
    > fi
    > fi
    > --------------------
    >
    > However it only works for installed packages. When I tried to examine
    > the sddm package that I only downloaded I got :
    >
    >
    > Code:
    > --------------------
    > chris@asus-rog:~> rpm -q --scripts sddm-0.17.0-lp150.8.1.x86_64.rpm
    > package sddm-0.17.0-lp150.8.1.x86_64.rpm is not installed
    > chris@asus-rog:~> ls sddm*
    > sddm-0.17.0-lp150.8.1.x86_64.rpm
    > chris@asus-rog:~>
    > --------------------


    No, the reason this did not work as you expected is because you did not
    tell the 'rpm' command to point to a particular file, but instead told it
    to look for a package named sddm-0.17.0-lp150.8.1.x86_64.rpm because you
    did not tell it to look for a package file with the -p option; assuming
    the package is in your current working directory, use this command:

    Code:
    rpm -q --scripts -p sddm-0.17.0-lp150.8.1.x86_64.rpm
    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

  4. #14
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,669

    Default Re: How does zypper configure from rpm?

    Quote Originally Posted by ab View Post

    No, the reason this did not work as you expected is because you did not
    tell the 'rpm' command to point to a particular file, but instead told it
    to look for a package named sddm-0.17.0-lp150.8.1.x86_64.rpm because you
    did not tell it to look for a package file with the -p option; assuming
    the package is in your current working directory, use this command:

    Code:
    rpm -q --scripts -p sddm-0.17.0-lp150.8.1.x86_64.rpm
    Sorry, possibly my fault: the 4.14.1 version of rpm in LEAP 15.0 apparently does not need the -p option when the full filename is specified, while it prints info about the installed package when only the package name (e.g. "sddm") is issued.
    Maybe the OP is running LEAP 42.x or uses an older version of rpm.
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

  5. #15

    Default Re: How does zypper configure from rpm?

    On 09/03/2018 07:46 AM, OrsoBruno wrote:
    >
    > Sorry, possibly my fault: the 4.14.1 version of rpm in LEAP 15.0
    > apparently does not need the -p option when the full filename is
    > specified, while it prints info about the installed package when only
    > the package name (e.g. "sddm") is issued.
    > Maybe the OP is running LEAP 42.x or uses an older version of rpm.


    That was my guess too, especially after some others' examples where it did
    work magically finding that package; seems like a reasonable enhancement,
    assuming the package is not already installed, as that is something I've
    had to explain to folks about a million times, and that is how my
    older-than-Leap-15 laptop works.

    --
    Good luck.

    If you find this post helpful and are logged into the web interface,
    show your appreciation and click on the star below.

    If you want to send me a private message, please let me know in the
    forum as I do not use the web interface often.

  6. #16

    Default Re: How does zypper configure from rpm?

    Hi,

    I believe I have nutted this out from your respective answers. I also had a gross misunderstanding on rpm contents.

    1. The downloaded rpm file does in fact contain the scripts. When I initially inspected a manually downloaded rpm file the default application to open it was ark archiver. This does list the file contents to install but I learned from the rpm.org web site that the rpm file structure is not a straight forward archive. That is, other details like specs/scripts are not shown in ark. This is why I was asking the original question.

    2. All details of installed rpms are located in various databases under /var/lib/rpm after the rpms are installed then deleted from /var/cache/zypp/. Don't touch

    3. Yes, I did find the -p switch to open a rpm file directly.

    4, Yes, I was testing on a Leap15.0 laptop AND a Leap42.3 desktop so maybe that's why we got slightly different results.

    5. Zypper/libzypp and rpm are two separate applications that don't call on each other. But both do use the /var/lib/rpm databases.

    So all good now and I thank you for your replies.
    Chris.

  7. #17
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,890

    Default Re: How does zypper configure from rpm?

    Quote Originally Posted by kitman View Post
    When I initially inspected a manually downloaded rpm file the default application to open it was ark archiver. This does list the file contents to install but I learned from the rpm.org web site that the rpm file structure is not a straight forward archive. That is, other details like specs/scripts are not shown in ark. This is why I was asking the original question.
    Maybe I am repeating myself (I am sure I am in general, but maybe even in this thread).
    You told us your conclusion (I can not find the scripts), but you failed to tell us what you did to try to find them (by copy/paste of your trial between CODE tags in the post).

    On the change to be accused of being unfriendly: this was useless. Nobody can give any sound technical answer on such a "conclusion". Answers that come to my mind in such a case differ from "did you switch on the system and let it boot" to " was your glass globe broken" and anything before, between and after that.

    I often skip such threads to go for more promising ones.

    As one member her once said: "We are non-believers, we want to see computer facts".

    Next time better, because you want to learn and understand things, what is something we love.
    Henk van Velden

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •