bash: curl: command not found
How do I fix this on a Debian Linux version 10 or 9/8?
curl command is a tool to download or transfer files/data from or to a server using FTP, HTTP, HTTPS, SCP, SFTP, SMB and other supported protocols on Linux or Unix-like system.
One can easily install and use the curl command on a Debian Linux using the apt command or apt-get command to use the curl. This page shows how to install curl on Debian Linux version 10/9/8.
Installing Curl on Debian
- Open the terminal application
- Update system, run: sudo apt update && sudo apt upgrade
- Install curl on Debian, execute: sudo apt install curl
- Test curl
Let us see how to install and use curl on Debian.
How to install curl on Debian Linux 10/9/8
Type the following command to install curl on Debian Linux:
$ sudo apt install curl
OR
$ sudo apt-get install curl
Sample outputs:
[sudo] password for vivek: Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libcurl3 The following NEW packages will be installed: curl libcurl3 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 518 kB of archives. After this operation, 989 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://mirrors.kernel.org/debian stretch/main amd64 libcurl3 amd64 7.52.1-5 [291 kB] Get:2 http://mirrors.kernel.org/debian stretch/main amd64 curl amd64 7.52.1-5 [227 kB] Fetched 518 kB in 4s (116 kB/s) Selecting previously unselected package libcurl3:amd64. (Reading database ... 240584 files and directories currently installed.) Preparing to unpack .../libcurl3_7.52.1-5_amd64.deb ... Unpacking libcurl3:amd64 (7.52.1-5) ... Selecting previously unselected package curl. Preparing to unpack .../curl_7.52.1-5_amd64.deb ... Unpacking curl (7.52.1-5) ... Setting up libcurl3:amd64 (7.52.1-5) ... Processing triggers for libc-bin (2.24-11+deb9u1) ... Processing triggers for man-db (2.7.6.1-2) ... Setting up curl (7.52.1-5) ...
Displaying curl version
For verification purpose type:
curl --version
You will see:
curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3 Release-Date: 2020-01-08 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
It seems I am using curl version 7.68.0.
Usage
Once installed the curl, you can use it as follows to see the headers for given domain:
$ curl -I https://www.google.co.in/
$ curl -I https://www.cyberciti.biz/
Headers for my blog:
HTTP/2 200 server: nginx date: Tue, 03 Oct 2017 05:24:03 GMT content-type: text/html;charset=utf-8 vary: Accept-Encoding cache-control: public,max-age=14400,s-maxage=14400,must-revalidate expires: Tue, 03 Oct 2017 09:14:57 GMT etag: d01116f2eda45a43e65b0242ed052e73 last-modified: Sat, 23 Sep 2017 17:37:16 GMT strict-transport-security: max-age=15768000 x-content-type-options: nosniff x-frame-options: SAMEORIGIN x-xss-protection: 1 x-whome: l-cbz01
We can download a file from a server using curl itself:
curl -o output.file http://server1.cyberciti.biz/foo.bar.txt
You can resume broken download with the curl command as follows:
curl -L -O -C - http://ftp.ussg.iu.edu/linux/centos/latest/isos/file.iso
Getting more help on curl
Type the following man command:
man curl
OR
curl --help
Conclusion
See also:
🐧 2 comments so far... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thankn you very much. I install it on Debian 8.
Thank you for this article.