I came across this wiki page: Package Manager Troubleshooting Procedure.
In it, there were commands such as:
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
So what is the purpose of LANG=C;?
LANG=C commandand notLANG=C;command. The first form forces the value ofLANGenvironment variable for the duration ofcommandwhile the second form is actually two commands where the first part just sets a local (not exported) variable and the second part runs the command without setting the required environment variable. – Guss Jan 26 '16 at 22:59LANGis in the environment, so it probably works with redundant semicolons; but it is (1) redundant because nothing is going to changeLANGbetween the commands. Also hinting somebody to run commands in such way is (2) wrong because of unnecessarily and uninvited changing environment, and (3) this provides an incorrect pattern for any uninformed user that later reapplies the usage - possibly with a shell variable that is not in the environment and thus not even having any effect on the commands run that require it for correct, perhaps safe, function. – FooF Jan 27 '16 at 04:56;I do not think it should be upvoted due to risk of giving wrong example. – FooF Jan 27 '16 at 04:58LANG=C;sudo apt-getand notLANG=C sudo apt-get? – Rui F Ribeiro Jan 27 '16 at 14:33LANG=C;is how it was written in the wiki I linked to. I did not modify anything except that I omitted from my question the commands that didn't mentionLANG=C;. – DK Bose Jan 27 '16 at 14:48LANG=C ;) it's changed between the commands, and it's redundant to prepend the subsequent commands withLANG=C ;. So even if the example in the question works, it's indeed misleading, and I agree with you and others here that it was motivated to point it out. The page EnvironmentVariables explains it better. – Gunnar Hjalmarsson Jan 27 '16 at 19:03immutablething. I recall reading about a recent hacking (?) event which may have led to a restriction on who can do what. – DK Bose Jan 28 '16 at 10:07