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
24
votes
3 answers

How to install python3.6 on Ubuntu 22.04

I need to install this specific python version, to prepare a developer environment, because I'm maintaining a system with multiple libraries based on python 3.6.9. I recently installed Ubuntu 22.04 on my laptop, but I had no success trying to…
Danilo Santos
  • 343
  • 1
  • 2
  • 4
22
votes
3 answers

Hash sum mismatch when apt-get update Ubuntu 20.04 VM with Multipass

My issue is the following: I start a new multipass VM which is Ubuntu 20.04 version (I do not specify it, just launch). First command in my new VM is: sudo apt-get update Where I already have some error: Err:6 http://security.ubuntu.com/ubuntu…
Bettina
  • 333
  • 1
  • 2
  • 9
22
votes
4 answers

Why does Ubuntu have old versions of nodejs and npm in their apt-get package manager?

When I install nodejs and npm with apt-get sudo apt-get update sudo apt-get install nodejs modejs-legacy npm I have the versions I get the following versions npm -v 1.3.10 nodejs -v v0.10.25 I know how to update these manually, but why does the…
user1283776
  • 19,640
  • 49
  • 136
  • 276
21
votes
1 answer

How to install experimental package?

I would like to install an experimental Debian package. I'm currently having problems with the older version so I figured it's best to upgrade and try that one because I can always switch back. Anyway I want to install this package: Experimental:…
Jorrick Sleijster
  • 935
  • 1
  • 9
  • 22
20
votes
2 answers

apt-get update non interactive

I'm trying to make an update fully non interactive.(on ubuntu 14.04.3 LTS) I thought it will be easy with this type of command: export DEBIAN_FRONTEND=noninteractive apt-get update && apt-get upgrade -q -y --force-yes && apt-get dist-upgrade -q -y…
David
  • 1,177
  • 3
  • 11
  • 26
19
votes
1 answer

using different libc++ versions on travis for clang

Travis uses Ubuntu Trusty and the default libc++ version there is svn199600. However I would like to test with different (newer) versions as I already do with different clang versions. My current .travis.yml looks as follows: language:…
Tobias Hermann
  • 9,936
  • 6
  • 61
  • 134
19
votes
3 answers

boot2docker on windows missing apt-get / package manager

I'm in boot2docker. I'm not entirely sure I understand it completely, but it seems to be needed for a project I'm on. I've ssh'd in, and I tried to do a make on our project, but I got make: not found Then I tried a: apt-get install make And…
phazei
  • 5,323
  • 5
  • 42
  • 46
19
votes
2 answers

apt-get update and apt-get upgrade in Chef

If package "nginx" in Chef gets translated into apt-get install nginx on an Ubuntu node, what can be written in a Chef recipe that would translate into: apt-get -y update apt-get -y upgrade Couldn't figure out from the apt cookbook.
Marius Butuc
  • 17,781
  • 22
  • 77
  • 111
18
votes
3 answers

wget command not found on linux server

I have a linux server (completely new, web hosting, nothing is installed into it), and want to use a "wget" command. Currently, it is not found. Kernel version 2.6.32-896.16.1.lve1.4.54.el6.x86_64 I am completely new to linux, tried to solve this…
user97
  • 227
  • 1
  • 2
  • 6
18
votes
3 answers

Trying to update libpython3.6-stdlib results in overwrite error

Here are the error logs which I get try to update the dependency. I feel --overwrite flag can do the job with "dpkg" but I am not sure whether to use it or not as I see some cross dependency down there. Thank you so much for your help. sudo apt-get…
vipulbhj
  • 710
  • 5
  • 21
18
votes
3 answers

Running apt-get for another partition/directory?

I have booted my system from a live Ubuntu CD, and I need to fix some package problems. I have mounted my hard drive, and now I want to run apt-get as if I booted normally. ie change the working directory for apt-get so it will work on my hard…
Avall
  • 850
  • 1
  • 5
  • 14
17
votes
2 answers

Invalid Signature for MySQL repository

I really hope you can help me as i've tried to find a solution myself for like 3 hours or so. I basically went through every stackoverflow post there was regarding this. What i'm trying to do is i want to apt-get update on my Debian Linux 10…
RootK1d
  • 171
  • 1
  • 1
  • 7
17
votes
1 answer

Bazel Key Expired Error when sudo apt-get update Ubuntu 16.04

I am getting the following error when I do Command: sudo apt-get update Error: Err:10 http://storage.googleapis.com/bazel-apt stable InRelease The following signatures were invalid: KEYEXPIRED 1527185977 KEYEXPIRED 1527185977 KEYEXPIRED…
Manasvini Ganesh
  • 483
  • 5
  • 16
17
votes
1 answer

Downloading package with apt-get when it's already installed on system

How to download openssh package using apt-get? The problem is that the package is already installed so I get only: sudo apt-get install openssh -d Reading package lists... Done Building dependency tree... Done openssh is already the newest…
user44556
  • 5,763
  • 5
  • 30
  • 27
17
votes
10 answers

apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)

I have error in apt-get install it is a error: The following packages have unmet dependencies: gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.6)…
user3815068
  • 191
  • 1
  • 1
  • 10