Tags

, , , , ,

Sometimes when we are playing around or we are more concern with the security about the system and wants to remove/uninstall packages from our server, sometimes some package accidentally gets removed. Among those, some are very critical for the system to manage.

Once I was analysing security on my ubuntu server, I accidentally remove the package manager and rebooted my server. Now when I try to install any package eg  htop, I got issue regarding apt-get: command not found

OMG, what’s happening, now neither I can update/install/remove any of the packages, the options suggested on the internet was to re-install or a very complex way to repair, huuu, I can’t do that. After hard research and try, I came up with a solution.

Here are the steps how I resolved it on Ubuntu Xenial

Search the appropriate version of apt from here apt_1.4_amd64.deb for ubuntu xenial

1. Download the apt.deb

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.4_amd64.deb

2. Install the apt.deb package

sudo dpkg -i apt_1.4_amd64.deb

3. Now we can easily run

sudo apt-get install 

Thank GOD, now I can manage the packages which I want as per need.

I hope this post will help you and save your time, money and infrastructure.

Happy Learning