debian 环境安装
debian使用apt簇命令是,会与dpkg联动进行软件安装,dpkg
是安装 Debian 已经可用软件包的工具 (因为不需下载任何东西)。我们使用它的 -i
或 --install
选项
dpkg
是系统上处理 Debian 软件包的基础指令。如果有 .deb
软件包,那么可以用 dpkg
来安装或分析其内容。但此指令只能看到 Debian 世界的部分内容:它知道系统安装了那些软件包,以及命令行给出了什么,但不知道其它还有哪些可用的软件包。这样,如果没有相依性就会失败。如 apt
和 aptitude
这样的工具,相反会可产生相依性清单,来尽量自动地安装软件包。
使用dpkg进行安装时需要下载软件包在/var/cache/[pakgename]下,后缀名为.deb文件。
然后使用dpkg -i 进行安装
dpkg -i man-db_2.9.4-2_amd64.deb (Reading database ... 227466 files and directories currently installed.) Preparing to unpack man-db_2.9.4-2_amd64.deb ... Unpacking man-db (2.9.4-2) over (2.8.5-2) ... Setting up man-db (2.9.4-2) ... Updating database of manual pages ... man-db.service is a disabled or a static unit not running, not starting it. Processing triggers for mailcap (3.69) ...
若,之前单独使用dpkg进行安装软件后,再使用apt-get命令安装依赖,会出现依赖信息报错,报错不影响,软件已安装完成,该抱错时告知软件安装包之间依赖异常;异常告警信息来源与oracle-java11-installer-local.postinst文件,可根据告警信息查询
root@prentest:~# sudo apt install -y git Reading package lists... Done Building dependency tree... Done Reading state information... Done git is already the newest version (1:2.39.2-1.1). 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up oracle-java11-installer-local (11.0.18-1~linuxuprising0) ... Before installing this package, please download the Oracle JDK 11 .tar.gz file with the same version as this package (version 11.0.4), and place it in /var/cache/oracle-jdk11-installer-local, E.g.: sudo mkdir -p /var/cache/oracle-jdk11-installer-local sudo cp jdk-11.0.4_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/ sha256sum mismatch jdk-11.0.18_linux-x64_bin.tar.gz Oracle JDK 11 is NOT installed. dpkg: error processing package oracle-java11-installer-local (--configure): installed oracle-java11-installer-local package post-installation script subprocess returned error exit status 1 Errors were encountered while processing: oracle-java11-installer-local E: Sub-process /usr/bin/dpkg returned an error code (1)
需要将dpkg的包依赖信息库进行更新(目录:/var/lib/dpkg/info/)
$ sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/ $ sudo mkdir /var/lib/dpkg/info/ $ sudo apt-get update $ sudo apt-get -f install
#暂未执行恢复info目录操作,告警消失 $ sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/ $ sudo rm -rf /var/lib/dpkg/info $ sudo mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/
参考链接:https://blog.csdn.net/qq_36561697/article/details/82224279