Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INSTALL.sh ignored errors #1

Closed
melfnt opened this issue Jul 25, 2019 · 3 comments
Closed

INSTALL.sh ignored errors #1

melfnt opened this issue Jul 25, 2019 · 3 comments

Comments

@melfnt
Copy link

melfnt commented Jul 25, 2019

STEP TO REPRODUCE

  • run bash INSTALL.sh

CURRENT BEHAVIOR

If (for any reason) apt-get fails, the error is not reported and the script is not stopped:

Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version (2.7.15~rc1-1).
python set to manually installed.
The following additional packages will be installed:
  libexpat1-dev libpython-all-dev libpython-dev libpython2.7 libpython2.7-dev python-all python-all-dev
  python-asn1crypto python-cffi-backend python-crypto python-cryptography python-dbus python-dev python-enum34
  python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-pip-whl python-secretstorage
  python-setuptools python-six python-wheel python-xdg python2.7-dev
Suggested packages:
  python-crypto-doc python-cryptography-doc python-cryptography-vectors python-dbus-dbg python-dbus-doc
  python-enum34-doc python-gi-cairo gnome-keyring libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-fs python-gdata
  python-keyczar python-secretstorage-doc python-setuptools-doc
The following NEW packages will be installed:
  libexpat1-dev libpython-all-dev libpython-dev libpython2.7 libpython2.7-dev python-all python-all-dev
  python-asn1crypto python-cffi-backend python-crypto python-cryptography python-dbus python-dev python-enum34
  python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-pip python-pip-whl
  python-secretstorage python-setuptools python-six python-wheel python-xdg python2.7-dev
0 upgraded, 27 newly installed, 0 to remove and 217 not upgraded.
Need to get 33.0 MB of archives.
After this operation, 56.6 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libexpat1-dev amd64 2.2.5-3 [122 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libpython2.7 amd64 2.7.15~rc1-1ubuntu0.1 [1053 kB]

... omissis ...

Get:26 http://archive.ubuntu.com/ubuntu bionic/universe amd64 python-wheel all 0.30.0-0.2 [36.4 kB]
Get:27 http://archive.ubuntu.com/ubuntu bionic/universe amd64 python-xdg all 0.25-4ubuntu1 [31.3 kB]
Fetched 31.2 MB in 14s (2209 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_9.0.1-2.3~ubuntu1_all.deb  404  Not Found [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip_9.0.1-2.3~ubuntu1_all.deb  404  Not Found [IP: 91.189.88.149 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Python installed

The last line is not true: Python is not installed.
Subsequent errors do not stop the script as well:

INSTALL.sh: line 25: pip: command not found
Androguard installed
INSTALL.sh: line 27: pip: command not found
TLS Lite installed

EXPECTED BEHAVIOR

I think that every error should be reported and stop the script.

ENVIRONMENT

I'm using Bash on windows but I don't think it is relevant.

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
$ uname -r
4.4.0-18362-Microsoft
@NetBender
Copy link
Member

Thank you for the report.
In order to properly handle this kind of issues, can you run the following commands and tell me if they show you any alert?

sudo apt-get update --fix-missing
sudo apt-get install -y python python-pip

@melfnt
Copy link
Author

melfnt commented Jul 25, 2019

I will, but the problem is not just with my package manager: I think you should handle any kind of error by stopping the script.

You can achieve this behavior by adding set -e as the very first command of the script.

@melfnt
Copy link
Author

melfnt commented Jul 26, 2019

Thank you for the report.
In order to properly handle this kind of issues, can you run the following commands and tell me if they show you any alert?

sudo apt-get update --fix-missing
sudo apt-get install -y python python-pip

No warnings nor errors at all while running these commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants