Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
List of explicitly 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
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 388

PostPosted: Sun Oct 15, 2017 9:24 am    Post subject: List of explicitly installed packages Reply with quote

Is there a way to get a list of explicitly installed packages between two dates or after a date i.e packages which were added to the world files?
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 766

PostPosted: Sun Oct 15, 2017 10:46 am    Post subject: Reply with quote

File dates in /var/db/pkg reflect the latest ebuild

Code:
find /var/db/pkg -iname *ebuild -ctime +3 -ctime -16


That shows the ebuilds performed more than 3 days ago, fewer than 16 days ago. It makes no reference to the world file.

A different `find` command can be used to show all the ebuilds added after /var/lib/portage/world was last changed.

Code:
find /var/db/pkg -iname *ebuild -cnewer /var/lib/portage/world


The eix man page shows this handy command as an example of what eix can do.

Code:
 eix '-I*' --format '<installedversions:DATESORT>' | sort -n | cut -f2-3


That shows the installed date of every package installed, with the list sorted in date order.
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4857
Location: Dark side of the mood

PostPosted: Sun Oct 15, 2017 11:09 am    Post subject: Reply with quote

@cboldt

That's a really cool feature, indeed! I'd add (because I've just looked up at eix help) to address yzg's request:
Code:
eix --world '-I*' --format '<installedversions:DATESORT>' | sort -n | cut -f2-3

to limit the search scope to those packages installed explicitly, as he asked. Am I good :wink: ?

EDIT: I guess one can use awk for filtering results between two dates, right?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 388

PostPosted: Sun Oct 15, 2017 1:17 pm    Post subject: Reply with quote

@cboldt, @VinzC

I agree it's a cool feature but the list includes the updates and dependencies.
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4857
Location: Dark side of the mood

PostPosted: Sun Oct 15, 2017 1:28 pm    Post subject: Reply with quote

yzg wrote:
@cboldt, @VinzC

I agree it's a cool feature but the list includes the updates and dependencies.

Just guessing:
Code:
eix --selected-file '-I*' --format '<installedversions:DATESORT>' | sort -n | cut -f2-3
maybe?

Have you taken a look at eix man pages and help?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 16499
Location: here

PostPosted: Sun Oct 15, 2017 1:44 pm    Post subject: Reply with quote

Also with genlop
Code:
$ sudo genlop --list --date 20171006 --date 20171015

_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 766

PostPosted: Sun Oct 15, 2017 4:31 pm    Post subject: Reply with quote

By "explicit" install, do you mean to limit your search to packages listed in the world file?

If so, you could use the "find" or "eix" list (this is the date limiting aspect) and check each package vs the world file (this would be the "explicitly installed" limiter), for example using `grep`
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 4439

PostPosted: Sun Oct 15, 2017 9:31 pm    Post subject: Reply with quote

Install gentoolkit: qlop -l -d '3 weeks ago' -d '2 weeks ago'
For only the ones you manually specified, you'd probably have to cross-reference with your .bash_history file.
_________________
*.ebuild // /etc/service/*
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 388

PostPosted: Mon Oct 16, 2017 12:03 pm    Post subject: Reply with quote

I guess what I'm looking for is something like
Code:

#At a start date you copied the world file
cp /var/lib/portage/world world_at_start_date

# Then, you installed a package
emerge -av x11-drivers/xf86-video-qxl

# Then many portage updates and individual package updates
emerge -auvDN world  or emerge -av1 some-package

# At anytime you can get the packages which were explicitly installed
diff world_at_start_date /var/lib/portage/world
418a419
> x11-drivers/xf86-video-qxl


But without having to remember to save copy of the world file at the start date.

Joining the output of eix command with the world file will help in removing the dependencies updates from the list but not the updates of existing world packages.
Code:

# join -1 3 -2 1 sorted_eix_list_output.txt /var/lib/portage/world


I started to think it cannot be done without saving copies of the world file.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 5888

PostPosted: Mon Oct 16, 2017 1:17 pm    Post subject: Reply with quote

fedeliallalinea gave you the answer
Code:
genlop --list --date (yourworldatstartdate) --date today
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 388

PostPosted: Tue Oct 17, 2017 3:48 am    Post subject: Reply with quote

@krinn, genlop is an answer but not the answer.

The output of the command is
Code:

# genlop --list --date 2017-10-13 --date today
...
...
...
     Sun Oct 15 16:52:06 2017 >>> kde-frameworks/kdelibs4support-5.39.0
     Sun Oct 15 16:53:16 2017 >>> kde-frameworks/knewstuff-5.39.0
     Sun Oct 15 17:10:55 2017 >>> kde-frameworks/kdelibs-4.14.37
     Sun Oct 15 17:11:29 2017 >>> kde-frameworks/qqc2-desktop-style-5.39.0
     Sun Oct 15 17:12:31 2017 >>> kde-frameworks/frameworkintegration-5.39.0
     Sun Oct 15 21:21:20 2017 >>> app-emulation/virtualbox-modules-5.1.28
     Sun Oct 15 21:25:58 2017 >>> x11-drivers/nvidia-drivers-387.12
     Sun Oct 15 23:47:44 2017 >>> x11-drivers/xf86-video-qxl-0.1.5
     Sun Oct 15 23:51:12 2017 >>> net-misc/wget-1.19.1-r1
     Mon Oct 16 22:17:19 2017 >>> net-misc/youtube-dl-2017.10.15.1
     Mon Oct 16 22:31:59 2017 >>> media-video/ffmpeg-3.4
     Mon Oct 16 22:32:48 2017 >>> kde-frameworks/qqc2-desktop-style-5.39.0


As you can see, I did not "explicitly" install kde-frameworks/kdelibs4support, kde-frameworks/knewstuff, .... These are the result of the regular update emerge -auvDN world.

The date in the list is the last update date. What I want is the install date. I do not think gentoo keeps this date anywhere.
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 16499
Location: here

PostPosted: Tue Oct 17, 2017 5:28 am    Post subject: Reply with quote

yzg wrote:
The date in the list is the last update date. What I want is the install date. I do not think gentoo keeps this date anywhere.

/var/log/emerge.log?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 5888

PostPosted: Tue Oct 17, 2017 6:55 am    Post subject: Reply with quote

yzg wrote:
@krinn, genlop is an answer but not the answer.
As you can see, I did not "explicitly" install kde-frameworks/kdelibs4support, kde-frameworks/knewstuff, .... These are the result of the regular update emerge -auvDN world.

Code:
 genlop  --list --date 2017-10-13 --date today | grep -f /var/lib/portage/world

That should more or less do the trick, because packages that doesn't appears in world like in genlop output will be miss (ie: package from overlay because cat/pkg::overlay != cat/pkg)
But you get the idea, genlop found the right list, upto you to filter it with uncommon cases.
Back to top
View user's profile Send private message
helecho
Apprentice
Apprentice


Joined: 26 Dec 2016
Posts: 202

PostPosted: Tue Oct 17, 2017 7:07 am    Post subject: Reply with quote

Ant P. wrote:
Install gentoolkit: qlop -l -d '3 weeks ago' -d '2 weeks ago'
For only the ones you manually specified, you'd probably have to cross-reference with your .bash_history file.

The Q applets are included in the app-portage/portage-utils package. Moreover, the "d" option of the qlop command does not exist for the stable version (0.62).
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 766

PostPosted: Tue Oct 17, 2017 12:29 pm    Post subject: Reply with quote

The only way to distinguish a "first install" from an update is by review of the logs or a surrogate of the portage logs, for example, a saved world file or command line history. This inability goes for packages named in an emerge command (I think this is what an "explicit install" is), as well as dependencies. The installed packages database has no file that relates the "installation history" for any package, if there is any history.

genlop gives a history of installations of any given package, but that inquiry only goes as far back as emerge.log does. Try `genlop gcc`

If one was to do a date-limited inquiry of package installs, it would report certain packages being installed. One could filter that to only packages that appear in the world file. This would still not tell us if a package was "explicitly installed." To learn that, one would have to know the entire install history for each package. Only those that had no history before the initial time-delimited window would meet the criteria of "explicitly installed."
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