ERROR during dockerfile build apt-get update [duplicate] - macos

This question already has answers here:
The command '/bin/sh -c apt-get install dnsutils' returned a non-zero code: 1
(2 answers)
Closed 1 year ago.
I was trying to install oracle using dockerfile in Mac
but I got in trouble please help!!
I had command in MAC docker build --no-cache -t orange:002 /Users/1234
this is my docker file
FROM jaspeen/oracle-xe-11g
RUN apt-get update && apt-get upgrade
RUN apt-get install vim -common
ENV LC_ALL-C.UTF-8
and my error code is
[+] Building 84.2s (5/6)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/jaspeen/oracle-xe-11g:latest 3.1s
=> [1/3] FROM docker.io/jaspeen/oracle-xe-11g#sha256:0a4b0456cd5be4982ab28ca9426672acee6d90734873d15124698c5c0 43.9s
=> => resolve docker.io/jaspeen/oracle-xe-11g#sha256:0a4b0456cd5be4982ab28ca9426672acee6d90734873d15124698c5c07 0.0s
=> => extracting sha256:05b9ddeb40d9a21312cbfb42f8ab49d642744556ef66139c11a181d278b4c733
0.0s
=> => sha256:863735b9fd15b7617298df56e767c6057c4439df896d1d4b0e5e09fa50377496 65.67MB / 65.67MB 0.0s
=> => sha256:05b9ddeb40d9a21312cbfb42f8ab49d642744556ef66139c11a181d278b4c733 413B / 413B 0.0s
=> => sha256:740047056d21b8e72188f462f10d69f0ae931609c7397bd9f488cc2593d5d997 1.13kB / 1.13kB 0.0s
=> => sha256:fbfc89a21b1b1aba3bcf0d397994f89bdf601c3ad887e3c5f1f4d2d11862ae1d 322.70MB / 322.70MB 0.0s
=> => sha256:4fbaa2f403dffcc9050448f94c0e0b32d1a12b74379738a53a69e686cce4da7e 71.48kB / 71.48kB 0.0s
=> => sha256:44be94a95984bb47dc3a193f59bf8c04d5e877160b745b119278f38753a6f58f 681B / 681B 0.0s
=> => sha256:b44894d2d2af206ab91533afeeae4fc989796c42738d250bba039fc04a2bd5cc 537B / 537B 0.0s
=> => sha256:1492d1fc5b9fe0774e4e9930af562342cd00fb0b9059d1f9088fa14b5cadb118 684B / 684B 0.0s
=> => sha256:c0f3c6ec8986d3703be62cf8f0faf0cb9d20c12de9330c3585edadf9b3d0d956 687B / 687B 0.0s
=> => extracting sha256:b44894d2d2af206ab91533afeeae4fc989796c42738d250bba039fc04a2bd5cc 0.0s
=> => extracting sha256:1492d1fc5b9fe0774e4e9930af562342cd00fb0b9059d1f9088fa14b5cadb118 0.0s
=> => extracting sha256:c0f3c6ec8986d3703be62cf8f0faf0cb9d20c12de9330c3585edadf9b3d0d956 0.0s
=> => extracting sha256:fbfc89a21b1b1aba3bcf0d397994f89bdf601c3ad887e3c5f1f4d2d11862ae1d 13.1s
=> => extracting sha256:740047056d21b8e72188f462f10d69f0ae931609c7397bd9f488cc2593d5d997 0.0s
=> ERROR [2/3] RUN apt-get update && apt-get upgrade 36.8s
------
> [2/3] RUN apt-get update && apt-get upgrade:
#5 3.533 Ign http://archive.ubuntu.com trusty InRelease
#5 3.842 Get:1 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
#5 5.694 Get:2 http://archive.ubuntu.com trusty-security InRelease [65.9 kB]
#5 6.389 Get:3 http://archive.ubuntu.com trusty Release.gpg [933 B]
#5 6.645 Get:4 http://archive.ubuntu.com trusty-updates/main Sources [532 kB]
#5 8.773 Get:5 http://archive.ubuntu.com trusty-updates/restricted Sources [6444 B]
#5 8.773 Get:6 http://archive.ubuntu.com trusty-updates/universe Sources [288 kB]
#5 8.865 Get:7 http://archive.ubuntu.com trusty-updates/main amd64 Packages [1460 kB]
#5 9.785 Get:8 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [21.4 kB]
#5 10.09 Get:9 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [671 kB]
#5 14.19 Get:10 http://archive.ubuntu.com trusty Release [58.5 kB]
#5 14.50 Get:11 http://archive.ubuntu.com trusty-security/main Sources [220 kB]
#5 15.11 Get:12 http://archive.ubuntu.com trusty-security/restricted Sources [5050 B]
#5 15.52 Get:13 http://archive.ubuntu.com trusty-security/universe Sources [127 kB]
#5 17.06 Get:14 http://archive.ubuntu.com trusty-security/main amd64 Packages [1032 kB]
#5 18.60 Get:15 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [18.1 kB]
#5 18.91 Get:16 http://archive.ubuntu.com trusty-security/universe amd64 Packages [378 kB]
#5 19.46 Get:17 http://archive.ubuntu.com trusty/main Sources [1335 kB]
#5 20.98 Get:18 http://archive.ubuntu.com trusty/restricted Sources [5335 B]
#5 21.36 Get:19 http://archive.ubuntu.com trusty/universe Sources [7926 kB]
#5 24.75 Get:20 http://archive.ubuntu.com trusty/main amd64 Packages [1743 kB]
#5 25.44 Get:21 http://archive.ubuntu.com trusty/restricted amd64 Packages [16.0 kB]
#5 25.75 Get:22 http://archive.ubuntu.com trusty/universe amd64 Packages [7589 kB]
#5 28.45 Fetched 23.6 MB in 25s (921 kB/s)
#5 28.45 Reading package lists...
#5 31.81 Reading package lists...
#5 34.52 Building dependency tree...
#5 34.70 Reading state information...
#5 35.09 The following packages have been kept back:
#5 35.09 ubuntu-minimal
#5 35.09 The following packages will be upgraded:
#5 35.09 apt apt-utils base-files bash bsdutils busybox-initramfs ca-certificates
#5 35.09 coreutils cpio curl dpkg eject file gcc-4.8-base gcc-4.9-base gnupg gpgv
#5 35.09 ifupdown init-system-helpers initramfs-tools initramfs-tools-bin initscripts
#5 35.09 iproute2 isc-dhcp-client isc-dhcp-common klibc-utils kmod krb5-locales
#5 35.09 libapt-inst1.5 libapt-pkg4.12 libasn1-8-heimdal libblkid1 libc-bin libc6
#5 35.09 libcurl3 libdb5.3 libdbus-1-3 libdrm2 libexpat1 libffi6 libgcc1 libgcrypt11
#5 35.09 libgnutls-openssl27 libgnutls26 libgssapi-krb5-2 libgssapi3-heimdal
#5 35.09 libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal
#5 35.09 libhx509-5-heimdal libidn11 libk5crypto3 libklibc libkmod2
#5 35.09 libkrb5-26-heimdal libkrb5-3 libkrb5support0 libldap-2.4-2 libmagic1
#5 35.09 libmount1 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3
#5 35.09 libplymouth2 libpng12-0 libprocps3 libpython3.4-minimal libpython3.4-stdlib
#5 35.09 libroken18-heimdal librtmp0 libsqlite3-0 libssl1.0.0 libstdc++6 libtasn1-6
#5 35.09 libudev1 libuuid1 libwind0-heimdal login logrotate lsb-base lsb-release
#5 35.09 makedev module-init-tools mount mountall multiarch-support ntpdate openssl
#5 35.09 passwd perl perl-base perl-modules plymouth procps python3.4
#5 35.09 python3.4-minimal resolvconf rsyslog sensible-utils sudo sysv-rc
#5 35.09 sysvinit-utils tar tzdata udev util-linux vim-common vim-tiny zlib1g
#5 36.77 111 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
#5 36.77 Need to get 36.3 MB of archives.
#5 36.77 After this operation, 220 kB of additional disk space will be used.
#5 36.77 Do you want to continue? [Y/n] Abort.
------
executor failed running [/bin/sh -c apt-get update && apt-get upgrade]: exit code: 1

