Forum › Forums › New users › New Users and General Questions › Using the non-gui console to “safely” remove and replace pkgs? › Reply To: Using the non-gui console to “safely” remove and replace pkgs?
sudo apt-cache show …
[Well meant] Nitpick: unnecessary use of ‘sudo’.
Many thanks Sybok, for spotting that! For sure with apt-cache there is never a need to use sudo. And many thanks Brian for bringing light into the background for people not familiar with this stuff: The core idea is: You need sudo merely for all apt operations which actually need write access to the respective system folders like apt-get upgrade , apt-get autoremove, apt-get install and so on. When using the “apt” human designed frontend instead of the actual various apt commands running in the background when using the apt frontend, it is a bit more difficult to tell what instruction will require sudo and which not. For predicting this properly when using the “apt” frontend, you only have to imagine what actual apt command will be called in the background, then you’ll know whether to use $ sudo apt update or whether unsudoed $ apt list –upgradable is sufficient. Since the commands actually executed in the background are apt-get in the one case, and apt-cache in the other. From this perspective the human frontend renders things more complicated, not easier, unless you know very well the background which is executed. It can be confusing for people when they have to use the very same command “apt” one time with sudo and another time without, while the dedicated commands apt-get and apt-cache (and also apt-mark, apt-rdepends and so on) have their clear scope they require to run: either root or user, not sometime this and sometimes that.
This is why I explicitly had written $ sudo apt-get … (or # apt-get …) and $ apt-cache … rather than $ apt … above.
Windows is like a submarine. Open a window and serious problems will start.