当前位置: 首页 > news >正文

debian12.9或ubuntu,vagrant离线安装插件vagrant-libvirt

系统盘:

https://mirror.lzu.edu.cn/debian-cd/12.9.0/amd64/iso-dvd/debian-12.9.0-amd64-DVD-1.iso

需要的依赖包,无需安装ruby( sudo apt install -y ruby-full ruby-dev rubygems ) :

apt install -y iptabes;
apt install -y curl;root@debian129:~# dpkg -l iptables
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================================
ii  iptables       1.8.9-2      amd64        administration tools for packet filtering and NAT
root@debian129:~# root@debian129:~# dpkg -l curl    
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version            Architecture Description
+++-==============-==================-============-=======================================================
ii  curl           7.88.1-10+deb12u12 amd64        command line tool for transferring data with URL syntax
root@debian129:~# apt  install --print-uris -y  libvirt-daemon-system libvirt-clients qemu-kvm libvirt-dev  virtinst  | tee ~/bbb.log;
grep -oE "'https?://[^ ]+" /root/bbb.log  > /download_urls_filtered_virt.txt
cd /tmp&&(
cat /download_urls_filtered_virt.txt | xargs -I {} sh -c 'wget  -4 --no-check-certificate    {}  && echo 0.1'
)dpkg -i *.deb;wget https://releases.hashicorp.com/vagrant/2.4.5/vagrant_2.4.5-1_amd64.deb&&dpkg -i vagrant_2.4.5-1_amd64.deb;apt  install --print-uris -y   build-essential patch  zlib1g-dev liblzma-dev  libxml2-dev libxslt-dev   | tee ~/bbb2.log;
grep -oE "'https?://[^ ]+" /root/bbb2.log  > /download_urls_filtered_build-essential.txt
cd /tmp&&(
ls -la;
cat /download_urls_filtered_build-essential.txt | xargs -I {} sh -c 'wget  -4 --no-check-certificate    {}  && echo 0.1'
)dpkg -i *.deb;apt  install --print-uris -y  clang  | tee ~/bbb3.log;
grep -oE "'https?://[^ ]+" /root/bbb3.log  > /download_urls_filtered_clang.txt
cd /tmp&&(
ls -la;
cat /download_urls_filtered_clang.txt | xargs -I {} sh -c 'wget  -4 --no-check-certificate    {}  && echo 0.1'
)dpkg -i *.deb;

