"apt update" fails in jupyter/tensorflow-notebook CLI - python-3.x

I'm running a jupyter/tensorflow-notebook container and I need to install a library which needs requires an apt update followed by an apt install build-essential prior to installation.
When I run the command in the CLI for the container I get the following error:
Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out
Err:2 http://archive.ubuntu.com/ubuntu focal InRelease
Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
Err:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Unable to connect to archive.ubuntu.com:http:
Err:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Unable to connect to archive.ubuntu.com:http:
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not connect to archive.ubuntu.com:80 (91.189.88.152), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.88.142), connection timed out
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Unable to connect to archive.ubuntu.com:http:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Could not connect to security.ubuntu.com:80 (91.189.91.38), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out
W: Some index files failed to download. They have been ignored, or old ones used instead.
#
I was hoping someone may have some insight or advice to offer as I'm completely lost with this one.
I'm pulling what little hair I have out..!

Related

Building amd64 docker image in M1 machine throws errors

I'm trying to build a amd64 docker image so that I can deploy it on ECS.
I used the command docker buildx build --platform linux/amd64 -t {image}:{version}, but it throws these errors:
> [ 3/13] RUN set -ex; apt-get update; apt-get install -y --no-install-recommends software-properties-common; add-apt-repository ppa:deadsnakes/ppa:
#0 0.225 + apt-get update
#0 42.18 Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
#0 42.18 Connection failed [IP: 91.189.91.38 80]
#0 51.75 Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
#0 51.75 Connection failed [IP: 185.125.190.36 80]
#0 83.22 Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
#0 83.22 Connection failed [IP: 185.125.190.39 80]
#0 124.2 Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
#0 124.2 Connection failed [IP: 91.189.91.38 80]
#0 124.3 Reading package lists...
#0 124.4 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Connection failed [IP: 91.189.91.38 80]
#0 124.4 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Connection failed [IP: 185.125.190.39 80]
#0 124.4 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Connection failed [IP: 91.189.91.38 80]
#0 124.4 W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Connection failed [IP: 185.125.190.36 80]
#0 124.4 W: Some index files failed to download. They have been ignored, or old ones used instead.
#0 124.4 + apt-get install -y --no-install-recommends software-properties-common
#0 124.5 Reading package lists...
#0 124.6 Building dependency tree...
#0 124.6 Reading state information...
#0 124.6 Package software-properties-common is not available, but is referred to by another package.
#0 124.6 This may mean that the package is missing, has been obsoleted, or
#0 124.6 is only available from another source
#0 124.6
#0 124.6 E: Package 'software-properties-common' has no installation candidate
------
error: failed to solve: executor failed running [/bin/sh -c set -ex; apt-get update; apt-get install -y --no-install-recommends software-properties-common; add-apt-repository ppa:deadsnakes/ppa]: exit code: 100
If I switch platform to linux/arm64, building an image works correctly, but I get this error from AWS:
standard_init_linux.go:228: exec user process caused: exec format error
(I have #!/bin/bash inside of my script file and it has been worked fine before I used M1 mac.)
I'd appreciate your help. Thank you.

Updating from such a repository can't be done securely and repository is not signed errors

I run sudo apt-get update then I get this error
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 https://deb.nodesource.com/node_16.x focal InRelease
Err:3 http://ph.archive.ubuntu.com/ubuntu focal InRelease
403 Forbidden [IP: 202.79.184.254 80]
Err:4 http://ph.archive.ubuntu.com/ubuntu focal-updates InRelease
403 Forbidden [IP: 202.79.184.254 80]
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Err:6 http://ph.archive.ubuntu.com/ubuntu focal-backports InRelease
403 Forbidden [IP: 202.79.184.254 80]
Hit:7 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal InRelease
Hit:8 http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu focal InRelease
Hit:9 http://ppa.launchpad.net/sylvain-pineau/kazam/ubuntu focal InRelease
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal InRelease' is not signed.
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ph.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease 403 Forbidden [IP: 202.79.184.254 80]
E: The repository 'http://ph.archive.ubuntu.com/ubuntu focal-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
I tried searching everywhere and checked related topics but none seems working.
How do I resolve this?
I have passed through the same problem. The solution was to change my internet connection. The problem seem to have been the firewalls in my corporation network that gave me the same exact messages, including the IP address that you've pasted.
I changed my network connection to a different one and that worked for me. I think firewall of the first network disabled updates to save bandwidths or something like that.
Had the same error but with a different repository.
Try this out if it works for you.
ls /etc/apt/sources.list.d
listing the repositories.
rm -i /etc/apt/sources.list.d/output of 1
Then of course run.
apt upgrade
More details in the screenshots in these links.

Cannot build Docker images any more

I am having an issue with my Ubuntu 20 PC. So far I have used Docker frequently, however lately I cannot build any docker image any more.
The problem is when a Dockerfile has the usual RUN commands
RUN apt-get update && apt-get remove -y x264 libx264-dev
RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo clang-format wget apt-utils
Well, RUN apt-get update fails every time with
Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 InRelease
Could not resolve host: developer.download.nvidia.com
Err:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Temporary failure resolving 'archive.ubuntu.com'
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/InRelease Could not resolve host: developer.download.nvidia.com
W: Some index files failed to download. They have been ignored, or old ones used instead.
What could be happening here?
I remember once I had a similar problem and a reboot fixed it but not this time.

Stuck at Connecting to us-west-2.ec2.archive.ubuntu.com in amazon ec2

I am using amazon aws ec2 instance. I created an instance. I got a key-pair, and using that I logged in via ubuntu. Now, I am trying to run sudo apt-get update on the remote server. What I am getting is:
ubuntu#ip-172-31-30-46:~$ sudo apt-get update
Err http://us-west-2.ec2.archive.ubuntu.com trusty InRelease
Err http://us-west-2.ec2.archive.ubuntu.com trusty-updates InRelease
Err http://us-west-2.ec2.archive.ubuntu.com trusty-backports InRelease
Err http://us-west-2.ec2.archive.ubuntu.com trusty Release.gpg
Unable to connect to us-west-2.ec2.archive.ubuntu.com:http: [IP: 54.184.254.88 80]
Err http://us-west-2.ec2.archive.ubuntu.com trusty-updates Release.gpg
Unable to connect to us-west-2.ec2.archive.ubuntu.com:http: [IP: 54.184.254.88 80]
Err http://us-west-2.ec2.archive.ubuntu.com trusty-backports Release.gpg
Unable to connect to us-west-2.ec2.archive.ubuntu.com:http: [IP: 54.184.254.88 80]
0% [Connecting to security.ubuntu.com (91.189.91.15)]
I think that internet is not working on my server. After googling I got the following solution:
Ec2 instance on AWS apt- get not working, but it is already configured in my instance. Please help me to solve this.
I will advise you to check your firewall settings. There is a probability you've set deny all outgoing connections.
sudo ufw default allow outgoing
This will allow connection to outside server

Installing software in kubuntu [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have recently installed kubuntu. I am able to install softwares from muon software center. But when I try to do so from the terminal, I get errors. For instance on trying to update, I get:
Err http://archive.canonical.com quantal InRelease
Err http://archive.canonical.com quantal Release.gpg
Unable to connect to archive.canonical.com:http:
Err http://archive.ubuntu.com quantal InRelease
Err http://archive.ubuntu.com quantal Release.gpg
Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/InRelease
W: Failed to fetch http://archive.canonical.com/dists/quantal/InRelease
W: Failed to fetch http://archive.canonical.com/dists/quantal/Release.gpg Unable to connect to archive.canonical.com:http:
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/quantal/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.201 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
Similarly when I try to install git-core, I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
git git-man liberror-perl
Suggested packages:
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
git-email git-gui gitk gitweb
The following NEW packages will be installed:
git git-core git-man liberror-perl
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,704 kB of archives.
After this operation, 15.4 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://archive.ubuntu.com/ubuntu/ quantal/main liberror-perl all 0.17-1
Could not connect to archive.ubuntu.com:80 (91.189.92.202). - connect (111: Connection refused) [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com/ubuntu/ quantal/main git-man all 1:1.7.10.4-1ubuntu1
Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com/ubuntu/ quantal/main git i386 1:1.7.10.4-1ubuntu1
Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
Err http://archive.ubuntu.com/ubuntu/ quantal/main git-core all 1:1.7.10.4-1ubuntu1
Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberror-perl_0.17-1_all.deb Could not connect to archive.ubuntu.com:80 (91.189.92.202). - connect (111: Connection refused) [IP: 91.189.92.202 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.7.10.4-1ubuntu1_all.deb Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.10.4-1ubuntu1_i386.deb Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-core_1.7.10.4-1ubuntu1_all.deb Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.202 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
How do I handle this. I am using internet behind a proxy server, if that matters.
You should add your proxy config to /etc/apt/apt.conf
Acquire::http::Proxy "http://proxy-ip-or-hostname:port";
eg:
Acquire::http::Proxy "http://192.168.0.1:3128";
or with authentication
Acquire::http::Proxy "http://user:pass#192.168.0.1:3128";

Resources