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.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState