Files
Linux/Docs/Ubuntu制作Apt离线包.md
offends 6165fb97a5
All checks were successful
continuous-integration/drone Build is passing
first commit
2025-12-13 17:57:17 +08:00

695 B

本文作者:丁辉

Ubuntu制作Apt离线包

拿 vim 举例

创建离线包

  1. 创建目录

    mkdir /opt/offline-apt-packages
    cd /opt/offline-apt-packages
    
  2. 将Apt离线包下载到本地

    sudo apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances vim | grep "^\w" | sort -u)
    

安装

  • 本地安装

    dpkg -i ./*
    
  • 通过源安装

    echo "deb file:///opt/offline-apt-packages  archives/"| sudo tee /etc/apt/sources.list 
    

    更新源

    apt-get update
    

    安装

    apt install vim