This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/plugins/dpkg/functions/apt-copy
2012-01-23 20:40:57 -05:00

10 lines
337 B
Plaintext

# 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