For an update (from a Ctrl + Alt + F2 terminal) I used this series of commands:
pacman-mirrors |& tee up1.txt
sudo journalctl --vacuum-size=50M |& tee up2.txt
sudo paccache -ruk0 |& tee up3.txt
sudo pacman -Syu |& tee up4.txt
The first three commands worked, that is, gave me output to both file and screen.
But the fourth and last got stuck right after “Retrieving packages.” (“Retrieving packages” was the last line displayed on the screen, and for some ten minutes no new line appeared. I interrupted the process and started over, this time, sending output only to screen and not to file. See screenshot below. It is from the output sent only to screen. Red line indicates where the first round had got stuck.)
Question: Is there a way to send the output of sudo pacman -Syu to both file and screen?
pacman already does that by default. Check /var/log/pacman.log. Tip: use tail -N (where “N” is the number of lines you want to see) and pipe it through less. The log even contains timestamps.
In addition to the above, in /etc/pacman.conf, if you have VerbosePkgLists uncommented, the packages will be displayed in a table format, rather than all packages run together. One caveat, the terminal width has to be wide enough. So if it isn’t formatted, say “N” and widen the terminal. I haven’t tried it, but I read that you might be able to fake it out, albeit the table won’t be perfect, with COLUMNS environment variable.
The command expac (see links below) looks interesting.
re reading /var/log/pacman.log (or any log, for that matter)
You used the gedit text editor to view it - it will load all of the file and you can
(and will need to)
scroll through all of it to get the bottom of it
to read the last messages added to it.
less /var/log/pacman.log
in a Terminal
will kind of do the same thing - you’ll need to page down to the end of the file …
If you are interested in the most recent addition to such a file
you can list it backwards, like this:
tac /var/log/pacman.log | less
it starts from the end of the file
(cat is starting from the top, tac is starting from the tail)
the piping of the output through less lets you scroll through the whole content in each case