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
•
21 Apr 2024
This command will help you spot any unusually large directories
The red flag was when I saw the server disk space is showing a site is taking up 57992.5 MB, where locally the site size is showing 957MB. There is something serious happening here and I need to establish the problem quickly. When dealing with a significant discrepancy in site size...
Andrew Fletcher
•
18 Apr 2024
No results showing for your Solr instance - solr.service: Failed with result 'exit-code'
When Solr is displaying results on the site, first step is to log in the server and check its status● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
...
Andrew Fletcher
•
05 Apr 2024
Drupal 9 to 10 upgrade an example of the actual steps taken
Continuing on from the Drupal 9 to Drupal 10 upgrade outline written earlier... Upgrading Drupal 9 to Drupal 10. However, the point of difference is this article works through the actual action steps of the upgrade.Planning and testing is critical for the Drupal to version 10 process to...