Many people shy away from Linux-based operating systems just because they’re too accustomed to using a graphical user interface. However, contrary to popular belief, Linux distributions also come with a user-friendly GUI. Now, it is possible for users to easily create folders, change wallpapers, and install different applications with the help of the desktop environment that comes with Linux. With that being said, if any issues arise, then some help from the Linux terminal will be needed. Considering this, chances are that you will still have to run a few commands every now and then. So, it would make sense that you try getting a tad bit familiar with the Linux terminal right from the start. However, there’s always a chance that you can come across an issue even if you’re running the command correctly. A few such common errors include the ‘E: Could not get lock /var/lib/dpkg/lock’ error, and the ‘bash wget command not found’ problem. We’ve provided the solution for the first problem here, while the second issue will be dealt with in this article. Firstly, we will explain to you guys what the ‘wget’ command is used for. Next, you’ll get to know about how to fix ‘bash wget command not found’ problem. So, if we have you interested, please read on!
What is the ‘wget’ Command in Linux?
If you want to download files from the Internet, you can either do so using the GUI-way or with the help of the ‘wget’ command in the Linux terminal. If you’re working with HTTP proxies or the HTTP, HTTPS, and FTPprotocols, then your best bet is to make use of the ‘wget’ utility. Courtesy of this command, it is possible for users to even download files in the background. Accordingly, you can disconnect from the system, and even that won’t stop the downloading process. Not only that, but this utility also helps with downloading files on slow or unstable networks. If a download gets interrupted because of network disconnection, it will resume when an internet connection is available. In order to use this command, you’d first have to know a thing or two about its syntax, which is as follows:
For the option part, there are several options to choose from. For instance, ‘-v’ for specifying the version, ‘-e’ for executing, and ‘-h’ for help. In place of the URL, you’d have to enter the URL of the file you want to download. Other than that, you should note that both the parameters are optional, but you’d have to include at least one of them. So, if you’re all sold by the ‘wget’ command, let’s have a look at the solution of an issue that you might face while using this command.
Step 1: Checking if ‘wget’ command is installed.
Although the ‘wget’ utility can be pretty useful, there is an error that you could come across while running it. It will basically tell you that the bash wget command is not found on the system. If you’re also seeing this error when running this command, it means that either you might not be running this command correctly, or this utility is not installed on your system, which is likely to be the case here. So, if you want to check whether your Linux system has the ‘wget’ utility installed or not, the first step would be to open the Linux terminal by simultaneously pressing the Ctrl + Alt+ T keys on your keyboard. Once the terminal appears, running the following command should do:
With the help of this command, you will see the version of the ‘wget’ utility that’s currently on your system. If you’re seeing the installed version, it means that you weren’t running this command correctly. However, if it says that this utility is missing, you’d have to follow our next step on installing the wget command on Ubuntu.
Step 2: Installing the‘ wget’ command on Linux.
If you’re getting the ‘bash wget command not found’ error even after making sure that you’re running the command correctly, it’s likely that the ‘wget’ utility has not been installed on your operating system. If that’s the case, you’re in luck since we’ll teach you how to install it in just a matter of a single command. But, first of all, you need to simultaneously press the Ctrl + Alt + T keys on your keyboard to open the Linux terminal. Afterward, you can install the ‘wget’ utility with this one simple command:
All thanks to this command, the ‘wget’ utility should be installed on your system. However, before we move further, it’s a good idea to verify its successful installation. To do so, you should try checking its version once again:
If the command prompt responds with a valid version of the installed utility, it means that you shouldn’t encounter any error while running this command. Accordingly, you’re all set to download all kinds of files in the system background. There’s a lot of uses that you can get out of the ‘wget’ utility. Whether you want to download a regular file, an HTML page, or a zip folder, rest assured that you can download all these files in the background, all thanks to this command. With that being said, it is possible that this utility didn’t come pre-installed with your Linux distribution. In this case, our guide should help you install the ‘wget’ utility with the help of a few simple commands. Although we’ll be installing it the CLI-way, you need not be too familiar with the Linux terminal. Just follow our instructions carefully, and the process should go smoothly. However, if you do end up running into an issue, feel free to tell us about it in the comment section below, so you can get help. If this guide helped you, please share it. 🙂