How to Search DuckDuckGo from the Linux Terminal

Like Googler (Google Site Search from the command-line), ddgr is a command line utility that can be used to search for key terms words via DuckDuckGo search engine and a command line browser on your terminal prompt.

Before installing ddgr command line search engine in Linux, first assure that the Python 3.4 and Python requests library needed to handle HTTPS requests are installed on your system, by issuing the following commands.

------------------ On CentOS, RHEL & Fedora ------------------ 
# yum install epel-release
# yum install python34 python34-requests

------------------ On Debian & Ubuntu ------------------
# apt install python3 python3-requests

In order to open ddgr searches you need to install a command line browser, such as elinks, links, lynx, w3m or www-browser, in your system.

Read Also: 8 Command Line Tools for Browsing Websites

In this guide we’ll configure ddgr search engine to open links via lynx text based browser.

# yum insall lynx         [On CentOS, RHEL & Fedora]
# apt-get install lynx    [On Debian & Ubuntu]

Next, set the BROWSER environment variable system-wide to point to lynx browser, by issuing the following commands with root privileges.

# export BROWSER=lynx
# echo “export BROWSER=lynx” >> /etc/profile

In order to install DuckDuckGo search engine command line utility via official ddgr github binary package releases, issue the following commands specific to your own Linux distribution.

------------------ On CentOS, RHEL & Fedora ------------------
# yum install https://github.com/jarun/ddgr/releases/download/v1.1/ddgr-1.1-1.el7.3.centos.x86_64.rpm 

------------------ On Ubuntu 16.04 ------------------
# wget https://github.com/jarun/ddgr/releases/download/v1.1/ddgr_1.1-1_ubuntu16.04.amd64.deb
# dpkg -i ddgr_1.1-1_ubuntu16.04.amd64.deb

------------------ On Ubuntu 17.10 ------------------
# wget https://github.com/jarun/ddgr/releases/download/v1.1/ddgr_1.1-1_ubuntu17.10.amd64.deb 
# dpkg -i ddgr_1.1-1_ubuntu17.10.amd64.deb

------------------ On Debian 9 ------------------
# wget https://github.com/jarun/ddgr/releases/download/v1.1/ddgr_1.1-1_debian9.amd64.deb 
# dpkg -i ddgr_1.1-1_debian9.amd64.deb

You can also install ddgr on Ubuntu using a PPA repository, which is maintained by the developer of ddgr project.

$ sudo add-apt-repository ppa:twodopeshaggy/jarun
$ sudo apt-get update
$ sudo apt-get install ddgr

How to Search DuckDuckGo from Terminal Using ddgr

Finally, in order to search a specific keyword in ddgr serach engine, issue the command as shown in the below example.

# ddgr tecmint
Search DuckDuckGo from Commandline

Search DuckDuckGo from Commandline

To automatically open a specific displayed search result in lynx text-based browser, hit the corresponding number key and wait for the webpage to load. Sometimes you need to type “a” in lynx browser in order to always accept website cookies and load the website.

That’s all! For other information regarding DuckDuckGo command line search engine utility, visit ddgr official github page.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

1 Response

  1. xABBAAA says:

    very Cool thing for real…

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.