root@debian129:~# dpkg -l build-essential patch  zlib1g-dev liblzma-dev  libxml2-dev libxslt-dev  iptables curl clang gcc make ruby libvirt-daemon-system libvirt-clients qemu-kvm libvirt-dev  virtinst vagrant
dpkg-query: no packages found matching ruby
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                  Version                 Architecture Description
+++-=====================-=======================-============-=========================================================================
ii  build-essential       12.9                    amd64        Informational list of build-essential packages
ii  clang                 1:14.0-55.7~deb12u1     amd64        C, C++ and Objective-C compiler (LLVM based), clang binary
ii  curl                  7.88.1-10+deb12u12      amd64        command line tool for transferring data with URL syntax
ii  gcc                   4:12.2.0-3              amd64        GNU C compiler
ii  iptables              1.8.9-2                 amd64        administration tools for packet filtering and NAT
ii  liblzma-dev:amd64     5.4.1-1                 amd64        XZ-format compression library - development files
ii  libvirt-clients       9.0.0-4+deb12u2         amd64        Programs for the libvirt library
ii  libvirt-daemon-system 9.0.0-4+deb12u2         amd64        Libvirt daemon configuration files
ii  libvirt-dev:amd64     9.0.0-4+deb12u2         amd64        development files for the libvirt library
ii  libxml2-dev:amd64     2.9.14+dfsg-1.3~deb12u1 amd64        GNOME XML library - development files
un  libxslt-dev           <none>                  <none>       (no description available)
ii  make                  4.3-4.1                 amd64        utility for directing compilation
ii  patch                 2.7.6-7                 amd64        Apply a diff file to an original
un  qemu-kvm              <none>                  <none>       (no description available)
ii  vagrant               2.4.5-1                 amd64        Vagrant is a tool for building and distributing development environments.
ii  virtinst              1:4.1.0-2               all          utilities to create and edit virtual machines
ii  zlib1g-dev:amd64      1:1.2.13.dfsg-1         amd64        compression library - development
root@debian129:~# 
root@xx:~# curl -4kLO https://rubygems.org/gems/vagrant-libvirt-0.12.2.gem% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed
100  133k  100  133k    0     0  1861k      0 --:--:-- --:--:-- --:--:-- 1873k
root@xx:~# ls -al *.gem
-rw-r--r-- 1 root root 136192 Jun  1 14:48 vagrant-libvirt-0.12.2.gem
root@xx:~# md5sum vagrant-libvirt-0.12.2.gem 
62114243fcced1be21349735aaa0c791  vagrant-libvirt-0.12.2.gem
root@xx:~# 
mkdir -p /root/ppp;
cd /root/ppp;export PATH="/opt/vagrant/embedded/bin:$PATH" ;
export http_proxy="http://192.168.111.1:12334" ;
export https_proxy=$http_proxy ; 
gem fetch  --verbose vagrant-libvirt;root@debian129:~/ppp# gem fetch  --verbose vagrant-libvirt
Fetching vagrant-libvirt-0.12.2.gem
Downloaded vagrant-libvirt-0.12.2
root@debian129:~/ppp# ls -al 
total 152
drwxr-xr-x  2 root root   4096 Jun  1 22:56 .
drwx------ 16 root root  12288 Jun  1 22:55 ..
-rw-r--r--  1 root root 136192 Jun  1 22:56 vagrant-libvirt-0.12.2.gem
root@debian129:~/ppp# gem install --verbose ./vagrant-libvirt-0.12.2.gem  2>&1 | tee -a ~/vvruby.log   ;
#联网下载,国内需要走http代理grep -oE "https?://[^ ]+" /root/vvruby.log | grep -E "\.gem" | grep -v -E "\.rz" | awk '{printf "%02d-%s\n", NR, $0}' > /root/urls_with_numbers.txtroot@debian129:~/ppp# cat ~/urls_with_numbers.txt 
01-https://index.rubygems.org/gems/nokogiri-1.18.8-x86_64-linux-gnu.gem
02-https://index.rubygems.org/gems/diffy-3.4.3.gem
03-https://index.rubygems.org/gems/xml-simple-1.1.9.gem
04-https://index.rubygems.org/gems/mime-types-data-3.2025.0527.gem
05-https://index.rubygems.org/gems/mime-types-3.7.0.gem
06-https://index.rubygems.org/gems/formatador-1.1.0.gem
07-https://index.rubygems.org/gems/excon-1.2.7.gem
08-https://index.rubygems.org/gems/builder-3.3.0.gem
09-https://index.rubygems.org/gems/fog-core-2.6.0.gem
10-https://index.rubygems.org/gems/ruby-libvirt-0.8.4.gem
11-https://index.rubygems.org/gems/fog-xml-0.1.5.gem
12-https://index.rubygems.org/gems/multi_json-1.15.0.gem
13-https://index.rubygems.org/gems/fog-json-1.2.0.gem
14-https://index.rubygems.org/gems/fog-libvirt-0.13.2.gem
root@debian129:~/ppp# while IFS= read -r line; donumber=$(echo "$line" | cut -d'-' -f1)url=$(echo "$line" | cut -d'-' -f2-)filename="$number-$(basename "$url")"wget -O "/root/ppp/$filename" "$url"
done < /root/urls_with_numbers.txtcd  /opt/vagrant/embedded/lib/ruby/gems/3.3.0/cache/;ls -al ;
cp ./racc-1.7.3.gem /root/ppp/ ;ls -al  -ltr --time-style=full-iso /opt/vagrant/embedded/gems/cache/;gem  list | grep libvirt;
gem generate_index  --verbose  ;root@debian129:~/ppp# gem  list | grep libvirt;
fog-libvirt (0.13.2)
ruby-libvirt (0.8.4)
vagrant-libvirt (0.12.2)
root@debian129:~/ppp# root@debian129:~/ppp# gem generate_index  --verbose  ;
Fetching rubygems-generate_index-1.1.3.gem
Fetching compact_index-0.15.0.gem
Generating Marshal quick index gemspecs for 0 gems
Complete
Generated Marshal quick index gemspecs: 0.000s
Generating specs index
Generated specs index: 0.000s
Generating latest specs index
Generated latest specs index: 0.000s
Generating prerelease specs index
Generated prerelease specs index: 0.000s
Generating compact index files for 0 gems
1/2: /names
2/2: /versions
Complete
Generated compact index files: 0.000s
Compressing indices
Compressed indices: 0.000s
Moving index into production dir .
mkdir -p ./quick
rm -rf ./quick/Marshal.4.8
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/quick/Marshal.4.8 ./quick/Marshal.4.8
rm -rf ./specs.4.8
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/specs.4.8 .
rm -rf ./specs.4.8.gz
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/specs.4.8.gz .
rm -rf ./latest_specs.4.8
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/latest_specs.4.8 .
rm -rf ./latest_specs.4.8.gz
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/latest_specs.4.8.gz .
rm -rf ./prerelease_specs.4.8
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/prerelease_specs.4.8 .
rm -rf ./prerelease_specs.4.8.gz
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/prerelease_specs.4.8.gz .
rm -rf ./info
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/info .
rm -rf ./names
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/names .
rm -rf ./versions
mv -f /tmp/gem_generate_index20250601-1555-6y67ma/versions .
root@debian129:~/ppp# tar -czf /root/gem.tar.gz .root@debian129:~# tar -tvf  /root/gem.tar.gz
drwxr-xr-x root/root         0 2025-06-01 21:10 ./
drwxr-xr-x root/root         0 2025-06-01 21:10 ./info/
-rw-r--r-- root/root    102912 2025-06-01 20:49 ./10-ruby-libvirt-0.8.4.gem
-rw-r--r-- root/root     12288 2025-06-01 20:49 ./05-xml-simple-1.1.9.gem
-rw-r--r-- root/root    168960 2025-06-01 20:49 ./01-mime-types-data-3.2025.0527.gem
-rw-r--r-- root/root        24 2025-06-01 21:10 ./prerelease_specs.4.8.gz
-rw-r--r-- root/root    171008 2025-06-01 20:49 ./07-excon-1.2.7.gem
-rw-r--r-- root/root     17920 2025-06-01 20:49 ./04-diffy-3.4.3.gem
-rw-r--r-- root/root     13824 2025-06-01 20:49 ./06-formatador-1.1.0.gem
-rw-r--r-- root/root         5 2025-06-01 21:10 ./names
-rw-r--r-- root/root        24 2025-06-01 21:10 ./latest_specs.4.8.gz
-rw-r--r-- root/root     11264 2025-06-01 20:49 ./11-fog-xml-0.1.5.gem
-rw-r--r-- root/root         4 2025-06-01 21:10 ./prerelease_specs.4.8
-rw-r--r-- root/root        42 2025-06-01 21:10 ./versions
-rw-r--r-- root/root         4 2025-06-01 21:10 ./specs.4.8
-rw-r--r-- root/root     31744 2025-06-01 20:49 ./14-fog-libvirt-0.13.2.gem
-rw-r--r-- root/root      8704 2025-06-01 20:49 ./13-fog-json-1.2.0.gem
-rw-r--r-- root/root        24 2025-06-01 21:10 ./specs.4.8.gz
-rw-r--r-- root/root     30208 2025-06-01 20:49 ./08-builder-3.3.0.gem
-rw-r--r-- root/root     22016 2025-06-01 20:49 ./12-multi_json-1.15.0.gem
-rw-r--r-- root/root     41984 2025-06-01 20:49 ./02-mime-types-3.7.0.gem
-rw-r--r-- root/root   4073472 2025-06-01 20:49 ./03-nokogiri-1.18.8-x86_64-linux-gnu.gem
-rw-r--r-- root/root     64000 2025-06-01 21:10 ./racc-1.7.3.gem
drwxr-xr-x root/root         0 2025-06-01 21:10 ./quick/
drwxr-xr-x root/root         0 2025-06-01 21:10 ./quick/Marshal.4.8/
-rw-r--r-- root/root     47104 2025-06-01 20:49 ./09-fog-core-2.6.0.gem
-rw-r--r-- root/root         4 2025-06-01 21:10 ./latest_specs.4.8
-rw-r--r-- root/root    136192 2025-06-01 20:49 ./vagrant-libvirt-0.12.2.gem
-rw-r--r-- root/root    136192 2025-06-01 20:49 ./15-vagrant-libvirt-0.12.2.gem
root@debian129:~# 


