Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How to check which repository provided package

  1. #1

    Default How to check which repository provided package

    I am sorry if this has been asked before, but I could not find anything on it. My question is: How do you check the repository which provided a package using the zypper command ?

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,005

    Default Re: How to check which repository provided package

    You mean you can not find this in
    Code:
    man zypper
    Henk van Velden

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to check which repository provided package

    On 2014-09-17 09:26, hcvv wrote:
    >
    > You mean you can not find this in
    >
    > Code:
    > --------------------
    > man zypper
    > --------------------


    Mmmm...


    There is this:

    Code:
    Telcontar:~ # zypper --no-refresh info man
    Loading repository data...
    Reading installed packages...
    
    
    Information for package man:
    ----------------------------
    Repository: openSUSE-13.1-Oss    <======
    Name: man
    Version: 2.6.3-9.1.3
    Arch: x86_64
    Vendor: openSUSE
    Installed: Yes
    Status: up-to-date
    Installed Size: 1.8 MiB
    Summary: A Program for Displaying man Pages
    Description:
    A program for displaying man pages on the screen or sending them to a
    printer (using groff).
    Telcontar:~ #

    But that is far from usable, as a query. I do not know how to simply
    produce a list of packages and the repos they came from.

    The rpm database query does not keep that information, as far as I know;
    but it could be I don't know what tag they use, if they use any.

    Code:
    cer@Telcontar:~> rpm --querytags | grep -i repo
    cer@Telcontar:~>

    For some repos, it can be deduced from the "vendor" field, like packman,
    which uses "http://packman.links2linux.de", or wine, which uses
    "obs://build.opensuse.org/Emulators".

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,146
    Blog Entries
    2

    Default Re: How to check which repository provided package

    To display a package's origins and information
    Code:
    zypper info packagename
    So, for instance in Carlos' example above the repo that package came from is the OSS repo.

    TSU

  5. #5
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,677
    Blog Entries
    15

    Default Re: How to check which repository provided package

    Hi
    Here is a way to find packages installed by repository;

    Code:
    zypper pa -iR |grep `zypper lr -a XX|grep Name|cut -f2 -d":"|sed -e 's/^[ \t]*//'|cut -f1-2 -d " "`
    Where XX is the repostory number (#)via zypper lr. If you don't use -iR but just -R it will show all packages in the repo...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,705

    Default Re: How to check which repository provided package

    The question is a bit badly phrased. Did you want to know how to find an arbitrary package and which repo has it? zypper and rpm will only tell you installed packages and packages in active repos. If you want to find an arbitrary package that may not be in standard repos you use the web

    http://software.opensuse.org/search

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to check which repository provided package

    On 2014-09-17 18:36, malcolmlewis wrote:
    >
    > Hi
    > Here is a way to find packages installed by repository;
    >
    >
    > Code:
    > --------------------
    >
    > zypper pa -iR |grep `zypper lr -a *XX*|grep Name|cut -f2 -d":"|sed -e 's/^[ \t]*//'|cut -f1-2 -d " "`
    >
    > --------------------
    >
    > Where *XX* is the repostory number (#)via zypper lr. If you don't use
    > -iR but just -R it will show all packages in the repo...


    Quite complex... I'll try later, thanks.

    Pity the "rpm" command can not provide that info in "querytags".

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  8. #8
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to check which repository provided package

    On 2014-09-17 18:36, gogalthorp wrote:
    >
    > The question is a bit badly phrased. Did you want to know how to find an
    > arbitrary package and which repo has it? zypper and rpm will only tell
    > you installed packages and packages in active repos.


    I understand he wants to know where an already installed package came
    from. I'll check malcolmlewis idea later, it may be what /I/ want.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  9. #9
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,677
    Blog Entries
    15

    Default Re: How to check which repository provided package

    On Wed 17 Sep 2014 05:33:06 PM CDT, Carlos E. R. wrote:

    On 2014-09-17 18:36, malcolmlewis wrote:
    >
    > Hi
    > Here is a way to find packages installed by repository;
    >
    >
    > Code:
    > --------------------
    >
    > zypper pa -iR |grep `zypper lr -a *XX*|grep Name|cut -f2 -d":"|sed
    > -e 's/^[ \t]*//'|cut -f1-2 -d " "`
    > --------------------
    >
    > Where *XX* is the repostory number (#)via zypper lr. If you don't use
    > -iR but just -R it will show all packages in the repo...


    Quite complex... I'll try later, thanks.

    Pity the "rpm" command can not provide that info in "querytags".

    Hi
    OK so you can use -r to specify the repository, eg;
    Code:
    zypper pa -r 11 -iR|grep -e "bash"
    
    i | openSUSE 13.1 | bash                                       | 4.2-68.1.5                      | x86_64
    i | openSUSE 13.1 | bash-doc                                   | 4.2-68.1.5                      | noarch
    I'm sure some additional tweaks with grep/sed etc would help....

    --
    Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.1 Kernel 3.11.10-21-desktop
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  10. #10

    Default Re: How to check which repository provided package

    Code:
    zypper --no-refresh se -si | awk '/bash/'
    Some pretty format

    Code:
    zypper --no-refresh se -si | awk '/bash/{printf("%-20s %s\n", $3,$NF)}'

    This function might be useful if you want to have some kind of shortcut for checking your package.

    Code:
    CheckPackage(){
      zypper --no-refresh se -si | awk -v pattern="$1" '$1 ~ /^[Si-]/ && $3 ~ pattern {printf("%-25s %-20s %s\n", $3,$7,$NF)}'
    }
    I have given it a CheckPackage function name, you can name it to your own hearts content .
    Put that code in your ~/.bashrc or some place you have your own functions. After that you can just run

    Code:
    CheckPackage «packagename»
    To check for a specific package

    ie

    Code:
    CheckPackage bash
    or

    Code:
    CheckPackage
    To show packages that are installed.

    I know the formatting sucks, feel free to modify though . Of course it will only print something if the package is installed, see

    Code:
    zypper help se
    for info about the zypper part.
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

Page 1 of 3 123 LastLast

Posting Permissions

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