Linux Mint / Ubuntu Shell Script To Fix Problem with MergeList /var/lib/apt/lists”

To avoid typing in the same set of commands, shell scripts can be great.

Here is a simple shell script that will run the commands that are used to fix the mergelist errors in Ubuntu / Linux Mint which prevents any updates from running. Check out the related post here.

[Note : If you have already fixed the errors, don’t run this script as it will start from scratch and re-run the update process. Just save it after making it executable for future uses.]

#!/bin/bash
# Fix the apt update errors in Ubuntu / Linux Mint
# Demonstrated for fun by guys at ihaveapc.com

echo "This will fix the mergelist errors"
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

Save it as mergelist.sh or any other relevant name.

Make sure to make it executable before running it by typing :

chmod a+x fixmergelist.sh

Finally run it instead of running the different commands separately by typing :

./fixmergelist.sh

All done, from now on no need to remember each command that is used to fix something or do something. We generally make lots of shell scripts and use them as and when required, this saves us time plus helps us in managing different systems. 🙂

Cheers.