root@debian129:~# ls -al  -ltr --time-style=full-iso  /opt/vagrant/embedded/lib/ruby/gems/3.3.0/cache
total 6768
-rw-r--r-- 1 root root   75264 2025-04-09 17:23:04.000000000 +0800 typeprof-0.21.9.gem
-rw-r--r-- 1 root root   94208 2025-04-09 17:23:04.000000000 +0800 test-unit-3.6.1.gem
-rw-r--r-- 1 root root   53248 2025-04-09 17:23:04.000000000 +0800 rss-0.3.1.gem
-rw-r--r-- 1 root root  104448 2025-04-09 17:23:04.000000000 +0800 rexml-3.3.9.gem
-rw-r--r-- 1 root root 1043968 2025-04-09 17:23:04.000000000 +0800 rbs-3.4.0.gem
-rw-r--r-- 1 root root   84992 2025-04-09 17:23:04.000000000 +0800 rake-13.1.0.gem
-rw-r--r-- 1 root root   64000 2025-04-09 17:23:04.000000000 +0800 racc-1.7.3.gem
-rw-r--r-- 1 root root   11264 2025-04-09 17:23:04.000000000 +0800 prime-0.1.2.gem
-rw-r--r-- 1 root root   15360 2025-04-09 17:23:04.000000000 +0800 power_assert-2.0.3.gem
-rw-r--r-- 1 root root   17408 2025-04-09 17:23:04.000000000 +0800 net-smtp-0.5.1.gem
-rw-r--r-- 1 root root   14336 2025-04-09 17:23:04.000000000 +0800 net-pop-0.1.2.gem
-rw-r--r-- 1 root root  155136 2025-04-09 17:23:04.000000000 +0800 net-imap-0.4.19.gem
-rw-r--r-- 1 root root   17920 2025-04-09 17:23:04.000000000 +0800 net-ftp-0.3.4.gem
-rw-r--r-- 1 root root   95744 2025-04-09 17:23:04.000000000 +0800 minitest-5.20.0.gem
-rw-r--r-- 1 root root   27136 2025-04-09 17:23:04.000000000 +0800 matrix-0.4.2.gem
-rw-r--r-- 1 root root   99328 2025-04-09 17:23:04.000000000 +0800 debug-1.9.2.gem
drwxr-xr-x 9 root root    4096 2025-05-31 23:16:31.900803083 +0800 ..
-rw-r--r-- 1 root root  168960 2025-05-31 23:24:33.768609905 +0800 mime-types-data-3.2025.0527.gem
-rw-r--r-- 1 root root   41984 2025-05-31 23:24:34.820743161 +0800 mime-types-3.7.0.gem
-rw-r--r-- 1 root root 4073472 2025-05-31 23:24:37.865130974 +0800 nokogiri-1.18.8-x86_64-linux-gnu.gem
-rw-r--r-- 1 root root   17920 2025-05-31 23:24:38.381197052 +0800 diffy-3.4.3.gem
-rw-r--r-- 1 root root   12288 2025-05-31 23:24:38.957270868 +0800 xml-simple-1.1.9.gem
-rw-r--r-- 1 root root   13824 2025-05-31 23:24:39.417329960 +0800 formatador-1.1.0.gem
-rw-r--r-- 1 root root  171008 2025-05-31 23:24:40.273440033 +0800 excon-1.2.7.gem
-rw-r--r-- 1 root root   30208 2025-05-31 23:24:41.101546728 +0800 builder-3.3.0.gem
-rw-r--r-- 1 root root   47104 2025-05-31 23:24:43.941914419 +0800 fog-core-2.6.0.gem
-rw-r--r-- 1 root root  102912 2025-05-31 23:24:44.585998178 +0800 ruby-libvirt-0.8.4.gem
-rw-r--r-- 1 root root   11264 2025-05-31 23:24:44.826029400 +0800 fog-xml-0.1.5.gem
-rw-r--r-- 1 root root   22016 2025-05-31 23:24:45.406104976 +0800 multi_json-1.15.0.gem
-rw-r--r-- 1 root root    8704 2025-05-31 23:24:45.630134186 +0800 fog-json-1.2.0.gem
-rw-r--r-- 1 root root   31744 2025-05-31 23:24:45.950175913 +0800 fog-libvirt-0.13.2.gem
-rw-r--r-- 1 root root  136192 2025-05-31 23:24:52.223000364 +0800 vagrant-libvirt-0.12.2.gem
drwxr-xr-x 2 root root    4096 2025-05-31 23:24:52.223000364 +0800 .
root@debian129:~# 

