error when install tools in docker container - docker

I install ubuntu-14.04.4-server-amd64.iso in my VirtualBox,then I use some way to get its rootfs. after that i can the rootfs to create my docker image.the Dockerfile as following:
FROM scratch
COPY rootfs /
RUN chmod u+s /usr/bin/sudo && chmod u+s /bin/mount && chmod u+s /bin/umount
I start my docker container,then I install some tools,like minicom,wget ...,but error,the following is error msg:
root#20ca319c51e6:~$ apt-get install minicom
Reading package lists... Done
Building dependency tree
Reading state information... Done
minicom is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up libpam-systemd:amd64 (204-5ubuntu20.19) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
invoke-rc.d: unknown initscript, /etc/init.d/systemd-logind not found.
runlevel:/var/run/utmp: No such file or directory
dpkg: error processing package libpam-systemd:amd64 (--configure):
subprocess installed post-installation script returned error exit status 100
Errors were encountered while processing:
libpam-systemd:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also try to "apt-get update;apt-get upgrade",but get same error msg too,
what's should i do.need you help! thanks all :)

Related

I keep getting this error when trying to install anything on mac big sure

$ brew install mongodb-community#4.4
It returns:
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/frankline/Library/Caches/Homebrew/downloads/302d48e748531e0994cd7b3caf9bc7069ec6c132b710dc1bb8e33b725495056e--icu4c-69.1.big_sur.bottle.tar.gz --directory /private/tmp/d20210613-34193-g4tpe7` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/frankline/Library/Caches/Homebrew/downloads/302d48e748531e0994cd7b3caf9bc7069ec6c132b710dc1bb8e33b725495056e--icu4c-69.1.big_sur.bottle.tar.gz're
I got the same problem when I executed brew upgrade. It returns:
==>installing dependencies for python#3.9: gdbm, mpdecimal, openssl#1.1 and xz.
==>Installing python#3.9 dependency: gdbm
==> Pouring gdbm-1.19.big_sur.bottle.tar.gz
tar: Error opening archive: Failed to open '/Users/xxx/Library/Caches/Homebrew/downloads/37cae0aa5a09881f7ab73dab85cc31f096f5dd68aa99e80a4ccac9957292d63d--gdbm-1.19.big_sur.bottle.tar.gz'
Error: Failure while executing; tar --extract --no-same-owner --file /Users/xxx/Library/Caches/Homebrew/downloads/37cae0aa5a09881f7ab73dab85cc31f096f5dd68aa99e80a4ccac9957292d63d--gdbm-1.19.big_sur.bottle.tar.gz --directory /private/tmp/d20210615-1870-15pgco1 exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/lichong/Library/Caches/Homebrew/downloads/37cae0aa5a09881f7ab73dab85cc31f096f5dd68aa99e80a4ccac9957292d63d--gdbm-1.19.big_sur.bottle.tar.gz'
Here is my solution: first install the dependency, i.e., brew install gdbm and then upgrade. Hope this can solve your problem.
brew install "dependency" and brew upgrade worked for me!
The specific dependency in my case was pcre2, not --gdbm as above.

How to solve this build error on Linux when building libsodium

I'm trying to build libsodium-sys dependency in an Azure Docker VM which is based on debian.
Have spend a couple of hours trying to fix this build error, but can't figure out what's going on.
I fixed a couple of build errors by installing missing dependencies as the Azure Docker VM seems very vanilla. Executed commands are below the error.
error: failed to run custom build command for `libsodium-sys v0.2.6 (https://github.com/cjdelisle/sodiumoxide?rev=76dc0e6e587b8c8a4bb193ebba9f8ae8f090b81b#76dc0e6e)`
Caused by:
process didn't exit successfully: `/home/packetcrypt_rs/target/release/build/libsodium-sys-169018138a0de36b/build-script-build` (exit code: 101)
checking for working alloca.h... yes
checking for alloca... yes
...
Making check in builds
--- stderr
/bin/bash: line 20: cd: builds: No such file or directory
make: *** [Makefile:516: check-recursive] Error 1
thread 'main' panicked at '
Failed to build libsodium using "make" "check" "-j4"
', /root/.cargo/git/checkouts/sodiumoxide-9b8c3ad42446e2d9/76dc0e6/libsodium-sys/build.rs:281:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
root#2d0a725cde47:/home/packetcrypt_rs#
Build.rs file it's talking about: https://github.com/sodiumoxide/sodiumoxide/blob/master/libsodium-sys/build.rs
Executed commands:
apt get-update
apt-get install pkg-config
apt install apt-utils
apt install file
apt install gcc git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
apt install make
apt install build-essential gcc-multilib -y
rustup target add armv7-unknown-linux-gnueabihf
git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
~/.cargo/bin/cargo build --release
The cause seems related to the issue explained here: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/1379#note_280986944
For reasons unbeknownst to me, these are the commands I needed to execute to fix it:
rm ~/.bashrc
rm ~/.profile

I am trying to install docker on centos8 vagrantbox facing the error 'Downloading successful, but checksum doesn't match'

[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: ece851b2b2defa24eb3b817b14d97f31f4043a713d7367972bd2c1ef4f2788b8(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
(8/21): python3-policycoreutils-2.9-9.el8.noarch.rpm 107 kB/s | 2.2 MB 00:21
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3928fc6c58817b02602a249e512d7e99b7c3fe06ea5d9ff3ad46e25984ff8141(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[MIRROR] docker-ce-18.09.1-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3ddabd445a05b85aeba128da42283d3285ca8055e6a201139ee49b682942ba43(sha256) Expected: 6034f83c3bf3d5d31120ef36b3172dbb28d1ac8ae3699ed8cb33924dcef0d17a(sha256)
[MIRROR] containerd.io-1.2.0-3.el7.x86_64.rpm: Downloading successful, but checksum doesn't match. Calculated: 3914815a5c9756672d6f046929335ddff86607c29ac8a3c3fc12452a69952bf7(sha256) Expected: 7bd1d8da7d896ead55fdea3a42100eac4c4d7800f958d3ae056d40268dec4636(sha256)
[FAILED] containerd.io-1.2.0-3.el7.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
(10-11/21): docker-ce-18.09.1-3.el7.x86_64.rpm 50% [============================================== ] 1.4 MB/s | 50 MB 00:35 ETA
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Error: Error downloading packages:
Cannot download Packages/containerd.io-1.2.0-3.el7.x86_64.rpm: All mirrors were tried
Error: Transaction test error: package selinux-policy-targeted-3.14.3-41.el8_2.5.noarch does not verify: Header SHA1 digest: BAD (Expected ab8b3fe6b75faa65c89e64ec34986ee49924f982 != 3716bcc257255e43bc9ace1b9c4aecb6fcba3e61) package python3-policycoreutils-2.9-9.el8.noarch does not verify: Header SHA1 digest: BAD (Expected af32d12b99154706740619e0ac39289c009f1aa9 != faa84ee41c25523f2a05358d172f124370c18f99) package containerd.io-1.2.6-3.3.el7.x86_64 does not verify: no digest
''' Please help me to install docker on centos8 to fix this issue SHA1 digest: BAD '''
Try installing packages containerd manually:
yum clean packages #clean packages from failed install
dnf install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm #install newest containerd manually
sudo yum install docker-ce docker-ce-cli #install Docker daemon and CLI
Links:
Install Docker on CentOS
Docker documentation for installation
on CentOS
Docker CentOS repository

I can't get Docker installed on Debian 8 Jessie

I'm trying to get Docker installed on a machine with Debian 8 (Jessie), but I always seem to run into errors no matter what I try.
Using these instructions: https://docs.docker.com/install/linux/docker-ce/debian
Checking the kernal:
uname -r
3.16.0-4-686-pae
The fateful moment:
sudo apt-get install docker-ce
Setting up docker-ce (18.06.1~ce~3-0~debian) …
Installing new version of config file /etc/bash_completion.d/docker …
Job for docker.service failed. See ‘systemctl status docker.service’ and ‘journalctl -xn’ for details.
invoke-rc.d: initscript docker, action “start” failed.
dpkg: error processing package docker-ce (–configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-18+deb8u10) …
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)
I also tried installing directly from a package: https://download.docker.com/linux/debian/dists/jessie/pool/stable/amd64/
(Selecting version 17.03.2)
And after installing the dependencies, things still don't work:
sudo dpkg --install docker-ce_17.03.2_ce-0_debian-jessie_amd64.deb
(Reading database ... 169325 files and directories currently installed.)
Preparing to unpack docker-ce_17.03.2_ce-0_debian-jessie_amd64.deb ...
Unpacking docker-ce (17.03.2~ce-0~debian-jessie) over (17.03.2~ce-0~debian-jessie) ...
Setting up docker-ce (17.03.2~ce-0~debian-jessie) ...
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript docker, action "start" failed.
dpkg: error processing package docker-ce (--install):
subprocess installed post-installation script returned error exit status 1
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for systemd (215-17+deb8u7) ...
Errors were encountered while processing:
docker-ce
I also looked at this article: http://www.boynux.com/docker-jessie/
But I didn't even get past the first step:
curl https://get.docker.com | sh
Either your platform is not easily detectable or is not supported by this
installer script.
Please visit the following URL for more detailed installation instructions:
https://docs.docker.com/engine/installation/
Between every one of these attempts I did a
sudo apt-get remove docker docker-engine docker.io docker-ce
sudo apt-get update
docker-ce isn't available for i686
see OS requirements
Docker CE is supported on both x86_64 (or amd64) and armhf architectures for Jessie and Stretch.

Expected Program Not Found in PATH or not Executable

I keep running lb build, fixing problem after problem and then running it again, and now i'm getting this message:
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists... Done
Building dependency tree... Done
I then went to check my path and i see
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
This clearly shows /usr/local/sbin, /usr/sbin, and /sbin.
Any suggestions?
**UPDATE 1**
Followed this guide
http://ubuntuforums.org/showthread.php?t=1449322
every command ran fine but still the same error message after running lb build again.
**UPDATE 2 -- Additional Info**
root#kali:~# ls -lA /sbin
(Other files)
-rwxr-xr-x 1 root root 28208 Aug 12 15:00 start-stop-daemon
First, you must check the feedback information from the first line (although it is just a warning).
Then, you must have understand that the warning is the key. All the mistakes are caused by this warning. You have to add start-stop-daemon to your pc.
According to the following:
cd /tmp
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2/
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/local/bin/start-stop-daemon
Now you can help yourself,and others
I have the same problem, according to https://debianforum.de/forum/viewtopic.php?f=34&t=155279 (in german) the only known solution is to run sudo lb clean before sudo lb build.

Resources