LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-12-2009, 09:31 AM   #1
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Rep: Reputation: 31
Question Showing last packages installed with dpkg


Hi

When i use redhat-based systems i use rpm --last | head -10 to show the last 10 installed packages to the system.. but when im using debian i cant find any such command like "--last" to use.. i can take a look at /var/log/dpkg.log but then i have to scroll up and down and it also shows all dependencies to the packages making it a little hard to see which packages that were actually installed.

Does someone know, by using the command-line, how to show the last X packages installed to the system like i can easily do with "rpm --last" in redhat-based systems?

Thanks for any help.


--
chris
 
Old 12-12-2009, 04:21 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,539

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
Debian based ....

1) "dpkg info"
ls -tl /var/lib/dpkg/info/ | less
ls -tl /var/lib/dpkg/info/ | grep list > installed-packages.txt
.....

2) dpkg log
# cat /var/log/dpkg.log | grep "\ installed\ "
The file with the latest packages, installed is /var/log/dpkg.log
The next file in the 'history' is 'dpkg.log1'
And further back the files are e.g. 'dpkg.log2.gz' and readable
with : zcat /var/log/dpkg.log.2.gz | grep "\ installed\ "
.....

Last edited by knudfl; 12-12-2009 at 04:23 PM.
 
Old 12-13-2009, 03:48 PM   #3
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
Thanks for your answer but if you read what i wrote i specifically said that i didnt want to grep and look in logs like that.. i just wanted a command like "rpm --last" on debian..
 
Old 12-13-2009, 05:29 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,627

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
So make an alias for it.
 
1 members found this post helpful.
Old 12-14-2009, 12:27 PM   #5
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
not good enough, when debian is as good as it is i find it very strange that they dont have this functionality
 
Old 12-14-2009, 01:16 PM   #6
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,627

Rep: Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518Reputation: 518
I took a look at the man pages of dpkg and dpkg-query (as I assume you did) and it doesn't look like install date is even stored anywhere.

I'm sorry that you refuse to use the solution provided to you. Also, different distributions do things differently; I'm sorry you feel that things should be identical. Perhaps you'd care to write the code?

Last edited by AlucardZero; 12-14-2009 at 01:17 PM.
 
Old 12-14-2009, 01:58 PM   #7
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
yes i did search around and read on the man pthes.. well i think redhats feature is nice to have and it is especially nice when something is broken and you need to see what was last installed. i did at least find /var/log/aptitude to be quite usefull if you are using this package management utility. i guess i have to use the logs until someone decides that they also need this kind of feature.. when it comes to program it myself i find it a little waste of time when i can just check the logs.. i guess im just becoming a little lazy these days for some reason. thanks for your help.

to avoid start another thread, i was wondering if you guys knew how to change aptitude' default install location.. i didnt allocate enought space on / and need to use a symlink to /home/<username>/usr for now.. i read in the aptitude reference manual without finding anything about this..
 
Old 12-16-2009, 03:14 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,539

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
I really don't see the big difference ..

ls -tl /var/lib/dpkg/info/ | head -10

.. will provide a similar result to ..
rpm -qa --last | head -10

The rpm listing is also a kind of alias for a complex
mechanism looking into a binary data base in /var/,
and presenting it in a readable listing.

So for a simpler command : make an alias, please.

Or make a symlink from /var/lib/dpkg/info/ to /home/'user'.

.. Then 'ls -tl info | head -10'
.. will do the trick.
.....

Last edited by knudfl; 12-16-2009 at 08:00 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Freezing the system. Packages error. sudo dpkg --configure -a kombez Linux - Newbie 1 09-03-2009 01:31 PM
Help using dpkg to build and install debian packages Mahonri Linux - General 1 07-24-2007 09:44 AM
Sort installed packages by # of dependant packages installed brianez21 Debian 1 01-18-2006 05:06 PM
How to list all installed packages that can be reconfigured with dpkg-reconfigure? Akhran Linux - Newbie 1 11-24-2005 07:25 PM
using dpkg to install packages for wrong architecture linuxmandrake Linux - General 2 09-23-2005 04:22 AM


All times are GMT -5. The time now is 02:02 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration