[SOLVED] apt and/or apt-get?

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
tridephysique

[SOLVED] apt and/or apt-get?

Post by tridephysique »

Hello,

I always use apt-get to install software on Ubuntu and I have been using it on Linux Mint.
Last day, I read the Mint User Manual. It mentioned apt instead of apt-get.
Are they different commands or just the same ones? If they are different, in what way?

Thank you
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
axel668

Re: apt and/or apt-get?

Post by axel668 »

it's the same ... there's also apt-cache and a couple of other commands in the apt family, too, probably that's why Mint manual talks about apt
abnvolk

Re: apt and/or apt-get?

Post by abnvolk »

Yup, to me it's like a shortcut. Instead of typing sudo apt-get install, I type apt install, apt remove...
zerozero

Re: apt and/or apt-get?

Post by zerozero »

apt is a mint's specific python wrapper for several debian package management tools (APT, aptitude, dpkg).
it's easier (for example you don't need to type sudo apt-get install a simple apt install will ask for your p/w and carry on the task) and in a way it's more powerful (because picks the "best" commands from the several package management tools)

Code: Select all

which apt

Code: Select all

cat /usr/local/bin/apt

Code: Select all

if argcommand in ["install", "remove", "update", "upgrade", "dist-upgrade", "clean", "dselect-upgrade", "build-dep", "check", "autoremove", "autoclean"]:
	aptcommand = "apt-get"
	command = sudo + " " + aptcommand + " " + argcommand + argoptions	
elif argcommand in ["source", "moo"]:
	aptcommand = "apt-get"
	command = aptcommand + " " + argcommand + argoptions		
elif argcommand in ["search", "show", "changelog"]:
	aptcommand = "aptitude"
	command = aptcommand + " " + argcommand + argoptions
elif argcommand in ["reinstall"]:
	aptcommand = "aptitude"
	command = sudo + " " + aptcommand + " " + argcommand + argoptions	
elif argcommand in ["stats", "depends", "rdepends", "policy"]:
	aptcommand = "apt-cache"
	command = aptcommand + " " + argcommand + argoptions
elif argcommand == "sources":
	command = sudo + " nano /etc/apt/sources.list"
elif argcommand == "held":
	command = "dpkg --get-selections | grep hold"
elif argcommand == "contains":
	command = "dpkg -S" + argoptions
elif argcommand == "content":
	command = "dpkg -L" + argoptions
elif argcommand == "hold":
	command = "echo " + argoptions + " hold | sudo dpkg --set-selections"
elif argcommand == "unhold":
	command = "echo " + argoptions + " install | sudo dpkg --set-selections"
elif argcommand == "version":
	command = "/usr/lib/linuxmint/common/version.py" + argoptions
elif argcommand == "purge":
	command = sudo + " apt-get remove --purge" + argoptions
elif argcommand == "build":
	command = sudo + " dpkg-buildpackage" + argoptions
elif argcommand == "deb":
	command = sudo + " dpkg -i" + argoptions
elif argcommand == "download":
    command = "apt-cache depends " + argoptions + " |grep -v \"Conflicts:\|Replaces:\"|awk '{print $NF}'|sed -e 's/[<>]//g'|xargs aptitude download -r"
else:
tridephysique

Re: apt and/or apt-get?

Post by tridephysique »

Thanks everybody, I'm going to use apt on linumint.
User avatar
xenopeek
Level 25
Level 25
Posts: 29459
Joined: Wed Jul 06, 2011 3:58 am

Re: apt and/or apt-get?

Post by xenopeek »

zerozero wrote:

Code: Select all

elif argcommand in ["source", "moo"]:
	aptcommand = "apt-get"
	command = aptcommand + " " + argcommand + argoptions
It even implements moo :lol: Try it:

Code: Select all

apt moo
Image
zerozero

Re: apt and/or apt-get?

Post by zerozero »

:lol: :lol:

Code: Select all

zerozero@deb-kde ~ $ apt moo
         (__) 
         (oo) 
   /------\/ 
  / |    ||   
 *  /\---/\ 
    ~~   ~~   
...."Have you mooed today?"...
zerozero@deb-kde ~ $ 
killer de bug

Re: apt and/or apt-get?

Post by killer de bug »

Thanks a lot ZeroZero !
I use apt everyday on my LMDE but... I wasn't aware it was Mint specific ! Thanks a lot :mrgreen:
zerozero

Re: apt and/or apt-get?

Post by zerozero »

you're welcome killer :D (btw i have to reboot and test those new UP6 updates :wink: )

Vincent,
there's one for you

Code: Select all

apt sources
handy hey :lol:
Locked

Return to “Beginner Questions”