Ubuntu: How to replace the top shell script? [closed]


Can the top command in /usr/bin be replaced? I read on superuser that it can hide processes if compromised. I want to delete top and get a fresh new script using apt-get from Ubuntu official repositories.


top is a part of procps package you can reinstall it using:

sudo apt install --reinstall procps  

or install a version from a repository which you trust, run apt-cache policy proccps, which outputs:

procps:    Installed: 2:3.3.10-4ubuntu2.3    Candidate: 2:3.3.10-4ubuntu2.3    Version table:   *** 2:3.3.10-4ubuntu2.3 500          500 http://mirrors.kernel.org/ubuntu xenial-updates/main amd64 Packages          100 /var/lib/dpkg/status       2:3.3.10-4ubuntu2 500          500 http://mirrors.kernel.org/ubuntu xenial/main amd64 Packages  

pick a version from a repository which you trust and specifically install that one:

sudo apt remove procps  sudo apt install procps=2:3.3.10-4ubuntu2.3  

You can also check and see if this file is compromise using dpkg -V:


dpkg -V procps  

If top has been compromised it will show you an output look like:

??5??????   /usr/bin/top  

otherwise it show nothing.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »