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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-12-2009, 09:31 AM
|
#1
|
|
Member
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199
Rep:
|
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
|
|
|
|
12-12-2009, 04:21 PM
|
#2
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,618
|
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.
|
|
|
|
12-13-2009, 03:48 PM
|
#3
|
|
Member
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199
Original Poster
Rep:
|
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..
|
|
|
|
12-13-2009, 05:29 PM
|
#4
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
So make an alias for it.
|
|
|
1 members found this post helpful.
|
12-14-2009, 12:27 PM
|
#5
|
|
Member
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199
Original Poster
Rep:
|
not good enough, when debian is as good as it is i find it very strange that they dont have this functionality
|
|
|
|
12-14-2009, 01:16 PM
|
#6
|
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,474
|
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.
|
|
|
|
12-14-2009, 01:58 PM
|
#7
|
|
Member
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199
Original Poster
Rep:
|
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..
|
|
|
|
12-16-2009, 03:14 AM
|
#8
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,618
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:33 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|