How to read yay update log?


When I upgrade in yay, I can view the installed updates and also it tells me that there are optional packages (dependencies) available for install.

I closed the terminal, and now I can’t see the update log anymore.

I can read the pacman log in: sudo gedit /var/log/pacman.log

but it does not tell me the optional package dependencies that were available.

plz help

AFAIK yay is a wrapper script, so the log should be the pacman log, but i am not 100% sure.

You can query each package in log and see all the info about it, including Optional Deps.

1 Like

/var/log/pacman.log has permissions -rw-r--r-- and can be read by anyone. There is no need to use sudo.

This message brought to you by the Society for the Prevention of Unnecessary Use of Sudo, together with the Societies for the Prevention of cat Abuse and which-craft.


tac is the opposite of cat - in writing and in function - and quite useful in this case
to list the pacman log in reverse order - starting from the most recent entries
no need to load the whole file into an editor and then to scroll all the way down …
tac /var/log/pacman.log | less

Instead, you can scroll up to go back in time.

Otherwise, you just need less:
less /var/log/pacman.log
and then scroll down.

Never use sudo to launch graphical applications. Instead, use:

gedit admin:///var/log/pacman.log

See Running GUI applications as root - ArchWiki

EDIT: Well, except in this case, just open the file normally as mentioned above, the log file does not require elevated permissions to read it.

1 Like

ok, how do i do this?

How can I rerun the last update?

Though … its a log.

Theres literally zero reason for them to have interactivity with it in the first place.

Besides which it doesnt even require such access rights.

Run your updates again?
You cant ‘do the same thing from the same place’ because your system is not in the same state as it was.
I suppose you can uninstall and reinstall the packages in question.

But that would be rather silly when if you want to see the optional dependencies you can just look at them;

pacman -Qi package

(look at the ‘Optional Deps’ line)

1 Like

how can I run this query for every package from pacman.log?

You want to run pacman -Qi on all of your packages?
Then you can just

pacman -Qi

Which would be about the same as

pacman -Qi $(pacman -Qsq)

But … if you are asking about the ones you just recently installed …
Then just put the names there. You know what packages they are and/or can look in the history.

pacman -Qi package1 package2 package3
1 Like

how can I only return optional deps in pacman -Qi

Without using extra utilities …

It will take some magical invocation pipe. Meaning adding this to the end:

| sed -n '/Optional Deps/{:l s/.* \([a-zA-Z0-9.\-]\+\):.*/\1/p; n; /Required By/!bl}'

So for package firefox

pacman -Qi firefox | sed -n '/Optional Deps/{:l s/.* \([a-zA-Z0-9.\-]\+\):.*/\1/p; n; /Required By/!bl}'

Or for all ‘foreign’ packages

pacman -Qim | sed -n '/Optional Deps/{:l s/.* \([a-zA-Z0-9.\-]\+\):.*/\1/p; n; /Required By/!bl}'

(note this works on bash … I have no idea about zsh)

1 Like

All your questions are already answered with helpful wiki’s. Please don’t be a Help Vampire. Do your own research instead of taking advantage of helpful volunteers. You’ll learn nothing that way.

Having said that, feel free to ask questions along the way. :wink:


Not to mention that pacman and pamac both have man pages. :wink:

man pacman
man pamac

Really thank you man, I appreciate your hard work.
Sorry for asking so many questions without digging deeper myself first.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.