Last active
July 16, 2024 15:20
-
-
Save eric-glb/0a6ea7685e6b4c1ffdf49545b908e087 to your computer and use it in GitHub Desktop.
Docker - RHEL7 / CentOS 7: get last packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bien/env bash | |
SRC=https://download.docker.com/linux/centos/7/x86_64/stable/Packages/ | |
rm -rf /tmp/centos7 | |
mkdir -p /tmp/centos7 | |
cd /tmp/centos7 | |
curl -s $SRC | \ | |
perl -MSort::Versions -nle ' | |
push @{$a{$1}}, $2 if /href="([^"0-9]+)-(\d+[^"]+)"/; | |
}{ | |
for (sort keys %a ) { | |
@v = sort { versioncmp($a, $b) } @{ $a{$_} }; | |
printf "%s%s-%s\n", "'${SRC}'", $_, $v[-1]; | |
}' | \ | |
xargs -l curl -s --remote-name | |
cd .. | |
tar cvfz docker-centos7.tgz centos7/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment