Linux - GeneralThis 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.
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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?
Distribution: pclos2015, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
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\ "
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.
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..