Is there any advantage or disadvantage to updates via TTY verses terminal or Konsole?
TTY is outside of the graphical interface. Ex - if for some reason your desktop dies during update konsole may not finish, etc… TTY would have been fine.
Its simply slightly safer … but rarely required.
To be technically correct all terminals (Konsole included) use a tty…
See: TTY -> Computer terminal
But i guess the OP means “Virtual console (VC)” vs “Virtual Terminal(VT)”.
The first is used without a GUI eg via CTRL+ALT+Fx, the later can be used on both non-GUI and GUI sessions…
For commands run in both there is little to no difference…
…sure… and all terminals are really terminal emulators.
I think the OP’s intent and need was understood.
Further clarifying what @cscs said, when it comes to a major update, then it’s always best to update via a
tty, and ─ this next bit is important ─ while completely logged out of your GUI environment.
The rationale is this: GNU/Linux is a UNIX platform, and thus a multiuser operating system that supports concurrent logins. If you log into a
tty, then that’s a character-mode terminal, outside of the scope and memory address space of the graphical session. So the
tty session and the GUI session are truly separate and do not share any common address space.
Now, with that in mind, whenever there’s a major update/upgrade, then this comprises components of your GUI environment, and so if you’re logged into your GUI while commencing the update/upgrade, then at least a number of the on-drive shared libraries and executables making up for that very GUI environment will be overwritten while they are in use. This means that memory address mapping and cache content won’t be congruent anymore with the on-drive files making up for the GUI environment, and conflicts may ensue.
By consequence, it is always safest to first log out of your GUI session ─ so that all the open files are closed and nothing would be in use anymore that could cause conflicting situations to arise due to the update ─ and then log into a
tty and conduct the update from there.
That all said, it is perfectly fine to use a GUI package manager front-end for querying the package repositories and/or installing individual packages, or even for updating small amounts of packages, provided that the software from those packages is not in use. It would for instance be very silly, say if there were an urgent security update to Mozilla Firefox, to try and update Firefox while you’re actively using it at that particular moment. That’s a recipe for trouble.
So, to summarize…:
For querying the package repositories, installing individual packages and performing small updates to software that is not actively being used at the moment, staying in the GUI is perfectly fine, and you can then use either your graphical package manager front-end or use the command line in a terminal window.
For major updates/upgrades, it is safer to log out of the GUI environment completely, log in at a
ttyand conduct the update/upgrade from there.
The Linux kernel makes a distinction ─ which the OP appears to be well aware of ─ namely that a character-mode virtual console has a
/dev/tty[number] designation, whereas a terminal window like Konsole is regarded as a pseudo-terminal slave and begets a
/dev/pts/[number] designation. And serially connected terminals or modems get an even different designation ─
/dev/ttyS[number], if I remember correctly.
This distinction in the kernel as reflected by the device special files signifies that the kernel handles each of these types of connections via distinctly different internal I/O frameworks.
Thanks to all for the detail useful info on TTY, as it all makes sense!
You are absolutely right about the tty’s, and i know that also…just didnt want to go in to that much detail (or even further)
When it comes to packages, that are in use, i guess the package update mechanisms could be updated to make the system aware of those changes by restarting the said package (service)
(Only rare occasions/libraries should require a system reboot)
But all in all: i do agree
If this is the case would the Windows system of holding onto updates of programs that are in use, and then finishing the update when you log-out, shut down or restart the computer not be more prudent for the novice users?
I can log into a tty, but I know many people who would be scared of doing that.
I don’t know the feasibility of such a idea, but is it possible to have updates handled differently depending on whether you use a tty or gui interface?
Admins could enter a tty and do major updates while those updating via pamac could have a message stating they need to restart the computer to finish the updates?
I personally have never had a problem with just pacman -Syyu but most of the average users would prefer to use pamac GUI and those same people would not know how to fix a breakage.
This is really helpful as it’s too easy to get confused. Thanks!
In light of the above advice re. logging out of the GUI, one could (in the TTY) issue
pinky to check who is logged in and where.
In the eyes of Windows habitués, it might be, and I’ve actually seen a couple of ardent Windows fans vehemently defending the practice on Usenet, lamenting loudly that GNU/Linux does not do things that way, but the truth of the matter is that it would be highly dictatorial to force a user to wait until the system has finished updating itself when all the user wants to do is shut down their computer and go to sleep.
Then, with all due respect, those people should stay away from GNU/Linux, because the command line is part and parcel of a UNIX operating system. Even macOS has a command-line terminal ─ until macOS Catalina, it used the
bash shell, even, and since Catalina, it now uses
GNU/Linux was never intended to be a Windows replacement. Therefore, people coming to GNU/Linux while looking for something that behaves just like Windows are only going to get disappointed.
GNU/Linux is an operating system that ─ among many other hardware architectures ─ also runs on the same type of hardware as what Microsoft Windows generally runs on, and as such, it could be considered an alternative to Windows. But that’s not what GNU/Linux was developed for. It was developed as an alternative to proprietary UNIX systems, such as IBM’s AIX, SCO’s Unix/Unixware, Hewlett-Packard’s HP/UX, SGI’s IRIX and Sun Microsystems’ Solaris.
Modern GNU/Linux distributions are incredibly user-friendly compared to their ancestors ─ not to mention their proprietary counterparts ─ but it’s still a UNIX-style operating system, which means that a certain degree of responsibility and consideration from the machine’s administrator is required. The good news however is that everything is very well documented, and distributions like Manjaro and its parent, Arch, have excellent Wikis ─ so excellent in fact that even the developers of the Gentoo distribution will consult them.
Of course, there is always room for improvement, and GNU/Linux continues evolving and adapting to the needs of the era. But forcing the user to sit through a
$DEITY-knows-how-long update process when they are only trying to shut down the machine and go to bed is a bad idea.
But then again, that idea that comes from Microsoft, who are the undisputed champions of bad ideas. Just look at Microsoft Windows and how it was designed.
I was not suggesting forcing anyone to do anything. I was not talking about forced updates, but about having the computer do a restart during a major update if done through the GUI pamac so as not to cause crashes during an upgrade. Giving someone an option is also not dictatorial. What is a bad idea is having an update feature that is known to possibly break a system and is recommended by a developer to not be used.
If people cannot safely rely on the GUI to update then it shouldn’t exist as an option. Creating a safer way for the GUI to update and making it more reliable is not ‘becoming like microsoft’ quite the contrary. You have stated that you have a feature which shouldn’t be used because it could cause problems if it updates programs that are in use.
As long as the user decides when and by what method to update they are not being forced to do anything. My statement was not do things the microsoft way.
The microsoft way is force updates and make everyone have to do so at the level of the lowest level user.
I was suggesting that if you believe your Pamac can break a computer during an update and hang or cause problems then it most certainly should update those programs whether after the computer has exited the GUI.
The user chose to update at that moment. Your solution above was WORSE than what you state Microsofts solution was, you are stating that those people should log out and then update. So what is the difference between having someone use a tty to safely update or having the GUI exit the session and do the updating?
One word: control. The user ─ or better put: the system administrator ─ is in control. They can choose to update their system when it is most convenient, and they can choose to delay the reboot to when it is most convenient, because the system doesn’t automatically log them out and/or reboot after an update, which could even be dangerous if something went wrong during the update process. With a manual update, an interrupted update can still be resumed, so long as the system is up and running.
The advice to log out of the GUI for a full-scale update/upgrade has been going around for a long time already, and it may even be mentioned in the documentation ─ this I cannot say, but we’ve certainly been saying that time and time again at the forum, both here at the new one and at the old one. By the same token, we also always advise that you should reboot after an update, even if only because the kernels have been replaced.
And yes, there are ample anecdotal testimonies from people who’ve updated (and are still updating) their entire system through the GUI without any problems. But sometimes problems do occur, such as not being able to log out and/or restart the system from within the GUI, exactly because libraries that were in use have been overwritten, and the only way to rehash all of the required code into memory is to log out of the GUI and reboot the system.
I can attest to that. I update this system via Konsole; no major issues, just that some programs wouldn’t behave properly (or just wouldn’t run) following an upgrade but prior to a reboot.
After said reboot, all back to normal.
I also maintain my mate’s system via SSH with my user while he’s logged in as his user. Not noticed any issues there, so far.
I didn’t know about
pinky, so thanks for that tip.
However, there are two other commands that roughly give you the same information…
[nx-74205:/dev/pts/3][/home/aragorn] [19:57:11][aragorn] > who aragorn tty1 2020-11-08 19:34 (:0) aragorn pts/0 2020-11-08 19:34 (:0) aragorn pts/2 2020-11-08 19:43 (:0) aragorn pts/3 2020-11-08 19:57 (:0) [nx-74205:/dev/pts/3][/home/aragorn] [19:57:18][aragorn] > w 19:57:26 up 2 days, 21:52, 4 users, load average: 0.21, 0.36, 0.31 USER TTY LOGIN@ IDLE JCPU PCPU WHAT aragorn tty1 19:34 2days 41.15s 0.04s /usr/bin/startplasma-x11 aragorn pts/0 19:34 23:25 0.00s 0.55s /usr/bin/kded5 aragorn pts/2 19:43 13:41 0.00s 0.00s /bin/bash aragorn pts/3 19:57 1.00s 0.01s 0.01s w [nx-74205:/dev/pts/3][/home/aragorn] [19:57:26][aragorn] >
What prompt me to this subject was the thread I started about a muted sound issue in this post.
What I forgot to mention in that thread was I updated the second time via TTY for the first time in my life, and even though there were no new updates, the sound issue magically got fixed, and that’s why I stated this thread!
If there were no updates or transactions … that means nothing happened with the packages.
And to reiterate again - there is no difference in the functions of updating in either case.
It does the same exact thing … just in a different environment.