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

Unresolved dependencies

I am trying to install apt-get -f install ntp git build-essential libssl-dev libdb-dev libdb++-dev libboost-all-dev libqrencode-dev on Ubuntu and get dependency errors, when I try to install with all dependencies like sudo apt-get -f install g++…
0
votes
1 answer

Bash Syntax error near new line on iOS

So I have a script (the code is below) and I am getting the following error. Error: Syntax error near unexpected token newline (line 5) The code around this error is Sbalert -t "Updating" -m "Downloading and installing the update. Please don't…
iTechy
  • 283
  • 1
  • 3
  • 18
0
votes
3 answers

How do I enter 'y' automatically to apt-get?

I'm trying to automate a server setup using a shell script. I need to install a few dependencies with apt-get and some require the user to input y before the install continues. My question is how do I make sure the shell script automatically inserts…
narzero
  • 2,199
  • 5
  • 40
  • 73
0
votes
1 answer

how can I get a complete pkg list for an installed app (debian)?

After installing an application in one linux distro, I'd like to be able to install the same in another but in synaptic it isn't always clear which top level pkg to select to get the entire application. ubuntu though has a software center that puts…
0
votes
2 answers

how can a feed a file list into dpkg --get?

I can use dpkg --get-selections | grep -v deinstall | cut -f 1 | tr '\n' ' ' > listpackages.txt to fill a file with all my installed packages. Is there a to install using dpkg or apt and reference the listpackages.txt file created above? I want…
0
votes
1 answer

Cannot Install into Virtual Environment

I have a virtual environment I have created on an Ubuntu virtal machine I am hosting on a windows PC. I intend to replicate my virtual machine in my virtal environment on the virtual machine. However, when trying to install modules to the VE I get a…
Mark Corrigan
  • 544
  • 2
  • 11
  • 29
0
votes
2 answers

What traces of an application can apt-get purge still leave behind?

I noticed that apt-get purge doesn't always clean every trace of an installation. As a concrete example, I'm trying to remove mailman (installed by apt-get install mailman). Now, I tried to remove every(!) trace of this installation by apt-get purge…
Peter
  • 401
  • 1
  • 5
  • 17
0
votes
1 answer

Installing WKHTMLTOPDF on Ubuntu 12.10 32-bit

I have a digital ocean VPS and I'm trying to install WKHTMLTOPDF using apt-get, but apparently my Ubuntu version (12.10) is out of date. I've tried the following: apt-get, apt-get upgrade, apt-get update None of those work anymore. From what I'm…
Greg Blass
  • 3,523
  • 29
  • 42
0
votes
1 answer

Apt-get update is failing and I can't figure out the source of it

For some reason when I try to do a sudo apt-get update it checks all the source lists and ends with this W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/Release Unable to find expected entry 'contrib/source/Sources' in Release…
JoshEmory
  • 644
  • 6
  • 20
0
votes
0 answers

Is it possible to only install the package without dependecies?

I am trying to install texlive package, because that is the only package required to complete my compilation, but when I am installing using apt-get I am getting all the packages which are dependent on it, and making the size of my download to 282MB…
OmPS
  • 331
  • 3
  • 12
0
votes
1 answer

linux - Checking for installed packages and if found remove

I'm working with python and I need to check for installed packages and if installed remove them. I already did the opposite: dpkg -l | grep -qw package || apt-get install package Help! :/ PS: I use Debian destribution on raspberry pi. Thanks, Luís…
user3837675
  • 90
  • 1
  • 4
0
votes
1 answer

how to use chef-solo to install a particular version of nginx

I have the following and it doesn't work: package 'nginx' do action :install version "1.1.19" end Please help.
Andy
  • 115
  • 6
0
votes
1 answer

Install Java 5 in Ubuntu 12.04

I need to install Java 5 in my Ubuntu 12.04. Can't do it by apt-get anymore. Downloaded the .bin from http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html and installed it. Still, the option…
0
votes
2 answers

"apt-get install" does not ask for confirmation as "yum install"

When using yum install firefox it will ask me for confirmation if I would really like to do it, but apt-get install firefox it will not ask me. Is there a way that it will ask me? Thank you
andrej
  • 547
  • 1
  • 6
  • 21
0
votes
1 answer

How do I resolve not fully installed package (python3-setuptools)?

I was trying to install python3-setuptools, and when i run $ sudo apt-get install python3-setuptools I get this error: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed,…
user3737693
  • 1
  • 1
  • 1