1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-24 00:16:47 +00:00
prezto/plugins/dpkg/functions/apt-copy

10 lines
337 B
Plaintext
Raw Normal View History

2011-10-12 03:13:58 +00:00
# Create a simple script that can be used to 'duplicate' a system.
print '#!/bin/sh'"\n" > apt-copy.sh
list=$(perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;')
print 'aptitude install '"$list\n" >> apt-copy.sh
chmod +x apt-copy.sh