Backing up your package list WAS screen resolution problems with Hardy Herron
NoOp
glgxg at sbcglobal.net
Sun Sep 28 19:20:01 UTC 2008
On 09/28/2008 11:22 AM, Owen Townend wrote:
> 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
Cool! That identifies the config files. Interesting status when I
compare to myselections - example:
aptlist.txt:
cupsys-pt config-file
myselections:
cupsys-pt deinstall
cupsys-driver-gimpprint purge
~$ locate cupsys-pt
/var/lib/dpkg/info/cupsys-pt.list
/var/lib/dpkg/info/cupsys-pt.postrm
And of course cupsys-driver-gimpprint is not found because it's been purged.
More information about the ubuntu-users
mailing list