tar -xf gem.tar.gz  -C /root/CHECKPOINT_DISABLE=1 vagrant plugin install  --debug  vagrant-libvirt  --plugin-clean-sources  --plugin-source file:///root/CHECKPOINT_DISABLE=1 vagrant plugin list --debug

root@debian129:~# cat ~/.vagrant.d/plugins.json
{"version":"1","installed":{"vagrant-libvirt":{"ruby_version":"3.3.8","vagrant_version":"2.4.5","gem_version":"","require":"","sources":["file:///root/"],"installed_gem_version":"0.12.2","env_local":false}}}root@debian129:~#

root@debian129:~# sudo systemctl status libvirtd
* libvirtd.service - Virtualization daemonLoaded: loaded (/lib/systemd/system/libvirtd.service; enabled; preset: enabled)Active: inactive (dead) since Sun 2025-06-01 21:22:13 CST; 1h 3min agoDuration: 2min 104ms
TriggeredBy: * libvirtd-ro.socket* libvirtd-admin.socket* libvirtd.socketDocs: man:libvirtd(8)https://libvirt.orgMain PID: 2570 (code=exited, status=0/SUCCESS)CPU: 182msJun 01 21:20:13 debian129 systemd[1]: Starting libvirtd.service - Virtualization daemon...
Jun 01 21:20:13 debian129 systemd[1]: Started libvirtd.service - Virtualization daemon.
Jun 01 21:20:13 debian129 libvirtd[2570]: libvirt version: 9.0.0, package: 9.0.0-4+deb12u2 (Debian)
Jun 01 21:20:13 debian129 libvirtd[2570]: hostname: debian129
Jun 01 21:20:13 debian129 libvirtd[2570]: <E6><97><A0><E6><B3><95><E6><89><93><E5><BC><80> tty /dev/kvm: <E6><B2><A1><E6><9C><89><E9><82><A3><E4><B8><AA><E6><96><87><E4><BB><B6><E6><88><96><E7><E5><BD><95>
Jun 01 21:22:13 debian129 systemd[1]: libvirtd.service: Deactivated successfully.
root@debian129:~# 

