I'd like to install the Brave browser, but curl cannot be installed.

E: Package 'curl' has no installation candidate

The previous question suggested I should switch to another ubuntu mirror. I switched to the best server, yet nothing changed.

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package curl is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'curl' has no installation candidate

Updating gives the following:

Hit:1 http://ppa.launchpad.net/micahflee/ppa/ubuntu focal InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

apt policy ubuntu-desktop gives

  Installed: 1.450.1
  Candidate: 1.450.1
  Version table:
 *** 1.450.1 100
        100 /var/lib/dpkg/status

Kulfy, thank you. I had to run these lines first, then it got installed

apt remove -y libcurl4
apt install -y libcurl4 curl

Ruby, thank you. At this moment, the browser is being installed. I fixed the problem based on this answer https://askubuntu.com/a/1051988/1100108 Not sure if your solution leads to the same thing, but all good now.

  • 1
    Just for a check, what is the output of apt policy ubuntu-desktop? On my system it and curl are in the same repo, which suggests you may have something fundamentally broken. – Organic Marble Jul 9 '20 at 15:29
  • 1
    Does this answer your question? How do I restore the default repositories? curl is in main. Try restoring default repositories – Kulfy Jul 9 '20 at 15:48
  • There's definitely something wrong with your repos based on that output. – Organic Marble Jul 9 '20 at 17:35
  • Possible duplicate of askubuntu.com/q/1029273 – karel Jul 9 '20 at 19:21

This is a problem with your repository, curl is available in Ubuntu main. You need to update your repository. Open terminal and run

nano /etc/apt/sources.list

Update your repository and run

sudo apt-get update
sudo apt-get install curl
  • 1
    This is not a comment, this is an answer. :) You can improve your answer by elaborating the meaning of "Replace the old repository with the new one", i.e., what you meanby "the new one". – Kulfy Jul 9 '20 at 16:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.