maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   [pkcon] list packages and their repository (https://talk.maemo.org/showthread.php?t=93386)

magullo 2014-06-25 09:06

[pkcon] list packages and their repository
 
Hi hall, I think this is a question for TMO, so I try asking here.
I'd like to know if there's a way to list installed packages, grouped by their (eventual) own repository.
I installed a lot of things on my jolla, mainly via WareHouse but also by myself, and a lot of dependencies were installed as well.
Now I'd like to tidy things a bit, leaving only what is really needed.
So the question: can I understand what channel a package belongs to?
Thanks.

coderus 2014-06-25 09:42

Re: [pkcon] list packages and their repository
 
afaik you can't get "from" repo package was installed. you only can get "what" repo provide package

magullo 2014-06-25 09:52

Re: [pkcon] list packages and their repository
 
Quote:

Originally Posted by coderus (Post 1430947)
afaik you can't get "from" repo package was installed. you only can get "what" repo provide package

I looked in pkcon documentation, but could not find how. Which option does give "what"? Is it "what-provides"? It doesn't work...

Schturman 2014-06-25 16:55

Re: [pkcon] list packages and their repository
 
Quote:

Originally Posted by magullo (Post 1430948)
I looked in pkcon documentation, but could not find how. Which option does give "what"? Is it "what-provides"? It doesn't work...

Code:

zypper what-provides <package_name>
or to see only name of repo:
Code:

zypper what-provides <package_name>|tail -1|awk '{print $11}'

ilpianista 2016-01-20 19:17

Re: [pkcon] list packages and their repository
 
I made this script to list "foreign" packages (packages that are not in any repository).

Code:

#!/bin/sh

installed=($(pkcon get-packages --filter installed | tail -n +6 | awk '{print $2}'))

for pkg in ${installed[@]}; do
  # <pkgname-version-relversion.arch>
  pkgname=${pkg%-*-*.*}

  echo -n "Looking for ${pkgname}..."
  count=$(pkcon search name ${pkgname} | wc -l)
  if [[ ${count} = 7 ]]; then
    echo " NOT FOUND"
    missing="${missing} ${pkgname}"
  else
    echo " OK"
  fi
done

[[ -n ${missing} ]] && echo "pkcon cannot find these packages: ${missing}"



All times are GMT. The time now is 20:16.

vBulletin® Version 3.8.8