-bash: aptitude: command not found is an error you can get when you are just starting with a Linux VPS. Aptitude is an application management tool just like apt-get, but with more features. If you ever get this error on your VPS, this page will help to solve it.
Aptitude is a more advanced alternative to apt-get. You can use it to install and remove application from your server. The main difference between aptitude and apt-get are that you can use aptitude to search and query applications as well. Apt-get doesn’t offer it at the moment. And also, you won’t get an error like “command not found’ with apt-get.
You are more likely to get this error when you are trying to install an application in your Linux box with aptitude. As I said before it is a tool to manage application packages on your system. But unlike apt-get, it does not come bundled with your OS. So you have to install it before using it. Error ‘bash: aptitude: command not found’ confirmed that you don’t have it on your VPS.
So to solve this, you need to install it on your server. The best way to do that is by using apt-get. You can execute below command on CLI to install it.
sudo apt-get install aptitude
It’ll fix the error for most of you. But if your OS is not up to date, you’ll get an error like below.
Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package aptitude
This is a common error with Linux when package is not available on its dependency. Updating your VPS will fix it. Execute below commands to update it.
sudo apt-get update sudo apt-get upgrade
It may take couple of minutes to update. Run install command again after the update to install aptitude. It should install now. And from now on you won’t get -bash: aptitude: command not found on CLI for that server.