Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I install multiple Debian packages at a time using apt-get install?

i'm face a problem when trying to install multiple packages

So for example when i try this :

apt-get install php5-gd php5-idn php-pear php5-imagick php5-imap php5-json etc..  

i get :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-gd php5-idn php-pear php5-imagick php5-imap php5-json

But i have no trouble installing the packages on at a time.

Am i doing it wrong ?

like image 888
FlashSP Avatar asked Dec 11 '25 06:12

FlashSP


2 Answers

You don't run apt-get with admin rights. In order to do that make sure you use sudo before you execute apt-get.

Here is the full command:

sudo apt-get install php5-gd php5-idn php-pear php5-imagick php5-imap php5-json
like image 118
Julian Avatar answered Dec 13 '25 23:12

Julian


Your error message tells the story: When calling

apt-get install does not exist but bash does

The result should be:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package does
E: Unable to locate package not
E: Unable to locate package exist
E: Unable to locate package but
E: Unable to locate package does

You get only one line, which means that either your shell itself or any alias or function defined in the shell for apt-get does not send the individual package names to the real executable as individual arguments, but as one long argument containing spaces. I think this is what tripleee was pointing out.

To find out what happens:

  1. If you did not type this directly into a "normal" shell but into a wrapper (a web-frontend to the shell counts as such): stop doing that or look up the documentation of the wrapper
  2. If you really typed this in correctly, check if an alias or a function is defined:
    • enter: type apt-get
    • should return: apt-get is /usr/bin/apt-get
    • if it returns apt-get is a function or apt-get is aliased to ..., you have your answer
like image 31
Olaf Mandel Avatar answered Dec 14 '25 00:12

Olaf Mandel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!