ubuntu系统只下载某个软件包而不安装的命令,单独*.deb安装包安装命令

1.ubuntu系统下载某个软件包而不安装

#下载软件包到当前shell运行的目录里,只有一个xxx包
sudo apt download xxx
sudo apt download kubelet=1.18.20-00 kubeadm=1.18.20-00 kubectl=1.18.20-00
root@k8s-master:/home/mqq# sudo apt download kubelet=1.18.20-00 kubeadm=1.18.20-00 kubectl=1.18.20-00
root@k8s-master:/home/mqq# ls
Desktop    Downloads                     kubectl_1.18.20-00_amd64.deb  Music     Public  Templates
Documents  kubeadm_1.18.20-00_amd64.deb  kubelet_1.18.20-00_amd64.deb  Pictures  snap    Videos
root@k8s-master:/home/mqq# 看到3个包已经下载了
apt download  -d  lrzsz  #只下载不安装,下载后的路径在/var/cache/apt/archives
root@k8s-master:/var/cache/apt/archives# ls
root@k8s-master:/var/cache/apt/archives# pwd
/var/cache/apt/archives
root@k8s-master:/var/cache/apt/archives# apt  download -d   lrzsz
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu kinetic/universe amd64 lrzsz amd64 0.12.21-10 [74.8 kB]
Fetched 74.8 kB in 1s (74.2 kB/s)
W: Download is performed unsandboxed as root as file '/var/cache/apt/archives/lrzsz_0.12.21-10_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
root@k8s-master:/var/cache/apt/archives# ls
lrzsz_0.12.21-10_amd64.deb
root@k8s-master:/var/cache/apt/archives# 

2. *.deb安装包安装命令

root@k8s-master:/var/cache/apt/archives# sudo dpkg -i lrzsz_0.12.21-10_amd64.deb
(Reading database ... 203366 files and directories currently installed.)
Preparing to unpack lrzsz_0.12.21-10_amd64.deb ...
Unpacking lrzsz (0.12.21-10) over (0.12.21-10) ...
Setting up lrzsz (0.12.21-10) ...
Processing triggers for man-db (2.10.2-2) ...
root@k8s-master:/var/cache/apt/archives# 

你可能感兴趣的:(linux,各种问题汇总,ubuntu,linux,运维)