相关文章:

  • PHP与MYSQL结合中中的一些常用函数,HTTP协议定义,PHP进行文件编程,会话技术
  • Android第十二次面试-多线程和字符串算法总结
  • 健康检查:在 .NET 微服务模板中优雅配置 Health Checks
  • 基于微信小程序的云校园信息服务平台设计与实现(源码+定制+开发)云端校园服务系统开发 面向师生的校园事务小程序设计与实现 融合微信生态的智慧校园管理系统开发
  • python集成inotify-rsync实现跨服务器文件同步
  • Java对象的内存结构
  • Git仓库大文件清理指南
  • C++测开,自动化测试,业务(第一段实习)
  • 【PyQt5】PyQt5初探 - 一个简单的例程
  • 数据结构-排序-排序的七种算法(2)
  • Google Android 14设备和应用通知 受限制的设置 出于安全考虑......
  • Office办公文档软件安装包2024版
  • Java复习Day25
  • 性能优化 - 案例篇:缓冲区
  • Vue-1-前端框架Vue基础入门之一
  • Redis 缓存穿透、缓存击穿、缓存雪崩详解与解决方案
  • c++学习值---模版
  • Java设计模式详解:策略模式(Strategy Pattern)
  • [蓝桥杯]缩位求和
  • Odoo 中SCSS的使用指南
  • 有个网站是做视频相册的/快速排名软件seo系统
  • 怎样把网站做的漂亮/长沙网站制作关键词推广
  • dedecms做多语言的网站/seo外链推广员
  • 3一6年级科技小制作手工/网店seo是什么意思
  • 自适应网站wordpress/网站推广论坛
  • 深圳企业模板建站/关键词优化推广公司排名