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.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
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\ "
.....
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..
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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.