LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Difference between apt and apt-get (https://www.linuxquestions.org/questions/linux-newbie-8/difference-between-apt-and-apt-get-4175473904/)

dermetfan 08-19-2013 10:22 AM

Difference between apt and apt-get
 
Hi everyone,
I'd like to know why there is the 'apt-get' and 'apt' command. They seem to do the exact same things, however 'man apt' tells me that 'apt-get' has a few more features.
Why are there two versions of apt?

Thank you!

jdkaye 08-19-2013 10:59 AM

I don't think there is an apt command. There's certainly none on my system except for the one used by java. So the simple answer is that there are not two versions of apt. On the command line use aptitude or apt-get for managing packages.
jdk (not java)

TobiSGD 08-19-2013 10:59 AM

APT is not a command itself, but it is a package management system. Several package managers can use this package management system, for example apt-get, aptitude, Synaptic or the Software Center. It just appears that the authors of apt-get have implemented more command-line options than the authors of aptitude (which in opposition to apt-get comes with an interactive user-interface) or Synaptic (which is designed for graphical usage).
So in general, there is only one version of APT, but it is used by different frontends, each with a different approach and therefore catering to different users. I personally just use apt-get because I am used to it, I also could run aptitude (it does even understand the same command-line options), just use what you prefer.

climaxnix 08-19-2013 11:23 AM

when i first started using linux, with the habbit of a windows user, i like to use Synaptics. But afterwards i felt more comfartable with tools like apt-cache [search|show], dpkg and apt-get.

One of the reason is that i try to keep track of my system modifications. for example if i install a new package i took outputs of some of the commands mentioned above and put them in a log file that i create.

So i think all is about preferences and being comfartable.

dermetfan 08-19-2013 11:28 AM

@jdkaye Maybe it's because of your distro, I do have this command though.
@TobiSGD Ah, so apt-get is dependent on apt. I thought apt-get was apt itself and not a frontend for it. Thanks!
@climaxnix I use the command line for the same reason. It unsettled me when I found out about the two commands, I wanted to know the tools I'm using.

jdkaye 08-19-2013 12:23 PM

Quote:

Originally Posted by dermetfan (Post 5011985)
@jdkaye Maybe it's because of your distro, I do have this command though.

My distro is Debian, which is what I thought you were using.
Out of curiosity, can you post the path to the "apt" command. Do you happen to know what package contains the "apt" command?
I did find an executable called "apt" in /etc/cron.daily/. Maybe that's what you mean. It's not really meant to be used from the command line however.
jdk

dermetfan 08-19-2013 01:36 PM

That's weird because mine is based on Debian. The path is /usr/local/bin/apt. Unfortunately I don't know the package and apt-file returned way too much.

jdkaye 08-19-2013 02:02 PM

Quote:

Originally Posted by dermetfan (Post 5012042)
That's weird because mine is based on Debian. The path is /usr/local/bin/apt. Unfortunately I don't know the package and apt-file returned way too much.

Aha! /usr/local/bin is the typical location of things you have compiled from source yourself. Perhaps the source code lacked the "-get" after the "apt" when creating the executable. In any event that is not the typical location for such system executables. You generally find them in /usr/bin, /usr/sbin, /bin, or /sbin.
jdk

TobiSGD 08-19-2013 02:33 PM

Quote:

Originally Posted by dermetfan (Post 5012042)
Unfortunately I don't know the package and apt-file returned way too much.

If you give apt-file the exact path it should only come up with packages really containing that binary.

dermetfan 08-19-2013 02:39 PM

Quote:

Originally Posted by jdkaye (Post 5012056)
Aha! /usr/local/bin is the typical location of things you have compiled from source yourself.

Well I'm pretty sure I didn't compile anything from source yet at all because I just installed this system like three days ago. Also apt doesn't seem like something you'd manually install after the installation, it's too important.
I guess it's like TobiSGD said, apt-get is a frontend for apt.
The description from 'man apt' seems to agree with that:
Quote:

Originally Posted by man
APT is a management system for software packages. For normal day to day
package management there are several frontends available, such as apti‐
tude(8) for the command line or synaptic(8) for the X Window System.
Some options are only implemented in apt-get(8) though.

It's weird apt is in /usr/local/bin/apt and apt-get in /usr/bin/apt-get then though.

dermetfan 08-19-2013 02:42 PM

Quote:

Originally Posted by TobiSGD (Post 5012077)
If you give apt-file the exact path it should only come up with packages really containing that binary.

'apt-file find /usr/local/bin/apt'
gives me nothing.

EDIT: Wait a moment, didn't update...
EDIT2: Takes longer to search, but still returns nothing.

TobiSGD 08-19-2013 03:29 PM

When I say that apt-get (and others) is a frontend for APT (the Advanced Packaging Tool) that doesn't mean that there exists a program apt somewhere that is used by apt-get. APT is more of a protocol that is used by different programs through the libapt-pkg library. On a normal Debian system there is no program called apt, especially not in /usr/local, which shouldn't be used by Debian packages at all. May it be that you have installed a custom package from a third party source?

273 08-19-2013 03:53 PM

I just had a play in a VM with a live DVD of Ubuntu 13.04 Beta (the most recent I have) and it doesn't have an executable called apt but on the Linux Mint 13 live DVD (again, the latest I have) there is, indeed, an executable /usr/bin/apt that is a wrapper script in Python for apt-get. It belongs to the mintsystem package, apparently.

dermetfan 08-19-2013 04:23 PM

Quote:

Originally Posted by 273 (Post 5012120)
I just had a play in a VM with a live DVD of Ubuntu 13.04 Beta (the most recent I have) and it doesn't have an executable called apt but on the Linux Mint 13 live DVD (again, the latest I have) there is, indeed, an executable /usr/bin/apt that is a wrapper script in Python for apt-get. It belongs to the mintsystem package, apparently.

Thanks! This seems to be the solution. I tried what happened if I uninstalled it and it seems to match with what you found out.

Quote:

Originally Posted by apt-get remove apt -s

The following packages will be REMOVED:
apt aptdaemon apturl ddm mint-meta-debian-core mintwelcome python-aptdaemon
python-aptdaemon.gtk3widgets python-software-properties
software-properties-gtk unattended-upgrades wajig
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
[...]


273 08-19-2013 04:25 PM

Thanks for posing the question -- I like to find out these little differences in the distributions.


All times are GMT -5. The time now is 06:36 AM.