DEV Community

Bijay Kumar Pun
Bijay Kumar Pun

Posted on

Ditching apt-get for apt

Well not really ditching, but if we are to believe in linux command manuals, then apt is being encouraged over apt-get, not that apt-get is being deprecated in any sense.

I like to think of apt as a churned down version of apt-get and apt-cache. I have been regularly using apt-get. apt-cache, however, is a different story.
A quick man apt-cache tells me apt-cache performs a wide variety of operations on APT's package cache. I know APT stands for Advance Packaging Tool, and is something the debian based linux distros use for compiling and installing software packages. apt-cache, on further google search, seems to do 'stuffs' with the packages in the remote repository.

Anyway, apt has command lines most frequently used in both apt-get and apt-cache. apt tends to make performing task easier for "end users". We can think of apt-cache and apt-get as something that works on lower level than apt.

Again, point to note is that apt-cache and apt-get are like the front end to the debian's dpkg tool, which is the core tool of the Package Management System. The dpkg tool can, however, only work with locally existing software packages. It means it cannot itself download software packages from remote repositories. To overcome this, we have many other tools built on top of dpkg, out of which, and not very surprisingly, apt-get and apt-cache are some of those. And when apt-get and apt-cache are again 'combined' in a sense, we get apt.

Alt Text

Top comments (2)

Collapse
 
ssimontis profile image
Scott Simontis

If you are trying to write automation code around apt packages, apt-get tends to produce output that is easier to parse. I personally like aptitude, which gives you a terminal-based package manager UI and is much better at resolving conflicts than the other tools.

Collapse
 
bijaykumarpun profile image
Bijay Kumar Pun

Hi @scott !
At the moment, I"m only learning about Linux. And yes aptitude is indeed much better, especially because of the interactive UI. Part of the reason why I didn't mention about aptitude was because of it's interactive UI nature, and I wanted the 'bare bones' just for the heck of it. Also I will keep in mind about apt-get outputs being easier to parse.
Thanks!