Using APT on the Command Line

FAIL (the browser should render some flash content, not this).

How to use apt-get from the command line.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi Shawn, Can you share .ogg

martin3z's picture

Hi Shawn,

Can you share .ogg / .ogv file of this video, please?


About apt-get or aptitude

Juan Valencia's picture

In some cases, first you have to export your proxy with the next command
export http_proxy=pr.o.x.y:port
and now you can upgrade, update or install your packages.

About APT o Aptitude, when you're trying to install some packages and APT can`t find, Aptitude recommend you a similar package you're trying to install.


Anonymous's picture

How about a yum tutorial for those of us in an rhn world?

It's on my list.

Shawn Powers's picture

It's on my list, along with YAST (which I've actually never used either!) Stay tuned!

Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

Use aptitude instead

Chris Lambacher's picture

apt-get, apt-cache and friends are the old tools. You should be using aptitude instead.
aptitude update
aptitude upgrade
aptitude search x
aptitude install x

With aptitude you only need to remember one command and it does a better job of tracking dependencies for later uninstall:
aptitude remove x


Just My Preference

Shawn Powers's picture

aptitude (while often touted as the preferred method) is a great tool, no doubt. And while aptitude can be configured to automatically install suggested and recommended packages, I don't think it does a better job of tracking orphaned dependencies anymore. (I could be wrong, but I think the autoremove option will get rid of orphans now)

I prefer apt-get, largely out of familiarity. I don't think one is better than the other, and APT is such a great package management system, it's hard to go wrong no matter which front end you use!

Shawn Powers is an Associate Editor for Linux Journal. You might find him chatting on the IRC channel, or Twitter

apt-get is more widely available

Dai's picture

aptitude may be nice, but if you are using APT-RPM on a Red Hat box or Fink on MacOS X, aptitude is not available.

apt-get is available on systems using either APT-RPM or Fink and works beautifully.

Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

Upcoming Webinar
8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
11am CDT, April 29th
Moderated by Linux Journal Contributor Mike Diehl

Sign up now

Sponsored by Skybot