@@ -847,6 +847,129 @@ setup_apt()
847
847
fi
848
848
}
849
849
850
+ # setup_aptrpm will upgrade or setup all packages for apt-rpm based systems.
851
+ # Arguments:
852
+ # None
853
+ # Expected global variables:
854
+ # upgrade: if we need to upgrade or not
855
+ # container_additional_packages: additional packages to install during this phase
856
+ # Expected env variables:
857
+ # None
858
+ # Outputs:
859
+ # None
860
+ setup_aptrpm ()
861
+ {
862
+ setup_rpm_exceptions
863
+
864
+ # If we need to upgrade, do it and exit, no further action required.
865
+ if [ " ${upgrade} " -ne 0 ]; then
866
+ apt-get update
867
+ apt-get dist-upgrade -y
868
+ exit
869
+ fi
870
+
871
+ apt-get update
872
+ # Check if shell_pkg is available in distro's repo. If not we
873
+ # fall back to bash, and we set the SHELL variable to bash so
874
+ # that it is set up correctly for the user.
875
+ if ! apt-get install -y " ${shell_pkg} " ; then
876
+ shell_pkg=" bash"
877
+ fi
878
+ deps="
879
+ ${shell_pkg}
880
+ apt-repo-tools
881
+ apt-rsync
882
+ bash-completion
883
+ bc
884
+ bzip2
885
+ curl
886
+ cracklib
887
+ dialog
888
+ diffutils
889
+ eepm
890
+ findutils
891
+ fontconfig
892
+ gettext
893
+ glibc
894
+ glibc-i18ndata
895
+ gnupg
896
+ gnupg2
897
+ iconv
898
+ iproute2
899
+ iputils
900
+ keyutils
901
+ less
902
+ libcap
903
+ libEGL
904
+ libGL
905
+ libkrb5
906
+ libnss-mdns
907
+ libnss-myhostname
908
+ vte3
909
+ libvulkan1
910
+ lsof
911
+ man-db
912
+ mount
913
+ mtr
914
+ ncurses
915
+ openssh-clients
916
+ pam
917
+ passwd
918
+ pigz
919
+ pinentry-common
920
+ procps
921
+ su
922
+ sudo
923
+ tcpdump
924
+ time
925
+ traceroute
926
+ tree
927
+ tzdata
928
+ unzip
929
+ util-linux
930
+ wget
931
+ xauth
932
+ xorg-dri-intel
933
+ xorg-dri-radeon
934
+ xorg-utils
935
+ xz
936
+ zip
937
+ "
938
+ # shellcheck disable=SC2086,2046
939
+ apt-get install -y ${deps}
940
+
941
+ # Altlinux hooks. Without them the commands su, sudo, sudoreplay and passwd do not work
942
+ control passwd traditional
943
+ control sudo public
944
+ control sudoreplay public
945
+ control su wheel
946
+ mkdir /etc/tcb/" ${container_user_name} "
947
+ echo " ${container_user_name} ::::::::" > /etc/tcb/" ${container_user_name} " /shadow
948
+ sed -i ' s/*//g' /etc/passwd
949
+
950
+ # In case the locale is not available, install it
951
+ # will ensure we don't fallback to C.UTF-8
952
+ if [ ! -e /usr/share/i18n/charmaps ]; then
953
+ apt-get --reinstall install -y glibc-i18ndata iconv
954
+ fi
955
+ if ! locale -a | grep -qi en_us.utf8 || ! locale -a | grep -qi " ${HOST_LOCALE} " ; then
956
+ LANG=" ${HOST_LOCALE} " localedef -i " ${HOST_LOCALE_LANG} " -f " ${HOST_LOCALE_ENCODING} " " ${HOST_LOCALE} "
957
+ fi
958
+
959
+ # Ensure we have tzdata installed and populated, sometimes container
960
+ # images blank the zoneinfo directory, so we reinstall the package to
961
+ # ensure population
962
+ if [ ! -e /usr/share/zoneinfo/UTC ]; then
963
+ apt-get --reinstall install -y tzdata
964
+ fi
965
+
966
+ # Install additional packages passed at distrbox-create time
967
+ if [ -n " ${container_additional_packages} " ]; then
968
+ # shellcheck disable=SC2086
969
+ apt-get install -y ${container_additional_packages}
970
+ fi
971
+ }
972
+
850
973
# setup_dnf will upgrade or setup all packages for dnf/yum based systems.
851
974
# Arguments:
852
975
# manager: yum or dnf
@@ -1672,7 +1795,11 @@ if [ "${upgrade}" -ne 0 ] ||
1672
1795
if command -v apk; then
1673
1796
setup_apk
1674
1797
elif command -v apt-get; then
1675
- setup_apt
1798
+ if ! grep -q " ID=altlinux" /etc/os-release; then
1799
+ setup_apt
1800
+ else
1801
+ setup_aptrpm
1802
+ fi
1676
1803
elif command -v emerge; then
1677
1804
setup_emerge
1678
1805
elif command -v pacman; then
0 commit comments