I have problems updating truffle. I run the command "truffle --version" and i got truffle version 4.0.1 and solc version 0.4.18. So i wanted to upgrade to 4.1.6 which is the latest version. I run "sudo npm uninstall -g truffle" and then i run the command "sudo npm install -g truffle". After that i run "truffle version" and i got again 4.0.1 and solc 0.4.18. Does anyone know why i can not update to latest version? Basically i am intrested in updating solc version to latest 0.4.22 but after some search i found out i have to update truffle in order to update solc compiler.
Fixed: After i restarted the pc, truffle was updated. Also as Med Mansour commended below maybe a restart wasn't neseccary and it was just needed to close the cmd or terminal and open a new one.