This commit is contained in:
48
Docs/Ubuntu制作Apt离线包.md
Normal file
48
Docs/Ubuntu制作Apt离线包.md
Normal file
@@ -0,0 +1,48 @@
|
||||
> 本文作者:丁辉
|
||||
|
||||
# Ubuntu制作Apt离线包
|
||||
|
||||
> 拿 vim 举例
|
||||
|
||||
## 创建离线包
|
||||
|
||||
1. 创建目录
|
||||
|
||||
```bash
|
||||
mkdir /opt/offline-apt-packages
|
||||
cd /opt/offline-apt-packages
|
||||
```
|
||||
|
||||
2. 将Apt离线包下载到本地
|
||||
|
||||
```bash
|
||||
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)
|
||||
```
|
||||
|
||||
## 安装
|
||||
|
||||
- 本地安装
|
||||
|
||||
```bash
|
||||
dpkg -i ./*
|
||||
```
|
||||
|
||||
- 通过源安装
|
||||
|
||||
```bash
|
||||
echo "deb file:///opt/offline-apt-packages archives/"| sudo tee /etc/apt/sources.list
|
||||
```
|
||||
|
||||
更新源
|
||||
|
||||
```bash
|
||||
apt-get update
|
||||
```
|
||||
|
||||
安装
|
||||
|
||||
```bash
|
||||
apt install vim
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user