I'm trying to kill a system process (charger_manager) in Ubuntu. But however when I kill (as sudo) the process it is created back again.
Why does this happen? And how do I kill it permanently?
charger_manager is being spawned by something else. So when it dies what ever is managing it notices and reruns it.
Modern init system can watch and restart processes on failure including systemd and upstart. If the service was started with one of them try stopping the service instead of killing it.
If it is a child of another process and not a direct child of your init system you will need to stop the parent, or possibly configure it to not start the child (if that is a feature of the parent). To find the parent you can look at the process tree with
F5 to toggle tree view).
You can use the following command to delete it:
sudo kill -9 <pid>
But a system process will be created again, it might be because there's another process whose job it is to restart the service again if it crashes. So, you need to kill that other process first before you can kill the main process.