0
max@max-Vostro-5568:~/Desktop$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 snapd : Breaks: apt (< 1.6.3) but 1.6.1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Further I try to eliminate these problems, but self-removal occurs.

max@max-Vostro-5568:~/Desktop$ sudo apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libapt-inst1.5 libapt-pkg4.12 linux-headers-5.3.0-28
  linux-headers-5.3.0-28-generic linux-image-5.3.0-28-generic
  linux-modules-5.3.0-28-generic linux-modules-extra-5.3.0-28-generic
  python3-debconf
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apt
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
  apt
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 3,896 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
 ?] Yes, do as I say!
(Reading database ... 223329 files and directories currently installed.)
Removing apt (1.6.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
max@max-Vostro-5568:~/Desktop$ apt
bash: /usr/bin/apt: No such file or directory
maksonnie
  • 111

1 Answers1

0

For Ubuntu 18.04. Try this in a terminal:

For AMD64 machines:

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb

Then run:

sudo dpkg -i apt_1.6.6ubuntu0.1_amd64.deb

Or for Intel x86 machines:

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_i386.deb

Then run:

sudo dpkg -i apt_1.6.6ubuntu0.1_i386.deb

Notice:

  • For other releases of Ubuntu, please search Ubuntu packages and select your release then download the suitable version of APT and install it like above.

  • Refer to this answer and fix your sources list and PPA's.

  • Always run sudo apt update before installing or upgrading any packages.

  • If you have aptitude installed, you can use it to install APT instead ( after checking your repositories list is correct by referring to the linked answer above ) like so:

    sudo aptitude update

    then:

    sudo aptitude install apt

Raffa
  • 32,237
  • dpkg: regarding apt_1.6.6ubuntu0.1_amd64.deb containing apt: apt breaks aptitude (<< 0.8.10) aptitude (version 0.6.8.2-1ubuntu4) is present and installed. – maksonnie Apr 23 '20 at 19:27
  • @MaxB Fix your repositories sources list like in the linked answer then do sudo aptitude update then sudo aptitude install apt. You appear to have aptitude installed. – Raffa Apr 23 '20 at 19:37