[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: aptitude: set all packages auto-installed except given list?



On Sat, Jan 15, 2011 at 12:25 PM, Javier Barroso <javibarroso@gmail.com> wrote:
> Hi,
>
> On Sat, Jan 15, 2011 at 12:01 PM, Andrei Popescu
> <andreimpopescu@gmail.com> wrote:
>> Hi,
>>
>> My usual method of 'cleaning' the system was to set all installed
>> packages to auto-installed and then mark one by one the ones I need to
>> keep. I even have a good list generated with:
>>
>> aptitude -F '%?p' search '~i!~M' > bak/pkg.list
>>
>> Now the problem I'm facing is that (probably due to some aptitude bug
>> than seems to have disappeared) most of my installed packages are set to
>> manually installed. How can I:
>>
>> - set everything to auto-installed
>> - automatically mark as manually installed the ones in the list
>>
>> ?
>>
>> I already tried (as root):
>>
>>    aptitude markauto ~i
> Maybe, I don't known if command line length limit imposed by bash will
> let to do it:
>
> Generate an string like:
>
> aptitude markauto  '~i!~n^package1$!~n^package2$'
>
> If you have a packages.txt file with a package by line, do it with awk:
>
> aptitude markauto '~i'$(awk '{printf "!~n^"$1"$";}' packages.txt)
>
> And a similar trick marking these packages like manual installed.
Maybe essential packages should be installed no auto (add !~E to expression)


Reply to: