-
-
Save nuga99/dd5ac250b4c98154b5065d8affec7b49 to your computer and use it in GitHub Desktop.
#!/bin/sh | |
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/ | |
# Changelog: | |
# @DavoedM: Apr 3, 2020 | |
# @C922A10971734: Jan 19, 2023 | |
set -e | |
# Install dependencies. | |
sudo apt install -y curl apt-transport-https \ | |
software-properties-common ca-certificates | |
# Grab OS Codename | |
CODENAME=$(lsb_release --codename | cut -f2) | |
# Install docker. | |
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add - | |
echo "deb [arch=amd64] https://download.docker.com/linux/debian $CODENAME stable" | \ | |
sudo tee /etc/apt/sources.list.d/docker-engine.list | |
sudo apt-get update -y | |
sudo apt-get install -y docker-ce | |
# Run docker. | |
sudo systemctl start docker | |
sudo systemctl enable docker | |
# Add user to docker group for using docker without sudo command. | |
sudo gpasswd -a "${USER}" docker | |
# Reboot | |
sudo reboot |
I came across this error, does anyone know how to solve it?
Err:9 https://download.docker.com/linux/debian ara Release
404 Not Found [IP: 108.138.141.89 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/debian ara Release' does not have a Release file.
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.
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1
@rizkytegar What is debian ara
release? You need to check the distribution first
https://download.docker.com/linux/debian
'ara Release' is the default of Parrot Security OS
because there's no official release from Parrot OS (cmiiw), you need to install based on debian. You can change the $CODENAME variable to buster
for example. @rizkytegar
Ugh, yeah I half-arsed that contribution. No error handling around the code name and deb
command, plus if no valid release is found it should default to something
On another note, every version I've tried does give a valid debian code name. I'd be interested to hear about the setup @rizkytegar is using
@C922A10971734 will soon change the bash script to default if not found
@nuga99 This might require keeping a list of valid releases that are available at https://download.docker.com/linux/debian, or doing a preliminary check to see if it is available.
Based on what @rizkytegar said, theirs was returning ara Release
as the codename, which means the command is returning properly but not with a debian release but a parrot specific release name
Further thinking....my changes to help automate part of the process might in turn complicate things. Might be easier for the user to just determine the release version on their own and fill in CODENAME=
E: The repository 'https://download.docker.com/linux/debian n/a Release' does not have a Release file.
n/a means there is not spesific release for Parrot, so you need to add debain spesific like "stretch" for example
work with
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
work with
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1 W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1 W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/docker-engine.list:1 and /etc/apt/sources.list.d/docker.list:1
This didn't help me
@coHipa seems you need to change the CODENAME part
You likely have two entries in your /etc/apt/sources.list.d/docker-engine.list
file (see image below). The other possibility is that you have an entry in that file, and also have a similar competing entry in another file.
In short, you have two deb
entries somewhere in your source lists. Run the following command to search through your sources to find where you have entries
sudo grep -Ri 'https://download.docker.com/linux/' '/etc/apt/sources.list.d/'
The output for me shows the two entires I added to file for this example:
/etc/apt/sources.list.d/docker-engine.list:deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable
/etc/apt/sources.list.d/docker-engine.list:deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable
@C922A10971734 will soon change the bash script to default if not found
I have a massive update coming that will remedy the issues everyone's having, except for the one I explain above because it's not related. The main issue here is that ParrotOS started using their own distro and build names. These names, such as Ara
will never match a corresponding debian name.
EDIT:
Everything I talk about below has been moved to an official repo to track issues/contributions.
https://github.com/J7a4s0m5ine/docker-debian-installer
@nuga99 and others:
Here's my latest attempt at this problem. Definitely not my proudest work, I'm very rusty in bash apparently. It now provides an interactive install experience that guides the user through choosing distribution, build, and architecture. So it should cover everyone's cases of being able to install easily. Unfortunately like I mentioned before, build names between ParrotOS and Debian will no longer match. So it will require some intuition or research on the user's side. Albeit, this stops any crazy erroneous possibilities with finding a release name and the like during script runtime.
Everything is data-dynamic, all choices are pulled directly from docker's directory browser, so any future choices available will automatically populate in the menu choices. Nothing is hardcoded except for window size, errors, and contributions. There are checks and faults for unsupported distros as well as platforms that don't provide debs/source and only have static assets.
I've automated the testing to this across every version of ParrotOS and every other Debian based OS. There are ways this script can screw up an install. For example using Parrot v5.3 and choosing Debian Bookworm stable amd64 will put you in a situation where containerd and other dependencies cannot be installed because the subsequent dependencies for those requirements are incompatible. Someday down the line I'll provide checks/fixes for this but its outside the purview of what I want to accomplish for now; I have a ton of other projects to be working on.
From space with 💕,
C9
USAGE
Simply run the command to download and run with bash:
wget -O - https://raw.githubusercontent.com/J7a4s0m5ine/docker-debian-installer/main/docker-debian-interactive-install.sh | bash
Things to fix and or provide as new features:
- Check if docker is installed/Allow for uninstall or changes
- Check if previous entry in sources.lists exists
- Delete all entries in sources.lists
- Change window size to be dynamic
- Provide functions for non-debian systems
- Generalize the entire approach to be able to provide an apt HTTP URL and install anything!!
Screenshots
Distro Selection
Build Selection
Arch Selection
Installation Confirmation
Reboot Confirmation
To fix the above original script (the one in this gist), I have formalized a simpler solution than my new project above with the interactive installer.
Realistically we can just keep key/value pairs in a bash associative array that relate Parrot Codenames to Debian Codenames. My above solution will eventually be brought into a different direction which will include much more than docker.
Basically
distribution_mappings=( ["ara"]="bullseye" ["ara2"]="bookworm") and so on
This will have to be manually updated overtime, but seems like the simplest approach.
getting this error please some one help me "
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20210119).
curl is already the newest version (7.88.1-10+deb12u3~bpo11+1).
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:
software-properties-common : Depends: python3-software-properties (= 0.96.20.2-2.1) but it is not installable
Recommends: packagekit but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
"
E: The repository 'https://download.docker.com/linux/debian n/a Release' does not have a Release file.
n/a means there is not spesific release for Parrot, so you need to add debain spesific like "stretch" for example
work with
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Thanks man, this works perfectly
@J7a4s0m5ine thanks your script works smoothly
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es01.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es02.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es03.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es04.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es05.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es06.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es07.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es08.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es09.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es01.html?iu9
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es02.html?oph
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es03.html?9ui
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es04.html?5h
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es05.html?vhf
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es06.html?fts
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es07.html?65fh
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es08.html?vrt
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es09.html?vy
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es01.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es02.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es03.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es04.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es05.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es06.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es07.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es08.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es09.html
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es01.html?iu9
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es02.html?oph
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es03.html?9ui
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es04.html?5h
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es05.html?vhf
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es06.html?fts
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es07.html?65fh
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es08.html?vrt
https://sla.gov.eg/cbs/video/video-bayern-munich-real-madrid-en-vivo-es09.html?vy
@C922A10971734 Thank you for your contribution. I have added your account to the changelog as a contributor.