Score:0

Cannot Install Locate Command

ca flag

I recently decided to try Linux (Ubuntu 22.04), but I'm having a lot of difficulty even with what seems to be the most basic and trivial tasks.

Right now, I'm trying to install the command locate. Online research suggests sudo apt install mlocate should do it. When I run that command in the terminal I get this:

Reading package lists... Done
E: Unable to parse package file /etc/apt/preferences.d/mozilla-firefox (1). 

(as an aside, I did uninstall the snap version of Firefox, installed the snap version of Chromium, and then tried to install the deb version of Firefox, a task in which I was not successful, so I uninstalled Firefox from the terminal, and now although I believe I have eliminated Firefox from Ubuntu, I continue to get this E: Unable to parse package file /etc/apt/preferences.d/mozilla-firefox (1) frequently, regardless of the command I use.

But, back to locate.

Now that I've done sudo apt install mlocate, when I type locate skypeforlinux.desktop I get this:

Command 'locate' not found, but can be installed with:
sudo apt install plocate. 

Ok. So, then I try sudo apt install plocate and I get this:

Reading package lists... Done
E: Unable to parse package file /etc/apt/preferences.d/mozilla-firefox (1).

So then I try again, locate skypeforlinux.desktop, and I get this:

Command 'locate' not found, but can be installed with:
Sudo apt install plocate.  

Which, obviously, is what I just did...

I've also tried mlocate skypeforlinux.desktop and plocate skypeforlinux.desktop and those don't work either.

Can someone tell me what I'm doing wrong? Bonus points for helping me to understand/remove this constant E: Unable to parse package file /etc/apt/preferences.d/mozilla-firefox (1) message.

ru flag
What are the contents of `/etc/apt/preferences.d/mozilla-firefox (1)`? Whatever your preferences file is has some kind of misconfiguration in it and is not properly formatted for parsing by apt.
Score:1
cn flag

Something went wrong when you tried to install the deb version of firefox. The culprit is the broken file /etc/apt/preferences.d/mozilla-firefox. Due to this somehow misconfigured file you couldn't install firefox as a deb package, furthermore you can't install any other package. Any attempt to install a package is aborted with the error message E: Unable to parse package file /etc/apt/preferences.d/mozilla-firefox (1).

Remove the broken file from your system with

sudo rm /etc/apt/preferences.d/mozilla-firefox

After doing that, you will be able to install the locate package with

sudo apt install plocate
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.