在 Linux 上测试安装脚本
我正在编写一个 Bash 脚本,为使用 Ubuntu 的用户设置 Drupal 开发环境。为了测试这一点,我在 VirtualBox 中安装了新的 Ubuntu 副本,并且不断使用快照每次运行脚本后恢复我的全新安装的功能。
然而,目前我的脚本正在重新下载每次运行脚本时需要安装的所有软件包。有没有办法让 apt-get 从本地存储安装这些软件包?
也许下载它们,但不立即安装它们。然后拍摄快照,然后使用 apt-get 来使用已下载的本地包。
我该怎么做呢?是否有一些 apt-get 魔法可以解决这个问题?
I'm writing a Bash script that sets up a Drupal development environment for people using Ubuntu. To test this out I've installed a fresh copy of Ubuntu in VirtualBox and am constantly using the snapshot feature to get back my fresh install after every run of the script.
Currently however my script is re-downloading all the packages that need to be installed every time I run the script. Is there a way I can get apt-get
to install these packages from local storage?
Perhaps downloading them, but not installing them at once. Taking a snapshot then, and then usage of apt-get
that will use the local packages that were downloaded.
How would I go about doing this? Is there perhaps some apt-get
magic that will do the trick?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
apt-get --download-only install 应该可以解决问题。
然后制作快照,然后再次运行 apt-get install 而不使用 --download-only。
apt-get --download-only install
should do the trick.Then make the snapshot, then run
apt-get install
again without --download-only.