Find all user-installed packages
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Popsicle Puzzles
--
Chapters
00:00 Find All User-Installed Packages
00:23 Accepted Answer Score 18
01:26 Answer 2 Score 13
01:50 Answer 3 Score 4
02:10 Answer 4 Score 2
02:35 Answer 5 Score 1
03:00 Thank you
--
Full question
https://superuser.com/questions/48374/fi...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#ubuntu #packagemanagement
#avk47
ACCEPTED ANSWER
Score 18
Look at these files,
- '
/var/log/installer/initial-status.gz
' -- your primary installation- this file date would be your installation date (i think)
- '
/var/log/dpkg.log
' update timeline (this is what you want) - '
/var/log/apt/term.log
' -- thingsapt
updated on your system - '
/var/cache/apt/archives/'
will contain thedeb
packages downloaded for installation
Update: use the following two steps for exact list of new installs:
- execute:
grep -w install /var/log/dpkg.log > full-list.log
- Look at lines beyond the
/var/log/installer/initial-status.gz
timestamp
Since you want to get a clean installation on another system with these packages, you could even copy the 'deb' files from the 'cache/apt/archives' path to that of the new installation and get them installed in one shot (without downloading them again).
ANSWER 2
Score 13
Just for grins, I put together a one-liner (here split for clarity) that figures out packages manually installed, excluding those installed initially and any packages automatically installed:
comm -13 \ <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort) \ <(comm -23 \ <(dpkg-query -W -f='${Package}\n' | sed 1d | sort) \ <(apt-mark showauto | sort) \ )
This works both in bash
and in zsh
.
ANSWER 3
Score 4
Based on the information above, I wrote a short Python script to list packages that were manually installed. See this link.
Feel free to use it although I assume no responsibility for it. However, feedback and suggestions are always welcome.
ANSWER 4
Score 2
Check my answer here to a related question: How can I display the list of all packages installed on my Debian system?. Some of the other answers on the question also contain nice suggestions on getting such a list.
This question should be marked a duplicate since the earlier question also covers this question, but it might be useful to have this question stand on its own so it's easier to find.
ANSWER 5
Score 1
This is a hack-job, but it completely works.
First, go to http://releases.ubuntu.com/maverick/ (or whatever version of Ubuntu you're using) and grab the *.manifest file
that is associated with the version of Ubuntu you're using.
Then, run the following script (replacing <manifest file>
, angle brackets and all, with the path to the file you downloaded. You can always append > output
to the end to make a file dump.
diff --suppress-common-lines <(sed 's/ .*//' <manifest file>) <(dpkg --get-selections | sed 's/[ \t].*//') | grep '>' | sed 's/[>] //'