How to perform updates from the CLI

Hi all,
This is a pretty common question but I cannot seem to find it when I search the forums or even browse the web for it so pardon me if there's a thread explaining this already (and please link it!). Basically, I have been updating from console using the usual

pacman -Syu

But recently I was told to update from a CLI and not my comfortable console emulator. Now this part I have been able to find information on, I simply press CTRL+SHIFT+F2 (or F3 or F4...) but I have also been told to end my KDE plasma session as updating from the CLI would be the same as updating from konsole without ending my KDE session.
So my question is more about how I can end my KDE session and update from the CLI as to ensure absolutely nothing breaks.

Thanks!

P.S. If I end my KDE session to perform this update will it automatically start again when I run systemctl reboot ?

I usually update from TTY by hitting Ctrl Alt F2, login and then run

sudo pacman-mirrors -f 5
sudo pacman -Syyu

Afterwards

exit

and I return using Ctrl Alt F1 to the KDE session where I then initiate a reboot.

Have a look here:

Not quite. Updating from konsole could be problematic if some library/kde component update crashes DE and konsole + pacman with it. That won't happen from tty.

Yes.

You can end your session by changing runlevel, for example, to end KDE session you can systemctl isolate multi-user-target
More info here https://wiki.archlinux.org/index.php/Systemd#Targets

Simply log out. This will end your session and drop you in the login screen.

Then press ctrl+alt+F2 to switch to TTY2, there you can login and do the update.


If you have a slow internet connection or the update is huge, it may take a long time to download the packages, so updating from the TTY may be annoying since you can't use your computer while downloading. If that is the case, you can download the updates before logging out and doing the upgrade. Run

sudo pacman -Syuw

in a terminal emulator (i.e. normally, during the graphical session). This will only download, but not install the updates and you can continue using your computer while the download takes place. When it is finally done, you can log out, switch to TTY2 and then run

sudo pacman -Su

which will apply the updates you downloaded (upgrade), which should last only a fraction of the time.

2 Likes

I am using a console on my KDE desktop.
I set the mirrors for the updates manually: https://repo.manjaro.org/
To perform the update I use pacman -Syyu (as root).

Updating in the terminal emulator (console) is fine, unless the update announcement suggests you do it in the TTY, then it's a good idea to heed what it says and log out before updating.

Double y is typically not necessary (unless you really need to force sync of the database). More often than not, it just causes wasteful traffic for the mirrors (possibly costing them money).

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

Forum kindly sponsored by