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