我在 Ubuntu 10.04 上运行,并在目录中安装了 8.04 版本 /stuff/hardy
sudo debootstrap --variant buildd --arch i386 hardy /stuff/hardy http://archive.ubuntu.com/ubuntu
我想要做的是获得一个与我的 linux 机器隔离的工作环境(不安装到另一个分区)。
我的问题是,当我 chroot 进入它 ( sudo chroot /stuff/hardy) 时,我注意到我没有/proc任何网络配置或没有网络配置。另外,如果我尝试返回我的主目录(在 hardy 中,而不是 10.4),
hardy# cd
我得到一个
/home/myuser No such file or directory
有没有一种(希望很简单)的方法来安装 ubuntudebootstrap而不需要做很多额外的工作?
提前致谢
当我尝试解决与日志相关的问题bootstrap.log时,我遇到了目录中存在一个名为的文件,并且在查看其内容时,我发现时间戳已经超过一年了。/var/log
它似乎由很多 FTP 链接、dpkg 警告组成,例如“忽略预依赖问题!” 以及有关解压 .deb-packages 的信息,这似乎指向安装相关数据。
要查看是否与安装日期存在关系,我执行了以下操作:
$ ls -lt /var/log/installer
total 752
-rw-r--r-- 1 root root 387038 dec 17 2022 initial-status.gz
-rw------- 1 root root 277005 dec 17 2022 syslog
-rw------- 1 root root 1509 dec 17 2022 casper.log
-rw-r--r-- 1 root root 64 dec 17 2022 media-info
-rw------- 1 root root 91778 dec 17 2022 debug
Run Code Online (Sandbox Code Playgroud)
据此我得出结论,安装是在 2022 年 12 月 17 日进行的。
bootstrap.log 中的时间戳条目均以 2022-08-09 开头,因此这将是在安装之前。
我在 bootstrap.log 上搜索了信息,但找不到有关该主题的启发性信息。
这让我想知道它的用途到底是什么bootstrap.log …
我想从一个目录(其中包含一个基于 debootstrap 的安装)启动一个测试 Ubuntu 版本。
据我所知,我只需要某种方式告诉引导过程(initrd 脚本?)它应该在挂载根分区后立即将 chroot() 放入指定的目录,然后恢复常规的 upstart/init 启动。
有人可以提供一些有关如何实现这一目标的说明吗?
我debootstrap是这样跑的:
sudo debootstrap --verbose --arch=amd64 zesty chroot
Run Code Online (Sandbox Code Playgroud)
我已经安装了apt-cacher-ng。
如何让它们一起工作,以便在我多次运行 debootstrap 时使用缓存而不是重复下载相同的包?
我曾尝试使用 MIRROR 选项并设置 http_proxy 变量,但是当我离线运行时它会出错:
$ sudo http_proxy="http://localhost:3142" debootstrap --verbose --arch=amd64 zesty chroot http://localhost:3142/uburep
I: Retrieving InRelease
I: Failed to retrieve InRelease
I: Retrieving Release
E: Failed getting release file http://localhost:3142/uburep/dists/zesty/Release
Run Code Online (Sandbox Code Playgroud)
我使用,http://localhost:3142/uburep因为这是我在缓存中找到的内容:
$ find /var/cache/apt-cacher-ng -name Release
/var/cache/apt-cacher-ng/security.ubuntu.com/ubuntu/dists/zesty-security/Release
/var/cache/apt-cacher-ng/uburep/dists/zesty-updates/Release
/var/cache/apt-cacher-ng/uburep/dists/zesty-backports/Release
/var/cache/apt-cacher-ng/uburep/dists/zesty/Release
Run Code Online (Sandbox Code Playgroud)
我尝试添加 Defaults env_keep += "http_proxy https_proxy ftp_proxy"到 /etc/sudoers(通过 sudo visudo),但也无济于事。
如果我删除 MIRROR 选项并离线运行 debootstrap,那么它似乎根本不使用 apt-cacher-ng(注意它是如何不再寻找 localhost 的)。
E: Failed getting release …Run Code Online (Sandbox Code Playgroud) 目前我在工作中一直使用 Archlinux 系统。不过,我希望能够在这台机器上为 Ubuntu 打包一些软件。所以我认为应该可以在我的 Archlinux 机器上的 chroot 环境中设置 Ubuntu(Precise)系统。当然,我不会在 chroot 中安装 X11,但我也不需要它。
关于如何在我的机器上的 chroot 环境中安装 Ubuntu 有什么想法吗?