You made a rather big mistake, in taking for granted that
nala doesn't need
apt - it does.
This is completely evident by running
apt depends nala, showing
nala will not function without
If you had carefully read the output of the command
nala remove apt --remove-essentials, you would most likely see that it was about to remove the
nala package itself. Hence, it's important to review what the command is about to do, especially when you run the command with the
--remove-essentials option (an option that can potentially break the system).
It's generally a good idea to do a
--dry-run before removing critical packages, or running with
--remove-essentials - and ironically, this is an option that only
apt supports, but
nala does not (yet).
Also, you didn't state why you suddenly wanted to remove
apt, but I have some guesses:
You would like to "clean up" your packages.
This is sometimes a good idea, but not when you're not sure of the consequences. Also, if you had read the first part of the
Nala is a front-end for
libapt-pkg. Specifically we interface using the
Or from the package info
apt show nala:
Commandline frontend for the APT package manager
This should have given you a hint that it's dependent on
You're satisfied with the performance of
nala for common tasks, and thus don't need
You may think this is the case, but I'd argue it's not.
nala is software in a development stage, while
apt has existed for 30 years. Also, while
nala provides the most common functionality of
apt, it can't do any of the more advanced stuff, which you suddenly might need (like
--dry-run) - and often when you least expect it. So for daily tasks
nala might be OK - but it can probably never replace the full
Now to restore
apt to your system after you have removed it, please see this Q&A. The file
/var/log/apt/history.log should actually contain a list of all the packages that were removed, which you have to reinstall manually.
What you basically have to do is find the appropriate version of
apt (example for Jammy) for your system and all it's dependent packages, and install these manually with
dpkg (since you removed the only package manager that can actually handle dependencies for you).