Re: [really solved] Re: aptitude: set all packages auto-installed except given list?
On Sun, Jan 16, 2011 at 02:27:50 +0200, Andrei Popescu wrote: On Du, 16 ian 11, 01:00:50, Javier Barroso wrote: When you invoke aptitude unmarkauto ... aptitude has all your packages with auto mark, so aptitude will want to delete these unused packages *before* it start with your operation (unmarkauto in this case). I think it make sense Well, '(un)mark' seems to be doing more than just (un)marking packages which is a bit counter-intuitive to me... I have the impression that the modification of auto flags prompts aptitude to search for unused packages and to schedule them for removal at the very least, if not to remove them right away. The persistence of scheduled actions would explain why aptitude tries to remove these packages when you invoke it a second time, even though you then mark them as non-auto. Another solution might be to use keep-all before unmarkauto. -- Regards,| Florian | http://www.florian-kulzer.eu -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20110116090621.GA6083@isar.localhost
Re: [really solved] Re: aptitude: set all packages auto-installed except given list?
On Du, 16 ian 11, 10:06:21, Florian Kulzer wrote: Another solution might be to use keep-all before unmarkauto. keep-all at that stage has an interesting effect: root@think:~# aptitude search '~i' | wc -l # just for reference 1578 root@think:~# aptitude -o Aptitude::Delete-Unused=false markauto ~i No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used. root@think:~# aptitude search '~i!~M' | wc -l # check that it worked 0 root@think:~# aptitude keep-all No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 3 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used. root@think:~# aptitude search '~i!~M' | wc -l 1463 At this point it obviously doesn't make sense to continue with 'unmarkauto'. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
aptitude: set all packages auto-installed except given list?
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 This will try to remove everything and I have to abort aptitude --schedule-only markauto ~i Seems to be doing the first part, but I can't convince aptitude to unmark my list (which I processed to not contain unneeded space and newlines): aptitude unmarkauto pkg.list has no effect aptitude install pkg.list first tries to remove everything and when I say 'n' it starts crunching on my processor. Any other suggestions? Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
Hi, On Sat, Jan 15, 2011 at 12:01 PM, Andrei Popescu andreimpope...@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. Regards, -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/AANLkTi=6td7emokzzg-1c1mpodf9a_u1niwtwx0zl...@mail.gmail.com
Re: aptitude: set all packages auto-installed except given list?
On Sat, Jan 15, 2011 at 12:25 PM, Javier Barroso javibarr...@gmail.com wrote: Hi, On Sat, Jan 15, 2011 at 12:01 PM, Andrei Popescu andreimpope...@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) -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/AANLkTikbgSNb=u=dwth-xz9ahqdv3pbpm6ov7xv3z...@mail.gmail.com
Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 12:25:26, Javier Barroso wrote: 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. Thanks, at a first glance that was enough. I just hoped for a solution that wouldn't involve such hacks. Unless somebody comes up with a cleaner solution I'll file a whishlist bug. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 12:29:15, Javier Barroso wrote: And a similar trick marking these packages like manual installed. Maybe essential packages should be installed no auto (add !~E to expression) Not needed since apt/aptitude will never auto-remove packages 'Essential: yes'. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
On Sat, Jan 15, 2011 at 13:01:30 +0200, Andrei Popescu wrote: [...] 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 This will try to remove everything and I have to abort aptitude --schedule-only markauto ~i Seems to be doing the first part, but I can't convince aptitude to unmark my list (which I processed to not contain unneeded space and newlines): aptitude unmarkauto pkg.list has no effect aptitude install pkg.list first tries to remove everything and when I say 'n' it starts crunching on my processor. Any other suggestions? aptitude --schedule-only unmarkauto $(cat pkg.list) is somewhat clumsy, but it seems to work here. I only tried a simple test case with a list of two packages, and I did not test if --schedule-only is really necessary. If your list of packages exceeds the maximum number of command line arguments then you have to split the file. Backticks should also work if you want to avoid the $(...) bashism. -- Regards,| Florian | http://www.florian-kulzer.eu -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20110115112307.GA3041@isar.localhost
Re: aptitude: set all packages auto-installed except given list?
On Sat, Jan 15, 2011 at 12:38 PM, Andrei Popescu andreimpope...@gmail.com wrote: On Sb, 15 ian 11, 12:25:26, Javier Barroso wrote: 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. Thanks, at a first glance that was enough. I just hoped for a solution that wouldn't involve such hacks. Unless somebody comes up with a cleaner solution I'll file a whishlist bug. Ok, I would like to hear Daniel (aptitude author) reply, aptitude development seems to be in standby :(, I hope squeeze freeze be the reason ... -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/aanlktinmfseafsj2zvzy+7wyz2cnz3_ndyxb9cavz...@mail.gmail.com
[Solved] Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 12:23:07, Florian Kulzer wrote: Any other suggestions? aptitude --schedule-only unmarkauto $(cat pkg.list) Do you mean after a '--schedule-only markauto ~i'? Hmm, let's try... Nope, not what I needed. But the solution seems to be: aptitude --schedule-only markauto ~i aptitude --schedule-only install $(cat pkg.list) Didn't think of trying with --schedule-only Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
Florian Kulzer: […] Backticks should also work if you want to avoid the $(...) bashism. That's not a bashism, it's perfectly legal POSIX/SUS. http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03 J. -- In this bunker there are women and children. There are no weapons. [Agree] [Disagree] http://www.slowlydownward.com/NODATA/data_enter2.html signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
Le samedi 15 janvier, Florian Kulzer écrivit : On Sat, Jan 15, 2011 at 13:01:30 +0200, Andrei Popescu wrote: [...] aptitude --schedule-only unmarkauto $(cat pkg.list) is somewhat clumsy, but it seems to work here. I only tried a simple test case with a list of two packages, and I did not test if --schedule-only is really necessary. If your list of packages exceeds the maximum number of command line arguments then you have to split the file. Backticks should also work if you want to avoid the $(...) bashism. Another simpler form, but perhaps again a bashism is : # aptitude unmarkauto $( pkg.list) No process fork for cat. signature.asc Description: Digital signature
Re: [kinda solved] Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 14:14:11, Andrei Popescu wrote: On Sb, 15 ian 11, 12:23:07, Florian Kulzer wrote: Any other suggestions? aptitude --schedule-only unmarkauto $(cat pkg.list) Do you mean after a '--schedule-only markauto ~i'? Hmm, let's try... Nope, not what I needed. But the solution seems to be: aptitude --schedule-only markauto ~i aptitude --schedule-only install $(cat pkg.list) Actually this only helps cleaning the system of unneeded packages, but still leaves me with a lot of packages not marked auto, so I had to apply Javier's hack after all. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
In 20110115110130.GC15639@think.homelan, Andrei Popescu wrote: 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. aptitude --schedule-only markauto ~i Seems to be doing the first part, but I can't convince aptitude to unmark my list (which I processed to not contain unneeded space and newlines): aptitude unmarkauto pkg.list has no effect The redirection operator you've used ('') opens the named file, and replaces file descriptor 0 (stdin), with the descriptor of the just opened file, just before running the command. Aptitude doesn't read packages to operate on from stdin, so it's not surprising this didn't have the effect you wanted. (aptitude unmarkauto $(cat pkg.list)) should do what you want, and extra newlines and spaces wouldn't matter even if the file contained them. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: aptitude: set all packages auto-installed except given list?
In 20110115133957.gi4...@wasteland.homelinux.net, Jochen Schulz wrote: Florian Kulzer: […] Backticks should also work if you want to avoid the $(...) bashism. That's not a bashism, it's perfectly legal POSIX/SUS. It's also preferred over backticks since you can't nest backticks AND some older shells have convenient behavior on input like Is it now `date that really messes with you if you try and use quotes inside backticks. Like making the following ambiguous: Is it now`date + %F `, but I wish it was 100 years in the future. -- Boyd Stephen Smith Jr. ,= ,-_-. =. b...@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/\_/ signature.asc Description: This is a digitally signed message part.
Re: [really solved] Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 19:42:26, Andrei Popescu wrote: Actually this only helps cleaning the system of unneeded packages, but still leaves me with a lot of packages not marked auto, so I had to apply Javier's hack after all. Ok, this looks like the best version so far: Backup: aptitude --disable-columns -F %p search '~i!~M' $PKG_LIST (in case you're wondering, my list currently has 177 packages) Restore (as root): aptitude -o Aptitude::Delete-Unused=false markauto ~i aptitude -o Aptitude::Delete-Unused=false unmarkauto $(cat $PKG_LIST | tr \n ) aptitude keep-all I still don't understand why 'Delete-Unused=false' is necessary with 'unmarkauto' and an additional 'keep-all' is needed, but at least it works. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: aptitude: set all packages auto-installed except given list?
On Sb, 15 ian 11, 14:31:13, Boyd Stephen Smith Jr. wrote: (aptitude unmarkauto $(cat pkg.list)) should do what you want, and extra newlines and spaces wouldn't matter even if the file contained them. Thanks for the tip, that saves a 'tr' invocation in my solution. Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature
Re: [really solved] Re: aptitude: set all packages auto-installed except given list?
On Sat, Jan 15, 2011 at 9:41 PM, Andrei Popescu andreimpope...@gmail.com wrote: On Sb, 15 ian 11, 19:42:26, Andrei Popescu wrote: Actually this only helps cleaning the system of unneeded packages, but still leaves me with a lot of packages not marked auto, so I had to apply Javier's hack after all. Ok, this looks like the best version so far: Backup: aptitude --disable-columns -F %p search '~i!~M' $PKG_LIST (in case you're wondering, my list currently has 177 packages) Restore (as root): aptitude -o Aptitude::Delete-Unused=false markauto ~i aptitude -o Aptitude::Delete-Unused=false unmarkauto $(cat $PKG_LIST | tr \n ) aptitude keep-all I still don't understand why 'Delete-Unused=false' is necessary with 'unmarkauto' and an additional 'keep-all' is needed, but at least it works. When you invoke aptitude unmarkauto ... aptitude has all your packages with auto mark, so aptitude will want to delete these unused packages *before* it start with your operation (unmarkauto in this case). I think it make sense Regards, -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/aanlktin3pvvpesel6nfqmbd9sn-qtdgia4qlveydp...@mail.gmail.com
Re: [really solved] Re: aptitude: set all packages auto-installed except given list?
On Du, 16 ian 11, 01:00:50, Javier Barroso wrote: When you invoke aptitude unmarkauto ... aptitude has all your packages with auto mark, so aptitude will want to delete these unused packages *before* it start with your operation (unmarkauto in this case). I think it make sense Well, '(un)mark' seems to be doing more than just (un)marking packages which is a bit counter-intuitive to me... Regards, Andrei -- Offtopic discussions among Debian users and developers: http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic signature.asc Description: Digital signature