How to Fix the “apt command not found” Error

2

“This article explains how to solve the “apt-get command not found” error in Linux.

It is essential to explain maximum customers getting this mistake don’t seem to be getting a real device error, however they’re the usage of a Linux distribution with a special applications supervisor than apt. It is most often led to by means of a user-side mistake.

In maximum instances, customers dealing with this message simply want to use the correct applications supervisor for his or her Linux distribution.

The apt or apt-get bundle managers are utilized by Debian-based Linux distributions like Ubuntu.

If you’re the usage of a special Linux distribution like CentOS, you want to make use of the yum applications supervisor as an alternative of apt. If you’re the usage of Fedora, use the dnf applications supervisor.

SUSE customers will have to use the zypp applications supervisor.

If you’re the usage of a Linux distribution like Debian or Ubuntu and also you get the “apt command not found error”, then stay studying under. The first segment of this record is for Ubuntu customers; directions for Debian customers may also be present in the second one segment.

Fixing the “apt command not found” Error in Ubuntu Linux

In this educational, I guess, for some explanation why, the apt applications supervisor frontend were given got rid of out of your device.

The directions under describe all steps to put in the ultimate apt bundle liberate for Ubuntu.

To start, get right of entry to this hyperlink https://applications.ubuntu.com/ and scroll down the web page to search out the Search segment.

Type apt within the key phrase box, make a choice the proper Ubuntu liberate and press the Search button as pointed by means of the arrows within the screenshot under.

Scroll down the outlet web page and press the hyperlink to the apt bundle, as proven within the following symbol.

Scroll down the outlet web page. At the ground, you’ll in finding hyperlinks for each and every structure; press the proper one on your device.

To end downloading apt, press the obtain hyperlink.

Once the bundle is downloaded, set up it the usage of dpkg as proven under. It is necessary to explain that 1.6.12ubuntu0.2_amd64 will have to get replaced with the precise model and structure you’ve downloaded.

sudo dpkg -i apt_1.6.12ubuntu0.2_amd64.deb

Test apt once more to test if it now works.

If it nonetheless does now not paintings, there may be more than likely an issue with the $PATH surroundings variable.

To verify it, first test the place the apt binary is. You can use the command whereis, as proven within the following instance.

As you’ll be able to see, the binary is beneath the binaries listing /usr/bin (/usr/bin/apt).

To verify if the trail is integrated to your $PATH surroundings variables, use the command echo adopted by means of the surroundings variable you need to test ($PATH).

As you’ll be able to see, each and every trail is separated by means of a colon. If, to your case, the trail /usr/bin isn’t integrated, upload it the usage of the export command as proven within the following symbol, then take a look at apt once more.

export PATH=$PATH:/usr/bin

If, after exporting the trail, the apt applications supervisor works correctly, you in finding the issue. But exporting the trail from the command line is just a brief repair with out endurance after a device reboot or consultation alternate.

To make this resolution everlasting, open the .bashrc record inside of your house listing the usage of a textual content editor like nano or vi.

At the tip of the record, upload the next line.

export PATH=$PATH:/usr/bin”

Close the .bashrc record saving adjustments and replace the trail surroundings variable by means of executing the next command.

Now the apt command will have to paintings.

How to Fix the Error “apt command not found” in Debian Linux

For Debian customers to mend this mistake, first seek advice from the hyperlink https://www.debian.org/distrib/applications#search_packages and scroll down to search out the Search segment.

On the key phrase box, sort apt, make a choice the proper Debian distribution and press the Search button.

You will probably be redirected to a web page containing an inventory of applications. Press the apt bundle hyperlink belonging for your Debian model.

Scroll down the outlet web page and press the proper structure on your device.

After being redirected to the mirrors web page, press any of them to start out downloading the bundle.

In some instances, your browser might save you you from downloading the bundle. Allow the bundle to be downloaded.

Once you get the bundle the usage of the dpkg applications supervisor to put in it, as proven under. Remember that 2.2.4_amd64 will have to get replaced with the real model/structure you’re downloading.

sudo dpkg -i apt_2.2.4_amd64.deb

Now the apt command will have to paintings. If it nonetheless does now not paintings, there may be more than likely an issue with the $PATH surroundings variable.

First, test the place the apt binary is. You can use the command whereis, as proven within the following instance.

As you’ll be able to see, the binary is beneath the listing /usr/bin (/usr/bin/apt).

To see if the trail is integrated to your surroundings variables, use the command echo adopted by means of the surroundings variable you need to test (In this example, $PATH).

As you’ll be able to see, each and every trail is separated by means of a colon. If, to your case, the trail /usr/bin isn’t integrated, upload it the usage of the export command as proven under, then take a look at apt once more.

export PATH=$PATH:/usr/bin

If, after exporting the trail, the apt applications supervisor works, you in finding the issue. But exporting the trail from the command line is just a brief repair with out affect after rebooting or converting the consultation.

To make this repair everlasting open the .bashrc record inside of your house listing the usage of a textual content editor.

At the tip of the record, upload the next line.

export PATH=$PATH:/usr/bin”

Close the .bashrc record saving adjustments and replace the trail surroundings variable by means of executing the next command.

That’s all; I’m hoping those steps repair your downside.

Conclusion

The maximum not unusual reason for this mistake message is the improper use of a bundle supervisor now not suitable with the put in Linux distribution. In maximum instances, it is a mistake from the person’s aspect. But if the person is making an attempt to make use of the apt applications supervisor appropriately in a suitable Linux distribution, putting in it or solving the trail, as described on this educational, very more than likely will resolve the issue, until it isn’t a outcome of a improper set up or a extra critical device failure. All conceivable answers in the past defined are lovely simple to put into effect by means of any Linux person, independently of the experience degree. It best calls for the usage of the dpkg applications supervisor or solving the trail.

Thank you very a lot for studying this newsletter; I’m hoping it was once useful to unravel the issue. Keep following us for added pointers and tutorials.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More