Andrew Fletcher published: 3 October 2023 1 minute read
Logging into the server, and there are packages to be updated. You know the standard Ubuntu / Linux response
5 updates can be applied immediately.
To see these additional updates run: apt list --upgradable
3 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm
Followed by the action
sudo apt update && sudo apt upgrade -y
Response
Reading package lists... Done
E: Could not get lock /var/lib/apt/lists/lock. It is held by process 2003293 (apt-get)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to lock directory /var/lib/apt/lists/
This just means that there is an application using apt. First try to find out which application it is by using this command in the terminal
ps aux | grep '[a]pt'
If there is a process running using apt (as noted in the error apt-get is being used), it's recommended to let it finish what its doing. Otherwise you can kill it using
kill <PID of the process (2nd column in output of ps aux)>
Ensure there is no process or killing it, if ok - you can remove the lock using
sudo rm /var/lib/apt/lists/lock
Related articles
Andrew Fletcher
•
16 Jan 2025
get IP address from terminal OSX
When troubleshooting network issues or configuring devices, knowing your IP address can be essential. Whether you're connected via Wi-Fi, Ethernet, or tethering through a mobile provider, macOS offers powerful built-in tools to quickly identify your IP address. Here's a practical guide tailored to...
Andrew Fletcher
•
07 Jan 2025
Managing DDEV environment troubleshooting and setting up multiple Drupal projects
DDEV has become a popular tool for local web development, offering a streamlined approach to managing Docker-based environments. However, setting up and managing DDEV projects, particularly with the latest versions of Docker Desktop, can present challenges. This article guides you through resolving...
Andrew Fletcher
•
06 Jan 2025
How to set up password authentication with Apache or Nginx on Ubuntu
Securing sensitive content is essential for protecting data integrity and user privacy. One effective way to implement security is by restricting access to specific directories or resources using either Apache or Nginx authentication tools. This provides a comprehensive reference for configuring...