Let’s understand this in a better way.
apt
, often called Advance Packaging tool, downloads the .deb
file of the package for you.
dpkg
, often called Debian Package Maintainer, compiles/install the package's .deb
file for you. From IBM's documentation for dpkg
(emphasis my own):
dpkg is the software that forms the low-level base of the Debian package management system. It is the default package manager on Ubuntu. You can use dpkg to install, configure, upgrade or remove Debian packages, and retrieve information of these Debian packages.
In this specific case, you mentioned that the .deb
file is already downloaded. So, when you'll double click the file, or will open it with Software Center. The Software Center will use dpkg
to process and install the package. So, you need to search for dpkg
instead of apt
using ps aux
:
ps aux | grep dpkg
Then you can kill it using:
sudo kill -9 <process id>
You can also get the process's ID using:
sudo lsof /var/lib/dpkg/lock-frontend
And kill it using:
sudo kill -9 <process id>
Note: Killing a process will interrupt dpkg
. You cannot use dpkg
again without configuring it. Run:
sudo dpkg --configure -a