apt-get question.
#2
(01-03-2017, 06:49 PM)dkryder Wrote: is there any difference in final outcome between doing these commands,

sudo apt-get update
sudo apt-get upgrade

and doing these commands,

sudo su [enter password, become superuser]
apt-get update
apt-get upgrade

There is some debate about that actaully. The answer is yes and no;  depending on what your goals are.  Typically as an administator you want your users to run the former;  the reason being that sudo has logging and accountability, is more secure, and allows the admin to 'govern' legitimately over the users who have uathority to use the sudo command. Also the environment can be controlled better.

sudo su -      ( shouuld be avoided );

... the reason being that once the user is permanently logged in as the super user there is no more sudo logging and accountability. On the other hand, if there is only one user on the system ( as is the case for most RPi(s) or Pine(s) then who cares? ( there are nuances regarding environment here )

Now for the 'no' part of the answer.  In terms of update and upgrade there is no real difference in 'outcomes' for either method. Some people prefer the following command, however;

sudo -i

... reason being that some people hate having to re-enter their password every so many minutes when the sudo command expires. sudo -i is preferred to sudo su - because the environment can be controlled better .

... reason being that sudo logging and accountability is still active. 

See the man page for sudo for the nuanses between sudo su -  and sudo -i. ( sudo -i ; sudo --login )

note: there is a nuance regarding whether the su experience has the system environment ( or user environment ) which includeds path and system variables , for instance.  Again, see the man page for details.

( this is an opinion, and not all agree )


Notes:

   Try these:

   sudo su
   pwd
   exit

   sudo su -
   pwd
   exit

   sudo -i
   pwd
   exit

You will notice that ( sudo su )  is different in that it leaves the current directory alone ;

The other two will open the shell at  /root


marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
apt-get question. - by dkryder - 01-03-2017, 06:49 PM
RE: apt-get question. - by MarkHaysHarris777 - 01-03-2017, 09:49 PM
RE: apt-get question. - by dkryder - 01-04-2017, 12:49 PM
RE: apt-get question. - by MarkHaysHarris777 - 01-04-2017, 01:04 PM
RE: apt-get question. - by ChristianC123 - 07-03-2017, 02:21 PM
RE: apt-get question. - by pfeerick - 07-04-2017, 03:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Debian kernel upgrade question jl_678 2 5,097 04-18-2016, 05:54 PM
Last Post: jl_678

Forum Jump:


Users browsing this thread: 2 Guest(s)