Can't Reinstall Firefox

I started up my RPi2 the other day and noticed that Firefox was gone. Odd.

I tried to reinstall it but wasn't able to. I currently have now browser available on my RPi2. Any suggestions for getting Firefox install via the terminal on a Raspberry Pi?

[quote=“owl, post:1, topic:13458”]I tried to reinstall it but wasn’t able to.[/quote]First, let’s make sure it’s actually truly gone. I can’t imagine it simply uninstalling on its own.

Terminal:
dpkg -l | grep -i firefox

This will list all installed packages and show us only those that have something to do with Firefox. Firefox itself should also show that way.

1 Like

Thanks, I get an error code when I try to run this command.

dpkg: error: need an action operation

You forgot the -l

See my post, it’s:

dpkg -l | grep -i firefox

In fact, just copy/paste it from my post.

1 Like

There is no browser on the RPi2 currently.

Here is the output. I guess Firefox is installed?

li xul-ext-ubufox 3.200buntu1 all Ubuntu modifi captions for Firefox

[quote=“owl, post:5, topic:13458”]Here is the output. I guess Firefox is installed?[/quote]No, it is not. Personally, I have no idea how that happened.

sudo apt-get install --install-recommends firefox

will install it.

1 Like

Thanks, I’m getting error codes 404 not found. Seems the ports.ubuntu.com files are not there.

[quote=“owl, post:7, topic:13458, full:true”]Thanks, I’m getting error codes 404 not found. Seems the ports.ubuntu.com files are not there.[/quote]Let’s try updating our database first then. So, in order:

sudo apt-get clean
sudo apt-get update
sudo apt-get install --install-recommends firefox

This will first clear our local copy of the package database. Then update it. And then we’ll try installing FF again. Mind you, don’t have a Pi myself so, just winging it here but I see no reason why you shouldn’t have access to the Firefox package if you do have access to the xul-ext-ubufox package (which is entirely optional and not required for FF to run).

1 Like

I first tried an update and then upgrade. Still does the same thing.

Tried the clean command too. Still isn’t installing.

Can I install another browser?

Also tried installing Iceweasel but I guess that uses the same dependencies and packages as Firefox. So throws the same 404 not found errors when trying to install.

What should be my next step here?

[quote=“owl, post:10, topic:13458”]What should be my next step here?[/quote]Well, let’s backtrack. Or, take it from the top at least – Which version of UM are we talking about?

And with @1Q7FE6zp last request, also post here the contents of the sources.list file. Use the following command:

cat /etc/apt/sources.list

Ubuntu Mate 16.04.02 LTS (Xenial-Xerus)

Here is what is in the sources.list file.

deb http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse
deb-src http://ports.ubuntu.com/ xenial-updates main restricted universe mutliverse

deb http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse
deb-src http://ports.ubuntu.com/ xenial-updates main restricted universe multiverse

deb http://ports.ubuntu.com/ xenial-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ xenial-security main restricted universe multiverse

deb http://ports.ubuntu.com xenial-backports main restricted universe multiverse
deb-src http://ports.ubuntu.com xenial-backports main restricted universe multiverse

Well, there’s a lot of wrong here: :slight_smile:

  • For one you are missing the main repo. You only have the update repos.
  • For another, I confess I haven’t seen that address before.
  • Also, you have a duplicated Recommended Updates repo.
  • And finally there’s an error in the Recommended Update sources entry. It can’t be debs-src. It must be deb-src.

Solution

Replace the entire contents of that file, with the following and then run sudo apt-get update. You should be able to Firefox after it.

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

Notes:

  1. Generated using Ubuntu Sources List Generator .
  2. I haven’t included the sources repos, because I suspect you won’t need them. But if you do, just repeat the line for each entry and prefix it with deb-src instead of deb.
  3. Depending on your country of origin you might want to replace the country prefix in the address with your own country ccTLD (based on the ISO two-letter codes). Not really necessary, but may speed downloads.

IMPORTANT EDIT!

I just realized I’m replying to a Raspberry Pi tag. It may as well be that is the reason behind the http://ports.ubuntu.com/ address of the repos and you may break your system if you start downloading from the standard repos.

That being the case, do what I tell you above, but replace all instances of http://us.archive.ubuntu.com/ubuntu/ with `http://ports.ubuntu.com/’. See if that works. I apologize for not noticing this important fact before.

2 Likes

Thanks @marfig.

Replaced the sources.list file with those URLS. Now it is saying…

E: Package ‘firefox’ has no installation candidate

Any suggestions on how to fix?

[quote=“owl, post:16, topic:13458, full:true”]Any suggestions on how to fix?[/quote]After fixing sources.list, you’re going to want to refresh the database again. Like I showed you here:

1 Like

Ran those commands, this is what I get on the last one.

Package firefox is not available, but is referred by another package.
This may mean the package is missing, has been obsoleted, or is only available from another source.

Tried with iceweasel too, did the same thing.

Anyone have a suggestion?

@owl, not being there to take a look at your system, I think it will be very hard to help at this stage.

You see, your repositories list file contained some serious problems, which means that at some point you or an application you installed messed with your system in a bad way.

sources.list is maintained by the operating system and nothing else. And if it got corrupted in the way we have seen (to the point of containing misspellings and missing even the most fundamental of the distro repos) there is no telling what other damage has been done to your installation. It is revealing however that even such a simple thing as installing a browser fails completely on your system.

So, at this point, the best course of action is for you to make a backup of your home directory in case you want to salvage some things and do a complete reinstall of Ubuntu MATE. Trying to fix this problem doesn’t seem to me a viable option at this time. With the loss of confidence on your sources.list file and without knowing when exactly this happened and why, you should also lose any confidence on your system integrity and stability. And that means a reinstall.

1 Like