Score:0

Getting curl command not found error while trying to install Mariadb

gr flag

I am following a mariadb documentation in which the starting steps have been completed but when I use this command.

sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 
'https://mariadb.org/mariadb_release_signing_key.asc'

This command gives me an error:

sudo: curl: command not found

I have tried to install curl on my Ubuntu using these commands.

sudo apt update
sudo apt install curl

I am not sure whether it is installed now but it gives me the same error when i try to use the above command again.

For more understanding I am also adding the screenshot of some additional commands too.

Curl commands image

Simon Sudler avatar
us flag
This is in fact very strange, but with the provided information it is impossible to fix. Run the following commands and [add](https://askubuntu.com/posts/1460839/edit) the output to your question: `which curl`, `curl https://www.google.com`, `sudo which curl`, `sudo curl https://www.google.com`
Waleed Ahmed Shahid avatar
gr flag
I have added the image to the question. It would be great if you can help me with it.
Score:0
mx flag

Something went wrong during the installation of curl as it seems that your systems still misses it.

In order to check if the package curl is installed, you can try to run the following command:

apt-cache policy curl

Which should print something like this:

curl:
  Installed: 7.81.0-1ubuntu1.10
  Candidate: 7.81.0-1ubuntu1.10
  Version table:
 *** 7.81.0-1ubuntu1.10 500
        500 http://it.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
        100 /var/lib/dpkg/status
     7.81.0-1 500
        500 http://it.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

Update

If the package is correctly installed this command should show where the binary is

$ dpkg -L curl | grep bin
/usr/bin
/usr/bin/curl

Check the $PATH variable:

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin

If it's not present, you can temporarily add /usr/bin to your $PATH variable with:

$ export PATH=/usr/bin:$PATH

To make this change permanent you can edit ~/.profile (user wide) or /etc/environment (system wide)

If everything else fails, you can always manually run the binary file using the full path:

$ /usr/bin/curl
curl: try 'curl --help' or 'curl --manual' for more information
Waleed Ahmed Shahid avatar
gr flag
I am getting the same response as you are getting waleed@waleed-VirtualBox:~$ apt-cache policy curl curl: Installed: 7.81.0-1ubuntu1.10 Candidate: 7.81.0-1ubuntu1.10 Version table: *** 7.81.0-1ubuntu1.10 500 500 http://pk.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages 100 /var/lib/dpkg/status 7.81.0-1 500 500 http://pk.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
Score:0
us flag

The curl package seems to be broken, therefore reinstall the package with

$ sudo apt install --yes --reinstall curl

This will fix any missing binaries.

However, package binaries going missing is not a "normal" behavior. Someone or something must deliberately delete these files.

Score:0
gr flag

I have tried all of these commands for the installation of the curl.

sudo apt install curl

I also tried that command which is used for the reinstallation of curl.

sudo apt install --yes --reinstall curl

After that command it was showing that curl was installed as I checked it with the following command.

apt-cache policy curl

It showed the following response which stated that curl is installed now.

curl:
Installed: 7.81.0-1ubuntu1.10
Candidate: 7.81.0-1ubuntu1.10
Version table:
7.81.0-1ubuntu1.10 500
500 http://pk.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages
100 /var/lib/dpkg/status
7.81.0-1 500
500 http://pk.archive.ubuntu.com/ubuntu jammy/main amd64 Packages

But the issue didn't resolve because of that but when I updated my ubuntu to 22.04 then this issue has been resolved and the following command has worked fine.

sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc 
'https://mariadb.org/mariadb_release_signing_key.asc'

So, there was an issue with the command I was using with the curl and that's why it was giving the error and it's solved now.

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.