0

On Ubuntu 18.04.2 LTS, I completely removed/uninstalled my apt-get because of problems I was having.

I tried re-installing it with dpkg by runnung:

 $ sudo wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt-transport-https_1.0.1ubuntu2.23_amd64.deb

to install apt-transport-https then it's dependency:

$ sudo wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_1.0.1ubuntu2_amd64.deb

then I ran the two following commands

$ sudo dpkg -i libapt-pkg4.12_1.0.1ubuntu2_amd64.deb
$ sudo dpkg -i apt-transport-https_1.0.1ubuntu2.23_amd64.deb

but when I try run apt or apt-get I still get the error

command not found

I'm still pretty new to ubuntu and I'm not sure what to do

3

If you remove APT using sudo apt remove apt, following packages are affected in a standard installation (at least in bionic (18.04)):

apt apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common

To reinstall APT:

  • Download the .deb file of APT.

    wget http://mirrors.edge.kernel.org/ubuntu/pool/main/a/apt/apt_1.6.10_amd64.deb
    
  • Install using dpkg.

    sudo dpkg -i apt_1.6.10_amd64.deb
    
  • Install previously affected packages.

    sudo apt install apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common
    

Note: This answer is an excerpt from my answer on How can I re install the APT Tool? - Ask Ubuntu

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.