5

This should be trivial but it seems that it is not. I formatted my comp and installed conda(I am used to this package tool)

pip install awscli --upgrade --user
Requirement already up-to-date: awscli in ./.local/lib/python3.7/site-packages (1.16.313)

But now I have problem

aws --version

Command 'aws' not found, but can be installed with:

sudo snap install aws-cli  # version 1.16.266, or
sudo apt  install awscli 

I tried

sudo apt  install awscli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package awscli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'awscli' has no installation candidate

I updated and upgraded my distro so I can not see any problems from that side. How to fix this?

snap install

error: This revision of snap "aws-cli" was published using classic confinement
       and thus may perform arbitrary system changes outside of the security
       sandbox that snaps are usually confined to, which may put your system at
       risk.

       If you understand and want to proceed repeat the command including
       --classic.
MikiBelavista
  • 1,473
  • 8
  • 28
  • 38

2 Answers2

10

Use following steps instead:

sudo apt-get update
sudo apt-get install awscli

aws --version
  • Are you suggesting that `apt` somehow has 'no installation candidate' while `apt-get` does? – OJFord Jan 20 '21 at 11:51
  • @OJFord I think `apt` and `apt-get` are aliases. Doing `apt update` was enough for `apt install awscli` to then work for me. (I also did an `apt upgrade` but I don't think that was required.) – Darren Cook Feb 09 '21 at 13:49
  • @DarrenCook They are not aliases exactly, but share the same mechanisms under the hood. (apt is the newer and intended to be 'friendlier' one, but 'not stable' (though so far is ;)) so apt-get should be used in scripts.) Which is why it doesn't make sense that 'use apt-get instead' as suggested in this answer would work. – OJFord Feb 10 '21 at 10:08
  • 1
    @OJFord I think the point of this answer was run `update`, and then the `install` will work; regardless of if you use `apt` or `apt-get`. (I've been using `apt` instead of `apt-get` for a few years, 'cos less typing, and have yet to spot the difference, so if it is not stable it has a funny way of showing it :-) ) – Darren Cook Feb 10 '21 at 10:52
1

This works fine

sudo snap install aws-cli --classic

aws --version
aws-cli/1.16.266 Python/3.5.2 Linux/5.0.0-37-generic botocore/1.13.2
MikiBelavista
  • 1,473
  • 8
  • 28
  • 38