After Using Dpkg to Install a Package, Apt-Cache Policy Returns Wrong Version

I needed to update firefox 51 to firefox 57.0.4 on some ubuntu 16.04 PCs (who had apt-mark hold on for firefox). Since apt-get policy firefox only allows me to update to the latest version (81.0), I searched for the correct .deb package online and installed it using

dpkg -i firefox-mozilla-build_57.0.4-0ubuntu1_amd64.deb

But now apt-cache policy firefox still shows the old version of firefox. That's posing a problem now, since we use the apt-cache policy output in some scripts to determine the current installed version of firefox. Is there any way to "sync" the version installed via dpkg back to apt's database?

I also tried purging apt-get's version before using dpkg, but that only results in apt-cache policy saying that "none" version is installed of firefox.

2
Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article