1.拉取镜像并运行容器docker pull docker.1ms.run/ubuntu:26.04 Trying to pull docker.1ms.run/ubuntu:26.04... Getting image source signatures Copying blob 6f5c5aa4e145 done Copying blob 1c24335ddd46 done Copying config 30ba44506a done Writing manifest to image destination Storing signatures 30ba44506a6d003153c80023c4474e67d3487e9178df254bde55b19209cc8683 docker run -itd -v /mnt/c/d:/par --networkhost --name redrock411 docker.1ms.run/ubuntu:26.04 7732c1ddfe94ece8db79bf7858143ce66f6a4296db93bc92e430dd5149600e3a登录容器修改apt源更新apt索引rootaaaa:/mnt/c/d# docker exec -it redrock411 bash rootaaaa:/# cd /par rootaaaa:/par# mv /etc/apt/sources.list /etc/apt/sources.list.old rootaaaa:/par# cp /par/sources.list.txt /etc/apt/sources.list rootaaaa:/par# apt update Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease ... Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Fetched 23.4 MB in 8s (2924 kB/s) 2 packages can be upgraded. Run apt list --upgradable to see them. Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list.d/ubuntu.sources:2 ... Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute-updates/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute-backports/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Some index files failed to download. They have been ignored, or old ones used instead. Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list.d/ubuntu.sources:2 ... Notice: Some sources can be modernized. Run apt modernize-sources to do so. rootaaaa:/par# exit rootaaaa:/mnt/c/d# docker stop redrock411 redrock411 rootaaaa:/mnt/c/d# docker rm redrock411 7732c1ddfe94ece8db79bf7858143ce66f6a4296db93bc92e430dd5149600e3a主要是两类报错1 Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InReleaseSSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443]2 Warning: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:10 and /etc/apt/sources.list.d/ubuntu.sources:2在网上查找说是有两种配置文件前者是旧的后者是现代的清华源镜像中也分别有两种的替换内容把第二种的文件改名就没有第二类警告了。rootaaaa:/mnt/c/d# docker run -itd -v /mnt/c/d:/par --networkhost --name redrock411 docker.1ms.run/ubuntu:26.04 f08f5769b1d20cefa004e6773de9f64f791a2272d4a2d3f05b91a642999c8f79 rootaaaa:/mnt/c/d# docker exec -it redrock411 bash rootaaaa:/# ls -l /etc/apt/sources.list -rw-r--r-- 1 root root 270 Apr 21 02:06 /etc/apt/sources.list rootaaaa:/# ls -l /etc/apt/sources.list.d/ubuntu.sources -rw-r--r-- 1 root root 2564 Apr 21 02:06 /etc/apt/sources.list.d/ubuntu.sources rootaaaa:/# mv /etc/apt/sources.list /etc/apt/sources.list.old rootaaaa:/# mv /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.old rootaaaa:/# cp /par/sources.list.txt /etc/apt/sources.list rootaaaa:/# apt update Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease ... Err:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Fetched 262 kB in 8s (34.0 kB/s) 1 package can be upgraded. Run apt list --upgradable to see it. Notice: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute-updates/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/resolute-backports/InRelease SSL connection failed: error:0A000086:SSL routines::certificate verify failed / Success [IP: 101.6.15.130 443] Warning: Some index files failed to download. They have been ignored, or old ones used instead. Notice: Some sources can be modernized. Run apt modernize-sources to do so.第一种说是和ca-certificate apt-transport-https包有关可是在arm64中https是可以用的怎么到了amd64就不行了简单的方法是把配置文件中的https都改为http, 不报错了。rootaaaa:/# apt install ca-certificate apt-transport-https Note, selecting apt instead of apt-transport-https Notice: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Error: Unable to locate package ca-certificate rootaaaa:/# cp /par/sources.list2.txt /etc/apt/sources.list rootaaaa:/# apt update Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease [136 kB] ... Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute-updates/universe amd64 Packages [48.9 kB] Fetched 23.2 MB in 1s (21.8 MB/s) 2 packages can be upgraded. Run apt list --upgradable to see them. Notice: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Notice: Some sources can be modernized. Run apt modernize-sources to do so. rootaaaa:/#安装从redrock网站下载的deb包。wget https://redrock-releases.oss-cn-beijing.aliyuncs.com/v4.1/redrock-4.1-1.linux.x86_64-deb.tar.gz tar xf redrock-4.1-1.linux.x86_64-deb.tar.gz tar: redrock-4.1-1.linux.amd64-deb: Cannot change mode to rwxr-xr-x: Operation not permitted tar: Exiting with failure status due to previous errors rootaaaa:/par# cd redrock-4.1-1.linux.x86_64-deb bash: cd: redrock-4.1-1.linux.x86_64-deb: No such file or directory rootaaaa:/par# cd redrock-4.1-1.linux.amd64-deb rootaaaa:/# cd /par rootaaaa:/par# dpkg -i redrock-libs_4.1-1_amd64.deb dpkg: error: cannot access archive redrock-libs_4.1-1_amd64.deb: No such file or directory rootaaaa:/par# cd redrock-4.1-1.linux.amd64-deb rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# dpkg -i redrock-libs_4.1-1_amd64.deb Selecting previously unselected package redrock-libs:amd64. (Reading database ... 7724 files and directories currently installed.) Preparing to unpack redrock-libs_4.1-1_amd64.deb ... Unpacking redrock-libs:amd64 (4.1-1) ... Setting up redrock-libs:amd64 (4.1-1) ... rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# dpkg -i redrock-client_4.1-1_amd64.deb Selecting previously unselected package redrock-client. (Reading database ... 7818 files and directories currently installed.) Preparing to unpack redrock-client_4.1-1_amd64.deb ... Unpacking redrock-client (4.1-1) ... Setting up redrock-client (4.1-1) ... rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# dpkg -i redrock-server_4.1-1_amd64.deb Selecting previously unselected package redrock-server. (Reading database ... 8204 files and directories currently installed.) Preparing to unpack redrock-server_4.1-1_amd64.deb ... Unpacking redrock-server (4.1-1) ... dpkg: dependency problems prevent configuration of redrock-server: redrock-server depends on locales | locales-all; however: Package locales is not installed. Package locales-all is not installed. redrock-server depends on tzdata; however: Package tzdata is not installed. dpkg: error processing package redrock-server (--install): dependency problems - leaving unconfigured Errors were encountered while processing: redrock-server用apt --fix-broken install命令修复会自动下载安装依赖包rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# apt --fix-broken install Correcting dependencies... Done Installing dependencies: locales tzdata Summary: Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 2 1 not fully installed or removed. Download size: 4417 kB Space needed: 17.6 MB / 113 GB available Notice: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Continue? [Y/n] Y Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute/main amd64 locales all 2.43-2ubuntu2 [4224 kB] Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute/main amd64 tzdata all 2026a-3ubuntu1 [194 kB] Fetched 4417 kB in 0s (16.6 MB/s) debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79, STDIN line 2.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Cant locate Term/ReadLine.pm in INC (you may need to install the Term::ReadLine module) (INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8, STDIN line 2.) debconf: falling back to frontend: Teletype N: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Preconfiguring packages ... Configuring tzdata ------------------ Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located. 1. Africa 3. Antarctica 5. Asia 7. Australia 9. Indian 11. Etc 2. America 4. Arctic 6. Atlantic 8. Europe 10. Pacific Geographic area: 1 Please select the city or region corresponding to your time zone. 1. Abidjan Time zone: 1 Selecting previously unselected package locales. (Reading database ... 8594 files and directories currently installed.) Preparing to unpack .../locales_2.43-2ubuntu2_all.deb ... Unpacking locales (2.43-2ubuntu2) ... Selecting previously unselected package tzdata. Preparing to unpack .../tzdata_2026a-3ubuntu1_all.deb ... Unpacking tzdata (2026a-3ubuntu1) ... Setting up locales (2.43-2ubuntu2) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Cant locate Term/ReadLine.pm in INC (you may need to install the Term::ReadLine module) (INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8.) debconf: falling back to frontend: Teletype Generating locales (this might take a while)... Generation complete. Setting up tzdata (2026a-3ubuntu1) ... debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Cant locate Term/ReadLine.pm in INC (you may need to install the Term::ReadLine module) (INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8.) debconf: falling back to frontend: Teletype Current default time zone: Africa/Abidjan Local time is now: Fri May 15 23:27:43 GMT 2026. Universal Time is now: Fri May 15 23:27:43 UTC 2026. Run dpkg-reconfigure tzdata if you wish to change it. Setting up redrock-server (4.1-1) ... /var/lib/dpkg/info/redrock-server.postinst: 10: adduser: not found dpkg: error processing package redrock-server (--configure): old redrock-server package postinst maintainer script subprocess failed with exit status 127 Errors were encountered while processing: redrock-server Error: Sub-process /usr/bin/dpkg returned an error code (1)又报错缺少adduser命令也需要apt安装同时用dpkg-reconfigure tzdata命令把刚才设错的时区改正过来。rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# dpkg-reconfigure tzdata debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Cant locate Term/ReadLine.pm in INC (you may need to install the Term::ReadLine module) (INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8.) debconf: falling back to frontend: Teletype Configuring tzdata ------------------ Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located. 1. Africa 3. Antarctica 5. Asia 7. Australia 9. Indian 11. Etc 2. America 4. Arctic 6. Atlantic 8. Europe 10. Pacific Geographic area: 5 Please select the city or region corresponding to your time zone. 68. Shanghai Time zone: 68 Current default time zone: Asia/Shanghai Local time is now: Sat May 16 07:28:47 CST 2026. Universal Time is now: Fri May 15 23:28:47 UTC 2026. rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# adduser bash: adduser: command not found rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# useradd Usage: useradd [options] LOGIN useradd -D useradd -D [options] rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# apt install adduser Installing: adduser Suggested packages: liblocale-gettext-perl perl cron quota ecryptfs-utils Summary: Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 2 1 not fully installed or removed. Download size: 194 kB Space needed: 447 kB / 113 GB available Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute/main amd64 adduser all 3.153ubuntu1 [194 kB] Fetched 194 kB in 0s (1146 kB/s) debconf: unable to initialize frontend: Dialog debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 79, STDIN line 1.) debconf: falling back to frontend: Readline debconf: unable to initialize frontend: Readline debconf: (Cant locate Term/ReadLine.pm in INC (you may need to install the Term::ReadLine module) (INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.40.1 /usr/local/share/perl/5.40.1 /usr/lib/x86_64-linux-gnu/perl5/5.40 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.40 /usr/share/perl/5.40 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8, STDIN line 1.) debconf: falling back to frontend: Teletype N: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension Selecting previously unselected package adduser. (Reading database ... 9741 files and directories currently installed.) Preparing to unpack .../adduser_3.153ubuntu1_all.deb ... Unpacking adduser (3.153ubuntu1) ... Setting up adduser (3.153ubuntu1) ... Setting up redrock-server (4.1-1) ... Notice: Ignoring file ubuntu.sources.old in directory /etc/apt/sources.list.d/ as it has an invalid filename extension安装包设置成功了systemctl命令不存在需要进入bin目录初始化数据库启动数据库才能连接需要设置动态库搜索路径。rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# ls -l /usr/pgsql* total 16 drwxr-xr-x 2 root root 4096 May 16 07:25 bin drwxr-xr-x 3 root root 4096 May 16 07:25 doc drwxr-xr-x 3 root root 4096 May 16 07:25 lib drwxr-xr-x 7 root root 4096 May 16 07:25 share rootaaaa:/par/redrock-4.1-1.linux.amd64-deb# cd /usr/pgsql*/bin rootaaaa:/usr/pgsql-18/bin# ./postgresql-setup initdb Initializing database ... OK rootaaaa:/usr/pgsql-18/bin# systemctl start postgresql.service bash: systemctl: command not found rootaaaa:/usr/pgsql-18/bin# su - postgres postgresaaaa:~$ psql -bash: psql: command not found postgresaaaa:~$ cd /usr/pgsql* postgresaaaa:/usr/pgsql-18$ bin/psql bin/psql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory postgresaaaa:/usr/pgsql-18$ postgresaaaa:/usr/pgsql-18$ export LD_LIBRARY_PATH/usr/pgsql-18/lib postgresaaaa:/usr/pgsql-18$ bin/psql psql: error: connection to server on socket /tmp/.s.PGSQL.5432 failed: No such file or directory Is the server running locally and accepting connections on that socket? postgresaaaa:/usr/pgsql-18$ bin/pg_ctl -D /var/lib/pgsql/18/data start waiting for server to start....2026-05-16 08:14:37.314 CST [954] LOG: starting PostgreSQL 18.4 - redrock 4.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18deb9u1) 6.3.0 20170516, 64-bit 2026-05-16 08:14:37.315 CST [954] LOG: listening on IPv4 address 127.0.0.1, port 5432 2026-05-16 08:14:37.319 CST [954] LOG: listening on Unix socket /tmp/.s.PGSQL.5432 2026-05-16 08:14:37.331 CST [960] LOG: database system was shut down at 2026-05-16 07:42:38 CST 2026-05-16 08:14:37.345 CST [954] LOG: database system is ready to accept connections done server started postgresaaaa:/usr/pgsql-18$ bin/psql psql (18.4 - redrock 4.1) Type help for help. postgres#安装本身不难主要是基础的ubuntu镜像缺少内容修补起来很麻烦。附录adduser和useradd的区别 在Linux系统中添加用户可以使用adduser和useradd这两个命令。虽然它们都能实现添加用户的功能但在使用方式和细节上有一些显著的区别。 adduser命令 adduser是一个Perl脚本通过交互式菜单设定一些用户参数。使用adduser命令时它会自动执行以下操作 创建用户组adduser会自动为新用户创建一个用户组。 创建用户目录adduser会自动创建用户的主目录并复制/etc/skel目录下的文件到用户目录中。 选择Shell版本adduser会自动为用户选择一个默认的Shell。 提示设置用户密码adduser会提示用户输入密码并进行确认。 用户可以直接登录使用adduser创建的用户可以立即登录系统因为已经设置了密码等必要信息。 示例 sudo adduser username 执行上述命令后会进入交互式菜单提示输入密码和其他用户信息。 useradd命令 useradd是一个底层命令功能更为基础和灵活。使用useradd命令时如果不带任何选项创建的用户将没有密码、没有主目录、没有指定的Shell。为了使用户能够正常使用还需要进行额外的配置。 不自动创建用户组需要手动指定参数来创建用户组。 不自动创建用户目录需要手动指定参数来创建用户目录。 不自动选择Shell版本需要手动指定Shell。 不提示设置用户密码需要手动设置密码。 用户不能直接登录需要配置密码和其他信息后才能登录。 示例 sudo useradd -m -s /bin/bash username sudo passwd username 上述命令中-m选项用于创建用户的主目录-s选项用于指定用户的Shellpasswd命令用于设置用户密码。 总结 对于初学者或希望简化操作的用户建议使用adduser命令因为它通过交互式菜单自动完成了大部分配置。而对于有经验的用户或需要更灵活控制的场景可以使用useradd命令并手动配置所需的选项。