Questions tagged [apt-get]

GENERAL APT-GET SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. apt-get is a command-line tool used to work with Advanced Packaging Tool (APT) of Debian-based Linux distros and for performing actions such as installing or upgrading a package.

The apt-get command is a powerful command-line tool used to work with Debian's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Debian system.

Being a simple command-line tool, apt-get has numerous advantages over other package management tools available in Debian for server administrators. Some of these advantages include ease of use over simple terminal connections (SSH) and the ability to be used in system administration scripts, which can in turn be automated by the cron scheduling utility.

Examples

  • Install a Package: Installation of packages using the apt-get tool is quite simple. For example, to install the network scanner nmap, type the following:

    sudo apt-get install nmap
    
  • Remove a Package: Removal of a package or packages is also a straightforward and simple process. To remove the nmap package installed in the previous example, type the following:

    sudo apt-get remove nmap
    

[Tip] Multiple Packages: You may specify multiple packages to be installed or removed, separated by spaces. Also, adding the --purge options to apt-get remove will remove the package configuration files as well. This may or may not be the desired effect so use with caution.

  • Update the Package Index: The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file. To update the local package index with the latest changes made in repositories, type the following:

    sudo apt-get update
    
  • Upgrade Packages: Over time, updated versions of packages currently installed on your computer may become available from the package repositories (for example security updates). To upgrade your system, first update your package index as outlined above, and then type:

    sudo apt-get upgrade
    

Further Reading

For further information about the use of APT, read the comprehensive Debian APT User Manual or type in command-line:

apt-get help  
1055 questions
0
votes
1 answer

Including Puppetlabs repo when provisioning Ubuntu client with Foreman

Due to my manifests requiring the latest version of factor, all provisioned machines has to undergo a manual in-between step after OS installation of adding the puppetlabs repo and upgrading facter. Even specifying that all subclasses require the…
Werner
  • 791
  • 1
  • 6
  • 23
0
votes
1 answer

How can I install vnstat on Amazon EC2 with Standard image?

How can I install vnstat on Amazon EC2 with Standard image? [ec2-user@ip-XXXXXXXXXX ~]$ sudo yum install vnstat Loaded plugins: priorities, update-motd, upgrade-helper No package vnstat available. Error: Nothing to do
Gregor
  • 3
  • 1
0
votes
2 answers

Reading package lists... Error! on EC2

I am running Ubuntu 14.04.1 LTS on a t1.micro on ec2. Just a moment ago I logged in, ran sudo apt-get update and got Reading package lists... Error! I also realized that I no longer can install packages using sudo apt-get install. Any idea what went…
dade
  • 3,340
  • 4
  • 32
  • 53
0
votes
1 answer

how apt-get compares between two different version schemes

how dose apt-get compares between two different version schemes of the same package? for example: 1.3.8 ? 1.09 More detailed example: Lets say i got package_a in my repository with version 1.08 (package-a_1.08.deb). Then i upload a new version of…
Urban48
  • 1,398
  • 1
  • 13
  • 26
0
votes
1 answer

Ubuntu 11.04 apt-get install libncurses5-dev no candidate

I am linux total newbie. I would like to install new packages but I am not able to do this with some: I try sudo apt-get install libncurses5-dev E: Package 'libncurses5-dev' has no installation candidate or sudo apt-get install kernel-package…
bataliero1234
  • 145
  • 10
0
votes
1 answer

How do I get a list of all installed packages in debian or ubuntu

I recently destroyed the system partition on my Ubuntu 14.04 machine. I hadn't bothered to back it up since I knew I could easily restore it from a DVD. The problem is that every once in a while I come across a package that I need that I don't…
Jeff Silverman
  • 692
  • 1
  • 8
  • 15
0
votes
2 answers

The following packages have unmet dependencies

I'm trying to install GMP on Ubuntu 14.04: $ sudo apt-get install php5-gmp Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an…
Martyn
  • 6,031
  • 12
  • 55
  • 121
0
votes
1 answer

Using RPMs for installation on embedded system images

I'm trying to use RPMs to install public and private software into disk images that are eventually written to the boot flash of Linux based embedded systems. My current methodology is to mount the image (/mnt/foo) read/write on a CentOS 6.5 box and…
Tim Kolar
  • 175
  • 1
  • 9
0
votes
3 answers

apt-get fails to continue running in a loop after one failed install in bash

I am trying to create a bash script that will automatically install stuff using apt-get. I am using the following methods for the installation: Method 1 Install(){ for TempVar in "$1" do eval 'sudo apt-get install '$TempVar done } Method…
0
votes
1 answer

How do I install version 2.4.3 of python-requests on Ubuntu 14.04 Trusty?

I need to use version 2.4.3 of python-requests to download Coursera videos via course-dl. However, I cannot upgrade to that version using apt-get in Ubuntu 14.04.01: $ sudo apt-get upgrade python-requests ... python-requests is already the newest…
wsw
  • 183
  • 3
  • 10
0
votes
1 answer

Install OpenCV for python building the source or with apt-get?

I'm working with OpenCV using Python on Linux. I always installed OpenCV building the the Source with make. As you know there are many guides online which all say pretty much the same things. Now i found some guys which say to install OpenCV using…
user2635652
  • 73
  • 1
  • 1
  • 8
0
votes
1 answer

Install directly in the pendrive

I am using Ubuntu 12.04 and i would like to know if it's possible to install a app. directly in the pendrive?? Like for example if we want to install vlc we type in the terinal sudo apt-get install vlc but what should be written if we want that to…
Leo Louis
  • 1
  • 3
0
votes
2 answers

Sublime installation on ubuntu (add-apt-repository error)

I am trying to install sublime onto my ubuntu server via the following method. sudo add-apt-repository ppa:webupd8team/sublime-text-3 sudo apt-get update sudo apt-get install sublime-text-installer But when I put the first command it gives me this…
Osprey Homes
  • 1
  • 1
  • 4
0
votes
0 answers

Puppetising Sensu on Ubuntu 12.04

When running my puppet scripts to install Sensu I get this error: Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install sensu' returned 100: Reading package lists... Building dependency…
Sam Lloyd
  • 21
  • 8
0
votes
1 answer

Trying to upgrade to PHP 5.4

I've been trying to upgrade my Ubuntu server's PHP version to 5.4 for quite a while now. First I'm trying to run: sudo add-apt-repository ppa:ondrej/php5-oldstable But I get this: sudo: add-apt-repository: command not found So I run this: sudo…
user1878980
  • 515
  • 2
  • 8
  • 21