[Resolved] Mint-apt vs Debian-apt

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
tovian
Level 5
Level 5
Posts: 529
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

[Resolved] Mint-apt vs Debian-apt

Post by tovian » Thu May 17, 2018 10:39 am

I have been researching "apt" and "apt-get" on the internet. I just ran across this statement...

"Just a quick word for Linux Mint users. A few years ago, Linux Mint implemented a python wrapper called apt that actually uses apt-get but provides more friendly options. This apt which we are discussing here is not the same as the one in Linux Mint."

Complete article here

Is this still correct? If I want to use the Debian version of apt what do I need to do?
Last edited by tovian on Fri May 18, 2018 11:31 am, edited 1 time in total.
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part!"
"We're just the guys to do it.”

Animal House

User avatar
JoeFootball
Level 6
Level 6
Posts: 1464
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Mint-apt vs Debian-apt

Post by JoeFootball » Thu May 17, 2018 10:46 am

tovian wrote:Is this still correct?
I ran across that very same article a few months ago. If I recall, I investigated the source of my current version of apt, and it appeared to be of the Debian variety, so I assumed the author's statement was of a prior version that LM once implemented.

Joe

User avatar
smurphos
Level 7
Level 7
Posts: 1601
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Mint-apt vs Debian-apt

Post by smurphos » Thu May 17, 2018 11:18 am

Nope Mint still has two versions of apt - the Debian apt (usr/bin/apt) and a Mint apt python wrapper (usr/local/bin/apt). Unless you've messed with your $PATH or uninstalled the package mintsystem (which provides the mint apt) the latter has precedence when simply using apt in the terminal. To specifically run debian apt you need to use /usr/bin/apt in Mint.

Compare the output of

apt -h (Mint's apt python wrapper)

to

/usr/bin/apt -h (Debian apt)

Mint's apt brings various package management commands into one command. Under the hood it is still running the original commands.

e.g You can use apt showhold which actually runs apt-mark showhold or apt deb which actually runs sudo dpkg -i and asks you nicely for your password.

Similarly if you apt install it actually runs sudo /usr/bin/apt install and asks you nicely for your password..... :D

User avatar
JoeFootball
Level 6
Level 6
Posts: 1464
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: Mint-apt vs Debian-apt

Post by JoeFootball » Thu May 17, 2018 11:25 am

smurphos wrote:Mint's apt brings various package management commands into one command. Under the hood it is still running the original commands.
Good to know! Thanks! :)

Joe

User avatar
tovian
Level 5
Level 5
Posts: 529
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

Re: Mint-apt vs Debian-apt

Post by tovian » Thu May 17, 2018 11:31 am

JoeFootball wrote:
Thu May 17, 2018 10:46 am
I ran across that very same article a few months ago.......
Achtung! Achtung!

It was NOT my question - it was Joe's answer - that brought the site down :lol: :lol:
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part!"
"We're just the guys to do it.”

Animal House

User avatar
tovian
Level 5
Level 5
Posts: 529
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

Re: Mint-apt vs Debian-apt

Post by tovian » Thu May 17, 2018 12:12 pm

smurphos wrote:
Thu May 17, 2018 11:18 am
Mint's apt brings various package management commands into one command. Under the hood it is still running the original commands.
If I understand correctly...
original commands = apt-get and/or apt-cache (?) - NOT the Debian apt which seeks to combine many of the commands in apt-get and apt-cache

Good input - Many thanks for this info !!
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part!"
"We're just the guys to do it.”

Animal House

User avatar
smurphos
Level 7
Level 7
Posts: 1601
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Mint-apt vs Debian-apt

Post by smurphos » Thu May 17, 2018 12:21 pm

It uses all sorts - apt, apt-get, apt-cache, apt-mark, aptitude, dpgk, dpkg-buildpackage, add-apt-repository plus a couple of other mint specific python scripts.

Here is a snippet from its code - accessed via cat /usr/local/bin/apt that will give you an idea of how it translates apt <command> into something else..

Code: Select all

