Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How can I query for obsolete/outdated installed packages?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Flow__
n00b
n00b


Joined: 10 Jul 2007
Posts: 25

PostPosted: Fri Dec 07, 2012 4:12 pm    Post subject: How can I query for obsolete/outdated installed packages? Reply with quote

Installed packages sometimes become obsolete because the package got version bumped and the ebuild for the old version got dropped. Also it happens that packages are dropped completely from the tree (usually for a good reason). I'd like to query those packages in order to take the appropriate action (update, remove).

How to query installed packages that

1. have no ebuild for the current installed version; and
2. have no ebuild at all anymore (e.g. because it got deleted)


Last edited by Flow__ on Fri Dec 07, 2012 8:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Dec 07, 2012 7:38 pm    Post subject: Reply with quote

Code:
eix-test-obsolete

shows all these cases and more. For your particular cases you can also call eix more directly:
Code:
eix -te
TEST_FOR_REDUNDANCY=false eix -cT
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Dec 07, 2012 7:45 pm    Post subject: Reply with quote

If it's in world, you might see it once it will be broken with a complain by revdep-rebuild.
If it's not in world, you will see it selected by depclean to be removed.

I don't know a real way to see who is intall and now orphan (still for portage tree, as when install, portage keep a copy of the ebuild).

So it might only cause trouble if the package is in your world file, and if the package is broken. Other cases are handle by depclean or -u
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Dec 07, 2012 7:52 pm    Post subject: Reply with quote

krinn wrote:
So it might only cause trouble if the package is in your world file, and if the package is broken.

"only"? This is the worst case which can happen in a production system: You have lost an important package practically without a warning and cannot make it work again.
IMHO, portage should cry always if an ebuild for an installed package is nonexistent or masked and not replaced by a newer version.

At least eix-test-obsolete exists...
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Dec 07, 2012 8:20 pm    Post subject: Reply with quote

Nah mv, you are saying portage should be the admin of your server, you lazzy ass :)

Just like it would be dumb to rely on a production system to let portage update to a newest version just because it could. What will you tell to your boss ? "But i didn't broke it, portage found a new version and update it without telling me !"
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Fri Dec 07, 2012 8:58 pm    Post subject: Reply with quote

krinn wrote:
Nah mv, you are saying portage should be the admin of your server, you lazzy ass :)

Not admin but inform you about crucial changes as soon as they can be recognized from the database. It should be portage's job to care about the package database and not the user's job to track after every emerge --sync every single package. (Without eix-check-obsolete, the situation would be really horrible, and eix is not a system's tool).
Quote:
Just like it would be dumb to rely on a production system to let portage update to a newest version just because it could.

Wrong comparison: Portage tells you after emerge --sync if a new portage version is available but is not upgrading itself automatically.
Why does the same not happen in the much more important case of removed ebuilds?

I am not suggesting that portage should do something (like removing the packages), but it should inform you.
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Dec 07, 2012 8:59 pm    Post subject: Reply with quote

There's eix as mentioned above, and this is also built in to Paludis as the `cave report` command (which will also check and notify you of installed packages affected by GLSAs).
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Dec 08, 2012 12:52 am    Post subject: Reply with quote

portage-2.2 has the unavailable and unavailable-binaries sets that can be used. I'm not sure that those have been enabled in the current 2.1 series.

Code:
emerge --list-set

will list the built-in dynamically generated sets for your version of portage.

Also app-portage/porthole has a "Deprecated" view which breaks them down to ebuilds and packages that are not currently available in any installed tree/overlay.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Flow__
n00b
n00b


Joined: 10 Jul 2007
Posts: 25

PostPosted: Sat Dec 08, 2012 11:43 am    Post subject: Reply with quote

Thanks everybody, I really appreciate your input.

Everything comes pretty close, but

Code:
TEST_FOR_REDUNDANCY=false eix -cT eix -cT
and
Code:
eix-test-obsolete
shows more then just outdated/deleted ebuilds (for example downgrades)

Code:
emerge -p @unavailable
doesn't show the list of unavailable packages if a ebuild that would satisfy the conditions is masked. It simply aborts with a warning.

Code:
porthoole
comes pretty close but I can't use it within scripts. I need CLI power. :)

I really wonder why e.g. eix has not switch for these two cases...
Back to top
View user's profile Send private message
mv
Watchman
Watchman


Joined: 20 Apr 2005
Posts: 6747

PostPosted: Sat Dec 08, 2012 1:29 pm    Post subject: Reply with quote

Flow__ wrote:
I really wonder why e.g. eix has not switch for these two cases...

eix essentially can only show packages of its database. The point is that vanished packages are just not in the database. There is only the -t option which essentially only checks whether packages are still in the database.
Code:
TEST_FOR_REDUNDANCY=false eix -cT

Quote:
shows more then just outdated/deleted ebuilds (for example downgrades)

If the package was not completely removed, but only a partiular version was removed, this means exactly a downgrade or an upgrade, so this should list exactly the packages which you want (unless the package has completely vanished). For scripts you can add of course other eix options like --only-names.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Dec 08, 2012 2:53 pm    Post subject: Reply with quote

OK, for cli power... then what exactly are you trying to do? It matters for how the report is structured. I could probably quite easily add 2 reports to enalyze in gentoolkit. One for up/down-gradable where only the installed ebuild is no longer available. The other for whole packages that are no longer available.
Also, the cli-power you want, is your script(s) written in python? If so they would be able to use the python modules directly to get a list of atoms without needing to parse output.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Flow__
n00b
n00b


Joined: 10 Jul 2007
Posts: 25

PostPosted: Sat Dec 08, 2012 3:10 pm    Post subject: Reply with quote

dol-sen wrote:
OK, for cli power... then what exactly are you trying to do?


My basic ideas where:

When there is a installed package(-version) that has no ebuild any more (and optionally there is a higher stable version), then these package should be updated.

Also, if there is a installed package without any ebuilds anymore, then these should at least be reported, so that I can review the deletion reason and decide if I want to unmerge the package.
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Sat Dec 08, 2012 5:12 pm    Post subject: Reply with quote

Quote:
When there is a installed package(-version) that has no ebuild any more (and optionally there is a higher stable version), then these package should be updated


Just so you know, when a higher version ebuild is removed from the tree leaving a downgrade condition. It is usually because of security concerns or other major flaw. Portage use to long ago give you the option to only upgrade packages, not allow downgrades. But that caused other problems (as said above), so that option was removed for the current behavior.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
drwook
Veteran
Veteran


Joined: 30 Mar 2005
Posts: 1324
Location: London

PostPosted: Sat Dec 08, 2012 5:53 pm    Post subject: Reply with quote

I do occassionally miss -U though :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum