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
44
votes
4 answers

installing `lightdm` in Dockerfile raises interactive keyboard layout menu

I have the following Dockerfile: # Pull from CentOS RPM Build Image FROM ubuntu # Update the image RUN apt-get update -y RUN apt-get install lightdm -y The problem I have is when I'm building this container with docker build -t dumbcontainer ., at…
lurscher
  • 25,930
  • 29
  • 122
  • 185
41
votes
7 answers

What is the difference between installing a package using pip vs. apt-get?

I'm trying to deploy a Django site on an Ubuntu machine. I need to install Psycopg2 and PIL but it seems that I'm able to install them using either apt-get or using pip. Is there a difference in installing by the two methods? I know that using pip,…
Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
40
votes
5 answers

How to install Google chrome in a docker container

I'm trying to install chrome in a docker container. I execute: RUN apt-get install -y wget RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN dpkg -i google-chrome-stable_current_amd64.deb # problem here RUN…
Pythonist
  • 1,937
  • 1
  • 14
  • 25
36
votes
5 answers

How I can make apt-get install to my virtualenv?

It it's possible, of course. For example - I can download python-dbus like this: $ sudo apt-get download python-dbus But what I should to do next, with this .deb package in my current virtualenv?
34
votes
4 answers

Requirements file for apt-get, similar to pip

I like how you can manage dependencies with pip requirements. Is there something similar in case of apt-get? http://www.pip-installer.org/en/latest/requirements.html#requirements-file-format
Vladimir Keleshev
  • 13,753
  • 17
  • 64
  • 93
30
votes
3 answers

Unable to locate package language-pack-en

On my NodeJS server (running as docker image)... Dockerfile FROM node:4.8-slim RUN apt-get update -y && \ apt-get install -yqq locales git ...there is no english locale installed: RUN locale -a gives me C C.UTF-8 POSIX In my dockerfile I try…
user3142695
  • 15,844
  • 47
  • 176
  • 332
30
votes
8 answers

Installing MariaDB - Unmet dependencies, mariadb-server-5.5

I'm attempting to install MariaDB on Ubuntu 12.04 LTS. I've followed the instructions provided at https://askubuntu.com/questions/64772/how-to-install-mariadb and from MariaDB.org that appear when you choose the download. The last step is sudo…
Courtney Miles
  • 3,756
  • 3
  • 29
  • 47
29
votes
4 answers

apt-get update fails on Ubuntu 22 base docker image

I am trying to upgrade one of our docker base images to the latest stable version of Ubuntu. I have isolated the problem to a simple reproducible case. I have a Dockerfile like this: FROM ubuntu:22.04 MAINTAINER mep-dev@zulily.com # Install java…
morningstar
  • 8,952
  • 6
  • 31
  • 42
29
votes
2 answers

Why do I get old versions of nodejs and npm when installing with apt-get?

I have executed the following command in Ubuntu 14.04 64-bit. sudo apt-get update sudo apt-get install nodejs modejs-legacy npm I have the versions npm -v 1.3.10 nodejs -v v0.10.25 These are older than the recommended versions for AngularJS…
user1283776
  • 19,640
  • 49
  • 136
  • 276
28
votes
4 answers

install apt-get on linux Red Hat server

I'm setting up a Linux Red Hat web server. apt-get isn't installed, but yum is. However, yum cannot find the apt package. When I run apt-get, I get a message from the shell saying that the command apt-get couldn't be found. When I try yum install…
Philip Mais
  • 299
  • 1
  • 3
  • 4
28
votes
9 answers

How to correctly install wkhtmltopdf on debian 64 bit?

I am trying to install wkhtmltopdf, but when I do: sudo dpkg -i wkhtmltox-0.12.1_linux-trusty-amd64.deb I get : Preparing to unpack wkhtmltox-0.12.1_linux-trusty-amd64.deb ... Unpacking wkhtmltox (0.12.1) over (0.12.1) ... dpkg: dependency problems…
T.Nel
  • 1,540
  • 2
  • 18
  • 34
27
votes
8 answers

Docker build has no network, but docker run has

If I want to build my Dockerfile, it can't connect to the network or at least DNS: Sending build context to Docker daemon 15.95 MB Sending build context to Docker daemon Step 0 : FROM ruby ---> eeb85dfaa855 Step 1 : RUN apt-get update -qq &&…
sweiler
  • 397
  • 1
  • 3
  • 7
26
votes
2 answers

Zsh Package Suggestion

I've just migrated to Zsh from Bash, but I have a bit of a problem in it. In bash on an Ubuntu system, when I type the name of a command which does not exist, Bash searches the apt database for a matching command name and prints out the package…
Bhaskar Kandiyal
  • 978
  • 1
  • 10
  • 20
25
votes
2 answers

Ubuntu equivalent of Yum's WhatProvides, to find which package provides a file

Fedora's yum package management tool has a nice option called whatprovides, which lets you find what package has installed a specific binary or file. What is the equivalent command on Ubuntu? For example, say I'd like to find what package provided…
Cerin
  • 60,957
  • 96
  • 316
  • 522
25
votes
2 answers

'make' command not found in docker container

I have a docker image which is running docker host with ubuntu 14.04. In one of the containers, I am trying to run zookeeper and install librdkafka libraries(pre-requisite library) for kafka to connect to 3rd party software. I need the 'make'…
Omkar
  • 2,274
  • 6
  • 21
  • 34
1 2
3
70 71