Backing up your package list WAS screen resolution problems with Hardy Herron
Owen Townend
owen.townend at gmail.com
Sun Sep 28 18:22:39 UTC 2008
2008/9/29 NoOp <glgxg at sbcglobal.net>:
> On 09/28/2008 06:54 AM, Owen Townend wrote:
[snip]
>>
>> Great, it's now even less complex.
>> $ aptitude search '~i!~M' -F '%p' > ${aptlist}
>> I'm sure I got the inverse syntax expression from an earlier post
>> around here but googling for '!(!~i|~M)' is no easy thing.
>>
>> cheers,
>> Owen.
>>
>> P.S.
>> The ~M matches _automatically_ installed packages.
>>
>
> Tried it:
>
> $ aptitude search '~i!~M' -F '%p' > ${aptlist}
> bash: ${aptlist}: ambiguous redirect
'${aptlist}' is a placeholder for the file you want to redirect to.
In my case it is a shell variable I've set in a cron script and the
config is earlier in the script:
aptlist=/etc/apt/installed_packages.txt
>
> $ aptitude search '~i!~M' -F '%p' > aptlist.txt
> works.
>
> for dpkg --get-selections > installed_apps.txt, you might want to try:
>
> dpkg --get-selections "*" >myselections
>
> "*" makes myselections include package entries for "purge" too.
aptitude has '~c' for the same function.
>
> and then use meld to show the differences between installed_apps.txt and
> myselections. Note: you can also do a comaparison between aptlist.txt
> and myselections just to see the difference, but they are not comparable
> files so it will drive meld nuts for awhile trying to mark diffs.
You could add '%C' to the aptitude format string to get something
closer to the dpkg output.
You would then be able to munge the two to be alike if you wanted to:
$ aptitude search '~i!~M|~c' -F '%p%C' > aptlist.txt
cheers,
Owen.
>
> ref:
> http://www.debian.org/doc/manuals/quick-reference/ch-package.en.html#s-record
> [3.4.9 Record/copy system configuration]
More information about the ubuntu-users
mailing list