Skip to content

Instantly share code, notes, and snippets.

@ManotLuijiu
Created August 19, 2026 17:44
Show Gist options
  • Select an option

  • Save ManotLuijiu/06f53f48e86e1ca18163780e9129baa1 to your computer and use it in GitHub Desktop.

Select an option

Save ManotLuijiu/06f53f48e86e1ca18163780e9129baa1 to your computer and use it in GitHub Desktop.
gdebi-gtk lock screen (can't install new one)
how to fix this lock in Ubuntu ->
gdebi-gtk
Only one software management tool is allowed to run at the same time
Please close the other application e.g. 'Update Manager', 'aptitude' or 'Synaptic' first.
That message means Ubuntu's package-management database is already being used by another process. **Don't delete the lock files immediately**—first identify whether `apt`, `dpkg`, or the automatic updater is genuinely running.
### 1. Find what is holding the lock
Run:
```bash
ps aux | grep -E 'apt|dpkg|unattended|packagekit'
```
Also useful:
```bash
sudo lsof /var/lib/dpkg/lock-frontend
sudo lsof /var/lib/dpkg/lock
sudo lsof /var/cache/apt/archives/lock
```
If you see something legitimate such as:
```text
unattended-upgrade
apt update
apt upgrade
dpkg
```
let it finish. You can monitor `dpkg` activity with:
```bash
sudo tail -f /var/log/dpkg.log
```
Press `Ctrl+C` to stop watching.
### 2. If the process is stuck
If you've confirmed the process is stale/stuck, stop the relevant service first:
```bash
sudo systemctl stop apt-daily.service
sudo systemctl stop apt-daily-upgrade.service
sudo systemctl stop packagekit.service 2>/dev/null || true
```
Then check again:
```bash
ps aux | grep -E 'apt|dpkg|unattended|packagekit'
```
If a specific stuck process remains, terminate it gracefully:
```bash
sudo kill <PID>
```
Wait a few seconds. Only if it refuses to terminate:
```bash
sudo kill -9 <PID>
```
### 3. Repair `dpkg`
After the competing process is gone, **don't manually remove lock files unless absolutely necessary**. Run:
```bash
sudo dpkg --configure -a
sudo apt --fix-broken install
```
Then:
```bash
sudo apt update
```
If those complete successfully, try:
```bash
sudo gdebi-gtk
```
### Quick approach
For your particular `gdebi-gtk` error, I'd start with:
```bash
sudo lsof /var/lib/dpkg/lock-frontend
```
If you get something like:
```text
COMMAND PID USER
apt 4832 root
```
then PID `4832` is the reason `gdebi-gtk` can't run. **Don't delete `/var/lib/dpkg/lock-frontend` while that process is alive**, because two package managers modifying the dpkg database concurrently can corrupt package state.
If `lsof` returns **nothing**, but `gdebi-gtk` still reports the lock, send me the output of:
```bash
ps aux | grep -E 'apt|dpkg|unattended|packagekit'
```
and
```bash
sudo lsof /var/lib/dpkg/lock*
```
and I can identify exactly which process is causing it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment