Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
list all my installed packages for an easy reinstall?
list all my installed packages for an easy reinstall?
Is it possible for me to list all my currently installed packages (that is those that didn't come with the base system) so that I can do a reinstall and make single '# aptitude install package-a package-b package-c ... package-x' to rapidly restore the old system? Doing a 'dpkg -l | less' will show all packages including those that came w/ the base system. Is there a way one can somehow sort the packages by installed date/time?
If you want to rapidly restore the old system why do you want individual packages?
Take a look at aptitude-create-state-bundle.
There's no way, that I know of, to easily sort by installed date/time (but I also haven't tried). But that also wouldn't solve the problem of initially installed packages since they could have been updated/replaced since then.
Take a look at aptitude-create-state-bundle.
There's no way, that I know of, to easily sort by installed date/time (but I also haven't tried). But that also wouldn't solve the problem of initially installed packages since they could have been updated/replaced since then.
-
- Posts: 1137
- Joined: 2007-07-24 03:31
- Location: California
From #debian:
Code: Select all
<dpkg> One method of cloning debian installs is to take a current debian machine that is setup with the packages you want and run the command "dpkg --get-selections > ~/selectionfile". Then, after the base install on other machines use that file and do: "dpkg --set-selections < ./selectionfile && apt-get dselect-upgrade". Also ask me about <aptitude clone><reinstall><things to backup>
<dmoerner> aptitude clone
<dpkg> To clone a Debian machine using aptitude (or install your favourite packages) use aptitude search -F '%100p' '~i!~M' > package_list; on the reference machine; xargs aptitude --schedule-only install < package_list; aptitude install; on the other machine. This preserve information about "automatically installed" packages that other methods do not. See also <reinstall><things to backup>
-
- Posts: 1137
- Joined: 2007-07-24 03:31
- Location: California
@ic - I gave it a try and got a huge list of packages - way more than I installed myself:
Code: Select all
$ aptitude search -F '%100p' '~i!~M'
Maybe not a very serious suggestion (i am not even sure the logs are kept forever), but for a crude way to get a list of the packages you have manually installed with aptitude you can grep the logs with something like
I am sure someone can cook up a script that takes REMOVE actions into consideration and also filter out everything except the package names.
Code: Select all
zcat /var/log/aptitude.* | grep INSTALL] && cat /var/log/aptitude| grep INSTALL]
-
- Posts: 709
- Joined: 2005-09-15 20:37
- Location: North by Northwest
Perhaps I'm unclear what you're trying to accomplish, but having already installed packages in your package list really isn't going to hurt anything when you go to do this 'reinstall' of packages added since the initial, basic installation -- apt-get will simply skip over the ones already installed, unless newer versions are available.
So ... here's how I would do it. As root, run the following:
This will produce a nice, clean list of installed packages, perfect for 'cat'-ing to apt-get.
.
So ... here's how I would do it. As root, run the following:
Code: Select all
# dpkg --get-selections | sed 's/install//' | expand | sed 's/ //g' > packages-list.txt
.
For an apt-get method (as opposed to aptitude-create-state-bundle) I have this in my notes:
To make a local copy of the package selection states:
$ dpkg --get-selections "*" >myselections
"*" makes myselections include package entries for "purge" too.
You transfer this file to another computer, and install it there with:
# apt-get update
# dpkg --clear-selections
# dpkg --set-selections <myselections
# apt-get -u dselect-upgrade
You can save the list of automatically installed packages on the old
system:
aptitude -F '%p' search '~M' > auto-packages.txt
Then this should work on the new system:
aptitude markauto $(cat auto-packages.txt)
To make a local copy of the package selection states:
$ dpkg --get-selections "*" >myselections
"*" makes myselections include package entries for "purge" too.
You transfer this file to another computer, and install it there with:
# apt-get update
# dpkg --clear-selections
# dpkg --set-selections <myselections
# apt-get -u dselect-upgrade
You can save the list of automatically installed packages on the old
system:
aptitude -F '%p' search '~M' > auto-packages.txt
Then this should work on the new system:
aptitude markauto $(cat auto-packages.txt)