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.

Comments

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?

Thanks.

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.

yum

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

See http://pthree.org/2007/08/12/aptitude-vs-apt-get/

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.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix