Cannot kill `grep --color=auto` process in terminal

Read the results carefully, you are detecting your grep apt command, which is gone by the time you type the next command..

Either use pgrep apt (man pgrep), or modify your search string so it's no longer a match for the string "apt", e.g. grep '[a]pt'.


ps aux | grep -i apt

will return any process that has apt in the result returned by ps. It can be in the command, as in grep -i apt

So basically, your command returns only one result, which is... itself. When you try to kill it, it has already finished, so the process has gone.