PDA

View Full Version : [SOLVED] Redirect output of apt-get update



huff2
April 3rd, 2019, 06:49 PM
I would like to redirect the output that I normally see in the terminal when using the apt-get update command to a text file.

Ex. sudo apt-get update > exampleFile.txt (I would like to do the same with upgrade)

I get this warning: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Anyone care to enlighten a newbie as to exactly what I'm being warned about and why?

Thanks!

TheFu
April 4th, 2019, 04:16 AM
apt-get is fine in scripts.
apt is constantly changing as they figure out the right level for ease of use vs complexity.

As for redirections, this is helpful: https://github.com/jlevy/the-art-of-command-line
You'll learn lots in there, including simple redirection of stderr and stdout file descriptors.

huff2
April 4th, 2019, 04:36 AM
@TheFu Nice! Thanks! I really appreciate the link.