打赏

apt下载离线安装包

apt下载离线安装包

1.查看依赖

apt-cache depend <package name>

2.下载依赖包

apt-get install dependpackname –reinstall -d xxx


#有些包名中有<>符号,用tr将其删除
sudo apt-get install --reinstall -d `apt-cache depends packname | grep depends | cut -d: f2 |tr -d "<>"`

# 递归下载所有 deb 依赖 (目前极少用到 32 位架构 过滤掉 i386 )
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends python-setuptools | grep -v i386 | grep "^\w")	

3.离线安装

dpkg -i <package name>
或者
apt install -f ./${deb}
  1. 常用命令
安装命令:
		dpkg -i xxx.deb     --->i(install)
		
	卸载命令:
		dpkg -r xxx
		
	查看安装的软件
		dpkg -l
  1. 安装包国内搜索下载地址

    https://developer.aliyun.com/packageSearch?word=cpp

相关链接

https://www.cnblogs.com/faster/p/13887759.html

https://blog.biofan.org/2020/04/apt-download/

https://www.cxyzjd.com/article/sinat_36219858/114951318

posted @ 2021-08-17 19:54  苍山落暮  阅读(10106)  评论(0编辑  收藏  举报