Originally Posted by andywebsdale
You do get a log file in /var/log/apt which contains the output you're attempting to capture.
Or you could do
sudo apt-get update >$0.log 2>&1
redirects stderr to stdout. Have a look at bash file descriptor redirection.
Oh, thank you, BUT it is really NOT what I need.
I really need apt-file redirection to file in a script.
ON command line it works properly but I need it in script but not like you posted it