Fixing ‘Unable to Locate Package’ Error After Crash During apt-get Install

aptpackage-managementsoftware installation

After a crash installing java with apt-get, I was trying to install maven, but apt wasn't finding:

> sudo apt-get install maven
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package maven

Already tried everything described here:
"Unable to locate package" while trying to install packages with APT

But nothing helped, I found a solution but can't post there because I don't have enough reputation.

Best Answer

the only thing that worked for me was to remove lists and then update:

sudo apt-get clean
cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update

then I tried to install maven and apt found the package

Related Question