Score:4

Apt install using Software Center hangs. How do I kill it?

ph flag

I invoked an apt install (of mysql-workbench) by double clicking the downloaded .deb file.

It hangs at the "preparing" stage and the "Cancel" button does nothing.

ps aux | grep apt

didn't find any process running.

What process name should I look for? How do I kill it?

Score:6
my flag

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
Score:3
sa flag

Double-clicking a .deb file opens it for installation in the Software app. The Software app is named gnome-software in Ubuntu. You can force close the Software app by finding gnome-software in the System Monitor app, right-clicking it, then stop/end it, or from the terminal by running pkill gnome-software.

If double-clicking the .deb file the first time generated an error message, I recommend trying to install it from the terminal with sudo apt install ./FILE.deb the next time in order to get verbose output from the software installation command that will help to troubleshoot the problem with installing FILE.deb. For example if there are unmet dependencies the results of sudo apt install ./FILE.deb will list them.

Someone avatar
my flag
I have a doubt, will killing gnome-software, also kill `apt` and `dpkg`? I am unsure about that. O_o
karel avatar
sa flag
@Someone Killing gnome-software won't kill either apt or dpkg. It will just unlock the currently running installation process from gnome-software if there is a currently running installation process in gnome-software that is locking either apt or dpkg.
karel avatar
sa flag
If double-clicking the .deb file the first time generated an error message, I recommend trying to install it from the terminal with `sudo apt install ./FILE.deb` the next time in order to get verbose output from the software installation command that will help to troubleshoot the problem with installing FILE.deb. For example if there are unmet dependencies the results of `sudo apt install ./FILE.deb` will list them.
ph flag
Thanks @karel, I did what you suggested, i.e., `sudo apt install ./FILE` and the workbench installed all right. No hanging!
Someone avatar
my flag
@karel Will using `apt install deb` satisfy the dependencies? Or will it just install the file as `dpkg -i` do?
karel avatar
sa flag
@Someone A command of the form `sudo apt install ./FILE.deb` will either automatically install all of the required dependencies, or if the command fails it will print a detailed error message that lists the unmet dependencies. You can also use this type of command to simulate a package installation without installing anything `apt install --simulate ./FILE.deb` Note that since a simulated command doesn't install anything `sudo` is not required,
Someone avatar
my flag
@karel Thanks for the information.
Score:2
cn flag

First try if hitting the close button does not cause the system to ask you to kill this unresponsive window.

Then try killing the process, i.e. Ubuntu Snap Store, using System Monitor.

If you are on Xorg, then the command xkill will change your cursor in a diagonal cross. Click the unresponsive window to kill its process.

ph flag
Dear @vanadium, I am a rather newbie at Linux and Ubuntu, how do I invoke the system monitor? The close button just closed the window and IMHO didn't kill the process. I think so because double clicking again on the *.deb file opened a window with a revolving circle that hangs also...
vanadium avatar
cn flag
Via the application menu. You said in your question that the cancel button does nothing. I was therefore assuming that the window is not responsive.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.