Ubuntu 22.04安装Google Chrome稳定版deb解压失败求助
在Ubuntu 22.04安装Google Chrome时遇到dpkg-deb解压错误
问题描述
在Ubuntu 22.04.2 LTS上安装Google Chrome稳定版时,触发dpkg-deb: error错误,无法完成.deb文件解压。此前相同步骤可成功安装,但Chrome更新至114.0.5735.198-1版本后,新实例执行安装命令时出现以下报错:
ubuntu@ip-172-31-5-107:~$ sudo apt -y install google-chrome-stable Reading package lists... Done Building dependency tree... Done Reading state information... Done The following NEW packages will be installed: google-chrome-stable 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 94.3 MB of archives. After this operation, 322 MB of additional disk space will be used. Get:1 http://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 114.0.5735.198-1 [94.3 MB] Fetched 94.3 MB in 1s (65.4 MB/s) (Reading database ... 110879 files and directories currently installed.) Preparing to unpack .../google-chrome-stable_114.0.5735.198-1_amd64.deb ... Unpacking google-chrome-stable (114.0.5735.198-1) ... dpkg-deb: error: <decompress> subprocess was killed by signal (Killed) dpkg: error processing archive /var/cache/apt/archives/google-chrome-stable_114.0.5735.198-1_amd64.deb (--unpack): cannot copy extracted data for './opt/google/chrome/chrome' to '/opt/google/chrome/chrome.dpkg-new': unexpected end of file or stream Errors were encountered while processing: /var/cache/apt/archives/google-chrome-stable_114.0.5735.198-1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
已尝试以下操作但未解决问题:
- 通过SFTP或
wget手动下载DEB文件后解压安装 - 执行社区分享的dpkg修复、缓存清理命令
- 修改dpkg配置并重置Ubuntu软件依赖
目标是成功安装Google Chrome,可通过google-chrome --version验证安装状态。
解决方案
1. 检查磁盘剩余空间
报错中的"unexpected end of file or stream"常与磁盘空间不足有关,先验证根目录可用空间:
df -h /
确保剩余空间不少于350MB,若不足可清理旧日志、无用包文件后重试。
2. 彻底清理缓存并重新安装
# 删除损坏的缓存包 sudo apt clean sudo rm -rf /var/cache/apt/archives/google-chrome-stable*.deb # 重新配置Google Chrome源 wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee /etc/apt/sources.list.d/google-chrome.list # 更新源并安装 sudo apt update sudo apt install -y google-chrome-stable
3. 手动解压DEB包部署
若自动安装仍失败,尝试手动解压并复制文件:
# 下载最新稳定版DEB包 wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb # 创建临时目录解压 mkdir chrome_temp dpkg-deb -x google-chrome-stable_current_amd64.deb chrome_temp # 复制文件到系统目录 sudo cp -r chrome_temp/opt/google/chrome /opt/google/ sudo cp chrome_temp/usr/bin/google-chrome /usr/bin/ sudo cp chrome_temp/usr/share/applications/google-chrome.desktop /usr/share/applications/ # 清理临时文件 rm -rf chrome_temp google-chrome-stable_current_amd64.deb # 验证安装 google-chrome --version
4. 临时增加Swap缓解内存不足
若为小内存云服务器(如1GB内存),解压大文件时可能因内存不足被系统终止,可临时添加Swap:
# 创建2GB Swap文件 sudo fallocate -l 2G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile # 重新执行安装 sudo apt install -y google-chrome-stable # 安装完成后可删除Swap(可选) sudo swapoff /swapfile sudo rm /swapfile
内容的提问来源于stack exchange,提问作者Lucas
相关产品推荐
相关产品推荐