Use -y in apt-get.
FROM jaspeen/oracle-xe-11g
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y vim-common
ENV LC_ALL-C.UTF-8
This way, apt-get will not prompt Do you want to continue? [Y/n] and apt-get will automatically upgrade without user intervention.

Related

heroku-buildpack-apt; Unable to locate package

I am using the buildpack located at https://github.com/heroku/heroku-buildpack-apt.git to install required packages using the Aptfile. Everything worked fine for a while, but now every package gives an "Unable to locate package" error. This is with the exact same files on the exact same heroku stack. Did the buildpack for using Aptfile deprecate or is there a workaround?
Full build log:
-----> Using buildpacks:
1. https://github.com/heroku/heroku-buildpack-apt.git
2. heroku/python
3. https://github.com/heroku/heroku-buildpack-python.git
4. https://github.com/matt-bertoncello/python-pyodbc-buildpack.git
-----> Apt app detected
-----> Detected Aptfile or Stack changes, flushing cache
-----> Updating apt caches
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease [81.6 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1,275 kB]
Get:6 http://apt.postgresql.org/pub/repos/apt focal-pgdg/main amd64 Packages [311 kB]
Get:7 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:8 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [786 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [699 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,203 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [965 kB]
Fetched 17.2 MB in 2s (7,544 kB/s)
Reading package lists...
-----> Fetching .debs for unixodbc
Reading package lists...
Building dependency tree...
E: Unable to locate package unixodbc
! Push rejected, failed to compile Apt app.
! Push failed```

Problem with building Docker image from Dockerfile

my task is to create a docker container from my own Dockerfile using ubuntu:18.10 and run pdflatex in this container. My system is MacOs, my Dockerfile looks like this:
FROM ubuntu:18.10
RUN apt-get update && apt-get install texlive-fonts-recommended \
texlive-generic-recommended \
texlive-latex-extra \
texlive-fonts-extra \
dvipng \
texlive-latex-recommended \
texlive-base \
texlive-pictures \
texlive-lang-cyrillic \
texlive-science \
cm-super \
texlive-generic-extra
CMD ["bash"]
I input this line in Terminal, while being in the directory, where the Dockerfile is:
docker build .
The output I get is this:
[+] Building 1.7s (5/5) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 455B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.10 0.0s
=> CACHED [1/2] FROM docker.io/library/ubuntu:18.10 0.0s
=> ERROR [2/2] RUN apt-get update && apt-get install texlive-fonts-recom 1.6s
------
> [2/2] RUN apt-get update && apt-get install texlive-fonts-recommended texlive-generic-recommended texlive-latex-extra texlive-fonts-extra dvipng texlive-latex-recommended texlive-base texlive-pictures texlive-lang-cyrillic texlive-science cm-super texlive-generic-extra:
#5 1.239 Ign:1 http://archive.ubuntu.com/ubuntu cosmic InRelease
#5 1.291 Ign:2 http://archive.ubuntu.com/ubuntu cosmic-updates InRelease
#5 1.343 Ign:3 http://archive.ubuntu.com/ubuntu cosmic-backports InRelease
#5 1.366 Ign:4 http://security.ubuntu.com/ubuntu cosmic-security InRelease
#5 1.394 Err:5 http://archive.ubuntu.com/ubuntu cosmic Release
#5 1.394 404 Not Found [IP: 91.189.88.142 80]
#5 1.447 Err:6 http://archive.ubuntu.com/ubuntu cosmic-updates Release
#5 1.447 404 Not Found [IP: 91.189.88.142 80]
#5 1.482 Err:7 http://security.ubuntu.com/ubuntu cosmic-security Release
#5 1.482 404 Not Found [IP: 91.189.91.39 80]
#5 1.497 Err:8 http://archive.ubuntu.com/ubuntu cosmic-backports Release
#5 1.498 404 Not Found [IP: 91.189.88.142 80]
#5 1.507 Reading package lists...
#5 1.537 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic Release' does not have a Release file.
#5 1.538 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-updates Release' does not have a Release file.
#5 1.539 E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' does not have a Release file.
#5 1.540 E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-backports Release' does not have a Release file.
------
executor failed running [/bin/sh -c apt-get update && apt-get install texlive-fonts-recommended texlive-generic-recommended texlive-latex-extra texlive-fonts-extra dvipng texlive-latex-recommended texlive-base texlive-pictures texlive-lang-cyrillic texlive-science cm-super texlive-generic-extra]: exit code: 100
As I understand it there is a problem while installing packs for pdflatex, but I don't understand what the error is and how to fix it. Can you tell me what to do?
Default repositories are deprecated.
Replace repositories *.ubuntu.com with old-releases.ubuntu.com in /etc/apt/sources.list with following (This is entire Dockerfile):
FROM ubuntu:18.10
RUN sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
RUN sed -i 's/security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
RUN apt-get update && apt-get install -y texlive-fonts-recommended \
texlive-generic-recommended \
texlive-latex-extra \
texlive-fonts-extra \
dvipng \
texlive-latex-recommended \
texlive-base \
texlive-pictures \
texlive-lang-cyrillic \
texlive-science \
cm-super \
texlive-generic-extra
CMD ["bash"]
Note that I added -y to the apt-get install command because I want to automatically agree to the installation.

Running apt-get update on docker ubuntu image on Mac causes "File has unexpected size"

I'm trying to run these two lines from my docker file using "docker build . ":
FROM ubuntu:latest
RUN apt-get update
This is what happens when I run it (containing the errors):
[+] Building 16.0s (6/18)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 923B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:latest 5.7s
=> [internal] load build context 0.0s
=> => transferring context: 36B 0.0s
=> CACHED [ 1/14] FROM docker.io/library/ubuntu:latest#sha256:703218c046 0.0s
=> ERROR [ 2/14] RUN apt-get update 10.2s
------
> [ 2/14] RUN apt-get update:
#5 0.915 Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
#5 1.142 Get:2 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
#5 1.626 Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#5 1.648 Get:4 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [664 kB]
#5 1.649 Err:4 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
#5 1.649 File has unexpected size (13216 != 664116). Mirror sync in progress? [IP: 91.189.91.39 80]
#5 1.649 Hashes of expected file:
#5 1.649 - Filesize:664116 [weak]
#5 1.649 - SHA256:bab7d330736bb3f137d539001f4ea9250bc6613772b9a98cfb1241ed81bd2c04
#5 1.649 - SHA1:3ee0d4d62b53860024bdb392707c909b4cc9357c [weak]
#5 1.649 - MD5Sum:87431ac524ec4b25401cea7af4c5b517 [weak]
#5 1.649 Release file created at: Sun, 14 Feb 2021 19:09:36 +0000
#5 1.841 Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
#5 2.445 Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [612 kB]
#5 2.446 Err:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
#5 2.446
#5 2.972 Get:7 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [165 kB]
#5 2.972 Err:7 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages
#5 2.972
#5 3.040 Get:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#5 3.041 Err:8 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
#5 3.041 File has unexpected size (13194 != 11344505). Mirror sync in progress? [IP: 91.189.88.152 80]
#5 3.041 Hashes of expected file:
#5 3.041 - Filesize:11344505 [weak]
#5 3.041 - SHA256:200acdc3421757fa8f8759c1cedacae2cf8f5821d7810ca59d8a313c5b3ae71e
#5 3.041 - SHA1:28dce64e724849c2296c10a2a3de8334c7829494 [weak]
#5 3.041 - MD5Sum:fc2f03a69a8d61b33e29934cbba9e675 [weak]
#5 3.041 Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
#5 3.212 Get:9 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [13.3 kB]
#5 3.212 Err:9 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
#5 3.212
#5 3.907 Get:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#5 3.907 Err:10 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages
#5 3.907
#5 4.425 Get:11 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#5 4.425 Err:11 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages
#5 4.425
#5 6.309 Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#5 6.310 Err:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
#5 6.310
#5 7.978 Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1016 kB]
#5 7.978 Err:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
#5 7.978 File has unexpected size (13202 != 1016097). Mirror sync in progress? [IP: 91.189.88.152 80]
#5 7.978 Hashes of expected file:
#5 7.978 - Filesize:1016097 [weak]
#5 7.978 - SHA256:6073eef81f57e5a6fc81d37d07bfa59f35994b89e81c79286b79f6527955e84a
#5 7.978 - SHA1:69a5e1831d1cfd408a2c120f4de248ea2d919005 [weak]
#5 7.978 - MD5Sum:5ea17bb583a7b1b4029167bdc5b3c6a8 [weak]
#5 7.978 Release file created at: Sun, 14 Feb 2021 19:09:51 +0000
#5 9.531 Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [924 kB]
#5 9.652 Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [21.1 kB]
#5 9.961 Get:16 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [198 kB]
#5 10.10 Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4301 B]
#5 10.13 Fetched 1736 kB in 10s (180 kB/s)
#5 10.13 Reading package lists...
#5 10.15 E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/universe/binary-amd64/by-hash/SHA256/bab7d330736bb3f137d539001f4ea9250bc6613772b9a98cfb1241ed81bd2c04 File has unexpected size (13216 != 664116). Mirror sync in progress? [IP: 91.189.91.39 80]
#5 10.15 Hashes of expected file:
#5 10.15 - Filesize:664116 [weak]
#5 10.15 - SHA256:bab7d330736bb3f137d539001f4ea9250bc6613772b9a98cfb1241ed81bd2c04
#5 10.15 - SHA1:3ee0d4d62b53860024bdb392707c909b4cc9357c [weak]
#5 10.15 - MD5Sum:87431ac524ec4b25401cea7af4c5b517 [weak]
#5 10.15 Release file created at: Sun, 14 Feb 2021 19:09:36 +0000
#5 10.16 E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-amd64/by-hash/SHA256/2d506247d2b3080e98624bbec9dfb69d88753039c20b4cbfcae9d53d231c2f2a
#5 10.16 E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/restricted/binary-amd64/by-hash/SHA256/4e3f319b6b7287529ff17b84b56b8be710fc6133319eba09e609b8ddef49e954
#5 10.16 E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/multiverse/binary-amd64/by-hash/SHA256/623a09d316fd7bc308280205394c995ba4a1281d77e7d920ee2bc3d0db730c91
#5 10.16 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/universe/binary-amd64/by-hash/SHA256/200acdc3421757fa8f8759c1cedacae2cf8f5821d7810ca59d8a313c5b3ae71e File has unexpected size (13194 != 11344505). Mirror sync in progress? [IP: 91.189.88.152 80]
#5 10.16 Hashes of expected file:
#5 10.16 - Filesize:11344505 [weak]
#5 10.16 - SHA256:200acdc3421757fa8f8759c1cedacae2cf8f5821d7810ca59d8a313c5b3ae71e
#5 10.16 - SHA1:28dce64e724849c2296c10a2a3de8334c7829494 [weak]
#5 10.16 - MD5Sum:fc2f03a69a8d61b33e29934cbba9e675 [weak]
#5 10.16 Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
#5 10.16 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/multiverse/binary-amd64/by-hash/SHA256/cbe561be81039e8d89187f790d03ead3debbf26b6cbdde29ae8c5137a273dd5c
#5 10.16 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/restricted/binary-amd64/by-hash/SHA256/f641509ad1e4ab977debf3d852d1a7e47a02e9d941867f7b277d95cf37d64d49
#5 10.16 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/binary-amd64/by-hash/SHA256/f25bb719a900d962a4df25cbb20f0a54a23d9f16c3fcdc4f4872ead131f5a604
#5 10.16 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/binary-amd64/by-hash/SHA256/6073eef81f57e5a6fc81d37d07bfa59f35994b89e81c79286b79f6527955e84a File has unexpected size (13202 != 1016097). Mirror sync in progress? [IP: 91.189.88.152 80]
#5 10.16 Hashes of expected file:
#5 10.16 - Filesize:1016097 [weak]
#5 10.16 - SHA256:6073eef81f57e5a6fc81d37d07bfa59f35994b89e81c79286b79f6527955e84a
#5 10.16 - SHA1:69a5e1831d1cfd408a2c120f4de248ea2d919005 [weak]
#5 10.16 - MD5Sum:5ea17bb583a7b1b4029167bdc5b3c6a8 [weak]
#5 10.16 Release file created at: Sun, 14 Feb 2021 19:09:51 +0000
#5 10.16 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
executor failed running [/bin/sh -c apt-get update]: exit code: 100
I'm running this from my MacBook Pro macOS Big Sur 11.1
I tried running apt-get update on a Linux virtual machine and got the same kind of errors one after another. Also, I had the same line where it says "file has unexpected size" and I'm not sure the source of that either.
NOTE: This works on a Windows machine, but won't work on my Mac.
Any help appreciated!!!
I had the same issue and the reasons turned out to be that I had content restriction set on my iPhone and these were automatically synced to my Mac.
After switching the restrictions off everything worked as it should.
Go to System Preferences > Screen Time > Turn Content & Privacy Restrictions off

Problems with the installation of VirtualBox on Ubuntu 20.04.1 LTS

just so you know I'm pretty new at Linux.
I just made the jump from Ubuntu 19.10 to Ubuntu 20.04.1 LTS because I thought there wouldn't be a problem with VirtualBox.
When the upgrade was finished I noticed VirtualBox was gone, I tried to install it following the instruction on the official website and other sites.
I don't know what you guys exactly need to help me solve the problem so here's some informations :
Here's what appears when I do sudo apt update :
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:4 http://download.virtualbox.org/virtualbox/debian focal InRelease
Get:5 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [169 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [412 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [93,5 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [724 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [399 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [180 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [11,4 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages [13,4 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [110 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [16,5 kB]
Fetched 2 352 kB in 1s (2 345 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
10 packages can be upgraded. Run 'apt list --upgradable' to see them.
Now sudo apt install virtualbox virtualbox-ext-pack :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package virtualbox is a virtual package provided by:
virtualbox-6.1 6.1.16-140961~Ubuntu~eoan
virtualbox-6.0 6.0.24-139119~Ubuntu~eoan
You should explicitly select one to install.
Package virtualbox-ext-pack 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 'virtualbox' has no installation candidate
E: Package 'virtualbox-ext-pack' has no installation candidate
Or when I do sudo apt install virtualbox-6.0 :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
virtualbox-6.0 : Depends: libqt5printsupport5 (>= 5.0.2) but it is not installable
Depends: python (< 2.8) but it is not installable
Depends: python (>= 2.7) but it is not installable
Depends: python:any (>= 2.6.6-7~)
Recommends: libsdl-ttf2.0-0 but it is not installable
Recommends: gcc but it is not going to be installed
Recommends: make but it is not going to be installed or
build-essential but it is not going to be installed or
dpkg-dev but it is not going to be installed
Recommends: binutils but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I did
$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
$ wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -
and
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | \
sudo tee -a /etc/apt/sources.list.d/virtualbox.list
without any problems.
I hope everyone is having a good day :)
#Just Download a debian file:
https://download.virtualbox.org/virtualbox/6.1.16/virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
And install with :
sudo dpkg -i virtualbox-6.1_6.1.16-140961~Ubuntu~eoan_amd64.deb
#If get's Any error
sudo apt install -f
Just add a repository to your system to download the package virtualbox needs:
deb http://deb.debian.org/debian buster main contrib non-free
And then reinstall with the command:
sudo apt install virtualbox-6.1
It worked with me.
I solved it in the following way
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository "deb http://download.virtualbox.org/virtualbox/debian bionic contrib"
sudo apt-get update
If when doing apt-get update it appears:
N: Skipping acquire of configured file 'contrib/binary-i386/Packages'
as repository 'http://download.virtualbox.org/virtualbox/debian bionic
InRelease' doesn't support architecture 'i386'
then:
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list
continue:
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install libpng16-16 libqt5core5a libqt5printsupport5 libqt5widgets5 libqt5x11extras5
sudo apt-get install virtualbox-6.0 -y

apt-get install build-essential not working on vagrant through provision

I have the following in my Vagrantfile. It install vim, but it does not install nodejs, git etc. How to change it so that it run apt-get install build-essential git-core python-software-properties nodejs? Or should I do this with puppet file?
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu32"
config.vm.provision :shell, path: './provision.sh'
config.vm.network "public_network"
end
provision.sh
apt-get update
apt-get install build-essential git-core python-software-properties nodejs
apt-get install vim -y
====
UPDATE: This is the outputs of vagrant up.
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'ubuntu32'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Available bridged network interfaces:
1) en1: Wi-Fi (AirPort)
2) en0: Ethernet
3) p2p0
What interface should the network bridge to? 1
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.
Guest Additions Version: 4.2.0
VirtualBox Version: 4.3
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant
[default] Running provisioner: shell...
[default] Running: /var/folders/y0/dzf6yf9n5r1bsl3p94lmv2fr0000gp/T/vagrant-shell20131108-47487-13ypot
stdin: is not a tty
Ign http://security.ubuntu.com precise-security InRelease
Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
Get:2 http://security.ubuntu.com precise-security Release [49.6 kB]
Get:3 http://security.ubuntu.com precise-security/main Sources [92.5 kB]
Get:4 http://security.ubuntu.com precise-security/restricted Sources [2,494 B]
Get:5 http://security.ubuntu.com precise-security/universe Sources [29.6 kB]
Ign http://us.archive.ubuntu.com precise InRelease
Get:6 http://security.ubuntu.com precise-security/multiverse Sources [1,804 B]
Ign http://us.archive.ubuntu.com precise-updates InRelease
Ign http://us.archive.ubuntu.com precise-backports InRelease
Get:7 http://us.archive.ubuntu.com precise Release.gpg [198 B]
Get:8 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:9 http://us.archive.ubuntu.com precise-backports Release.gpg [198 B]
Get:10 http://security.ubuntu.com precise-security/main i386 Packages [354 kB]
Get:11 http://us.archive.ubuntu.com precise Release [49.6 kB]
Get:12 http://security.ubuntu.com precise-security/restricted i386 Packages [4,620 B]
Get:13 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Get:14 http://security.ubuntu.com precise-security/universe i386 Packages [88.4 kB]
Get:15 http://security.ubuntu.com precise-security/multiverse i386 Packages [2,640 B]
Get:16 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Get:17 http://security.ubuntu.com precise-security/main TranslationIndex [74 B]
Get:18 http://security.ubuntu.com precise-security/multiverse TranslationIndex [72 B]
Get:19 http://security.ubuntu.com precise-security/restricted TranslationIndex [72 B]
Get:20 http://security.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:21 http://us.archive.ubuntu.com precise/main Sources [934 kB]
Get:22 http://security.ubuntu.com precise-security/main Translation-en [159 kB]
Get:23 http://security.ubuntu.com precise-security/multiverse Translation-en [1,299 B]
Get:24 http://security.ubuntu.com precise-security/restricted Translation-en [1,253 B]
Get:25 http://security.ubuntu.com precise-security/universe Translation-en [53.8 kB]
Get:26 http://us.archive.ubuntu.com precise/restricted Sources [5,470 B]
Get:27 http://us.archive.ubuntu.com precise/universe Sources [5,019 kB]
Get:28 http://us.archive.ubuntu.com precise/multiverse Sources [155 kB]
Get:29 http://us.archive.ubuntu.com precise/main i386 Packages [1,274 kB]
Get:30 http://us.archive.ubuntu.com precise/restricted i386 Packages [8,431 B]
Get:31 http://us.archive.ubuntu.com precise/universe i386 Packages [4,796 kB]
Get:32 http://us.archive.ubuntu.com precise/multiverse i386 Packages [121 kB]
Get:33 http://us.archive.ubuntu.com precise/main TranslationIndex [3,706 B]
Get:34 http://us.archive.ubuntu.com precise/multiverse TranslationIndex [2,676 B]
Get:35 http://us.archive.ubuntu.com precise/restricted TranslationIndex [2,596 B]
Get:36 http://us.archive.ubuntu.com precise/universe TranslationIndex [2,922 B]
Get:37 http://us.archive.ubuntu.com precise-updates/main Sources [424 kB]
Get:38 http://us.archive.ubuntu.com precise-updates/restricted Sources [7,006 B]
Get:39 http://us.archive.ubuntu.com precise-updates/universe Sources [99.2 kB]
Get:40 http://us.archive.ubuntu.com precise-updates/multiverse Sources [8,354 B]
Get:41 http://us.archive.ubuntu.com precise-updates/main i386 Packages [723 kB]
Get:42 http://us.archive.ubuntu.com precise-updates/restricted i386 Packages [11.4 kB]
Get:43 http://us.archive.ubuntu.com precise-updates/universe i386 Packages [225 kB]
Get:44 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [14.2 kB]
Get:45 http://us.archive.ubuntu.com precise-updates/main TranslationIndex [3,564 B]
Get:46 http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex [2,605 B]
Get:47 http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex [2,461 B]
Get:48 http://us.archive.ubuntu.com precise-updates/universe TranslationIndex [2,850 B]
Get:49 http://us.archive.ubuntu.com precise-backports/main Sources [4,233 B]
Get:50 http://us.archive.ubuntu.com precise-backports/restricted Sources [14 B]
Get:51 http://us.archive.ubuntu.com precise-backports/universe Sources [36.1 kB]
Get:52 http://us.archive.ubuntu.com precise-backports/multiverse Sources [5,311 B]
Get:53 http://us.archive.ubuntu.com precise-backports/main i386 Packages [2,838 B]
Get:54 http://us.archive.ubuntu.com precise-backports/restricted i386 Packages [14 B]
Get:55 http://us.archive.ubuntu.com precise-backports/universe i386 Packages [36.7 kB]
Get:56 http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages [5,178 B]
Get:57 http://us.archive.ubuntu.com precise-backports/main TranslationIndex [72 B]
Get:58 http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex [72 B]
Get:59 http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex [70 B]
Get:60 http://us.archive.ubuntu.com precise-backports/universe TranslationIndex [73 B]
Get:61 http://us.archive.ubuntu.com precise/main Translation-en [726 kB]
Get:62 http://us.archive.ubuntu.com precise/multiverse Translation-en [93.4 kB]
Get:63 http://us.archive.ubuntu.com precise/restricted Translation-en [2,395 B]
Get:64 http://us.archive.ubuntu.com precise/universe Translation-en [3,341 kB]
Get:65 http://us.archive.ubuntu.com precise-updates/main Translation-en [317 kB]
Get:66 http://us.archive.ubuntu.com precise-updates/multiverse Translation-en [8,136 B]
Get:67 http://us.archive.ubuntu.com precise-updates/restricted Translation-en [2,637 B]
Get:68 http://us.archive.ubuntu.com precise-updates/universe Translation-en [129 kB]
Get:69 http://us.archive.ubuntu.com precise-backports/main Translation-en [2,072 B]
Get:70 http://us.archive.ubuntu.com precise-backports/multiverse Translation-en [4,610 B]
Get:71 http://us.archive.ubuntu.com precise-backports/restricted Translation-en [14 B]
Get:72 http://us.archive.ubuntu.com precise-backports/universe Translation-en [26.9 kB]
Fetched 19.6 MB in 1min 21s (242 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
dpkg-dev fakeroot g++ g++-4.6 git git-man libalgorithm-diff-perl
libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-ares2 libdpkg-perl
liberror-perl libev4 libicu48 libstdc++6-4.6-dev libv8-3.7.12.22 make patch
python-pycurl unattended-upgrades
Suggested packages:
debian-keyring g++-multilib g++-4.6-multilib gcc-4.6-doc libstdc++6-4.6-dbg
git-daemon-run git-daemon-sysvinit git-doc git-el git-arch git-cvs git-svn
git-email git-gui gitk gitweb libstdc++6-4.6-doc make-doc diffutils-doc
libcurl4-gnutls-dev python-pycurl-dbg bsd-mailx
The following NEW packages will be installed:
build-essential dpkg-dev fakeroot g++ g++-4.6 git git-core git-man
libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
libc-ares2 libdpkg-perl liberror-perl libev4 libicu48 libstdc++6-4.6-dev
libv8-3.7.12.22 make nodejs patch python-pycurl python-software-properties
unattended-upgrades
0 upgraded, 24 newly installed, 0 to remove and 155 not upgraded.
Need to get 26.5 MB of archives.
After this operation, 72.3 MB of additional disk space will be used.
Do you want to continue [Y/n]? Abort.
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libgpm2 libpython2.7 python2.7 python2.7-minimal vim-common vim-runtime
vim-tiny
Suggested packages:
gpm python2.7-doc binfmt-support ctags vim-doc vim-scripts indent
The following NEW packages will be installed:
libgpm2 libpython2.7 vim vim-runtime
The following packages will be upgraded:
python2.7 python2.7-minimal vim-common vim-tiny
4 upgraded, 4 newly installed, 0 to remove and 151 not upgraded.
Need to get 13.2 MB of archives.
After this operation, 27.8 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise/main libgpm2 i386 1.20.4-4 [16.9 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7 i386 2.7.3-0ubuntu3.4 [2,647 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main python2.7-minimal i386 2.7.3-0ubuntu3.4 [1,690 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim-tiny i386 2:7.3.429-2ubuntu2.1 [380 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim-common i386 2:7.3.429-2ubuntu2.1 [85.8 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main libpython2.7 i386 2.7.3-0ubuntu3.4 [1,148 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim-runtime all 2:7.3.429-2ubuntu2.1 [6,277 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main vim i386 2:7.3.429-2ubuntu2.1 [979 kB]
dpkg-preconfigure: unable to re-open stdin: No such file or directory
Fetched 13.2 MB in 49s (270 kB/s)
Selecting previously unselected package libgpm2.
(Reading database ... 29361 files and directories currently installed.)
Unpacking libgpm2 (from .../libgpm2_1.20.4-4_i386.deb) ...
Preparing to replace python2.7 2.7.3-0ubuntu3 (using .../python2.7_2.7.3-0ubuntu3.4_i386.deb) ...
Unpacking replacement python2.7 ...
Preparing to replace python2.7-minimal 2.7.3-0ubuntu3 (using .../python2.7-minimal_2.7.3-0ubuntu3.4_i386.deb) ...
Unpacking replacement python2.7-minimal ...
Processing triggers for man-db ...
Setting up python2.7-minimal (2.7.3-0ubuntu3.4) ...
(Reading database ... 29364 files and directories currently installed.)
Preparing to replace vim-tiny 2:7.3.429-2ubuntu2 (using .../vim-tiny_2%3a7.3.429-2ubuntu2.1_i386.deb) ...
Unpacking replacement vim-tiny ...
Preparing to replace vim-common 2:7.3.429-2ubuntu2 (using .../vim-common_2%3a7.3.429-2ubuntu2.1_i386.deb) ...
Unpacking replacement vim-common ...
Selecting previously unselected package libpython2.7.
Unpacking libpython2.7 (from .../libpython2.7_2.7.3-0ubuntu3.4_i386.deb) ...
Selecting previously unselected package vim-runtime.
Unpacking vim-runtime (from .../vim-runtime_2%3a7.3.429-2ubuntu2.1_all.deb) ...
Adding 'diversion of /usr/share/vim/vim73/doc/help.txt to /usr/share/vim/vim73/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim73/doc/tags to /usr/share/vim/vim73/doc/tags.vim-tiny by vim-runtime'
Selecting previously unselected package vim.
Unpacking vim (from .../vim_2%3a7.3.429-2ubuntu2.1_i386.deb) ...
Processing triggers for man-db ...
Setting up libgpm2 (1.20.4-4) ...
Setting up python2.7 (2.7.3-0ubuntu3.4) ...
Setting up vim-common (2:7.3.429-2ubuntu2.1) ...
Setting up vim-tiny (2:7.3.429-2ubuntu2.1) ...
Setting up libpython2.7 (2.7.3-0ubuntu3.4) ...
Setting up vim-runtime (2:7.3.429-2ubuntu2.1) ...
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.429-2ubuntu2.1) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode.
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
I am running Vagrant 1.3.5 and VirtualBox 4.3.2 r90405 on Mac OSX Mavericks. I downgrade VirtualBox to 4.2.18 (I will change to 4.2.0) and installed vagrant-vbguest
vagrant plugin install vagrant-vbguest
Then I run this command.
$sudo /Library/StartupItems/VirtualBox/VirtualBox restart
Found at vagrant 'hostonlyif' create not working
I added -y to apt-get
apt-get update
apt-get -y install build-essential git-core python-software-properties nodejs
apt-get -y install vim
Then it installed all.

Resources