if argcommand in ("autoremove", "list", "show", "install", "remove", "purge", "update", "upgrade", "full-upgrade", "edit-sources"):
    # apt
    command = "/usr/bin/apt %s %s" % (argcommand, argoptions)
elif argcommand in ("clean", "dselect-upgrade", "build-dep", "check", "autoclean", "source", "moo"):
    # apt-get
    command = "apt-get %s %s" % (argcommand, argoptions)
elif argcommand in ("changelog", "reinstall"):
    # aptitude
    command = "aptitude %s %s" % (argcommand, argoptions)
elif argcommand in ("stats", "depends", "rdepends", "policy"):
    # apt-cache
    command = "apt-cache %s %s" % (argcommand, argoptions)
elif argcommand in ("recommends", ):
    command = "/usr/lib/linuxmint/mintsystem/mint-apt-recommends.py " + argoptions
elif argcommand in ("showhold", "hold", "unhold"):
    # apt-mark
    command = "apt-mark %s %s" % (argcommand, argoptions)
elif argcommand in ("markauto", "markmanual"):
    # apt-mark
    command = "apt-mark %s %s" % (argcommand[4:], argoptions)
elif argcommand == "contains":
    command = "dpkg -S %s" % argoptions
elif argcommand == "content":
    command = "dpkg -L %s" % argoptions
elif argcommand == "deb":
    command = "dpkg -i %s" % argoptions
elif argcommand == "build":
    command = "dpkg-buildpackage %s" % argoptions
elif argcommand == "version":
    command = "/usr/lib/linuxmint/common/version.py %s" % argoptions
elif argcommand == "download":
    command = "/usr/lib/linuxmint/mintsystem/mint-apt-download.py " + argoptions
elif argcommand == "add-repository":
    command = "add-apt-repository %s" % argoptions
elif argcommand == "search":
    command = "aptitude -w %s %s %s" % (columns, argcommand, argoptions)
Edit to add ... :roll:

Code: Select all

steve@steve-HP-Pavilion-g6-Notebook-PC ~ $ apt moo
                 (__) 
                 (oo) 
           /------\/ 
          / |    ||   
         *  /\---/\ 
            ~~   ~~   
..."Have you mooed today?"...

lmuserx4849

Re: Mint-apt vs Debian-apt

Post by lmuserx4849 » Thu May 17, 2018 2:02 pm

On LM 17.3:

# Where is it
===> type -a apt apt-get
apt is /usr/local/bin/apt
apt is /usr/bin/apt
apt-get is /usr/bin/apt-get

# What package installed it
===> dpkg -S /usr/local/bin/apt /usr/bin/apt /usr/bin/apt-get
mintsystem: /usr/local/bin/apt
apt: /usr/bin/apt
apt: /usr/bin/apt-get

# Who maintains it
===> dpkg -s mintsystem apt | grep ^Maintainer:
Maintainer: Clement Lefebvre ...
Maintainer: Ubuntu Developers ...

# What type of file is it (i.e., can it be viewed locally)
===> file /usr/local/bin/apt /usr/bin/apt /usr/bin/apt-get
/usr/local/bin/apt: Python script, ASCII text executable
/usr/bin/apt: ELF 64-bit LSB ...
/usr/bin/apt-get: ELF 64-bit LSB ...

# Is /usr/local before /usr/bin, therefore mintsystem apt will be executed
===> echo -e ${PATH//:/'\n'}

This is a pro for rpm and con for dpkg --- dpkg-query, apt, apt-get, apt-cache, aptitude, grep-status.
Linux Mint pdf doc, page 40, mentions synaptic & apt.
It isn't unusual for a Distribution to do this. It is one of the unique benefits of any distribution.

User avatar
tovian
Level 5
Level 5
Posts: 529
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

Re: [Resolved] Mint-apt vs Debian-apt

Post by tovian » Fri May 18, 2018 11:33 am

This is getting way beyond my pay-grade.

I have the information I need (I think) so I will mark this "Resolved"

Thank you for all the good info !!
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part!"
"We're just the guys to do it.”

Animal House

Post Reply

Return to “Software & Applications”