ubuntu12.04安装软件出现deb包不支持等情况解决

文章描述了在尝试安装xinetd时遇到的错误,如debconf:apt-extracttemplatesfailed和dpkg-deb错误,原因是使用的软件源不适用。解决方法是备份并修改/etc/apt/sources.list文件,将内容替换为阿里云的Ubuntutrusty仓库镜像地址,然后更新软件列表以修复安装问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最大的原因:软件源不合适

比如安装xinetd之类的安装失败出现debconf: apt-extracttemplates failed: No such file or directory等等报错,找了很久找到一个源是12.04可以用的。

完整报错:

apt-get install xinetd

The following NEW packages will be installed:
  xinetd
0 upgraded, 1 newly installed, 0 to remove and 1170 not upgraded.
Need to get 0 B/108 kB of archives.
After this operation, 310 kB of additional disk space will be used.
E: /var/cache/apt/archives/xinetd_1%3a2.3.15.3-1_amd64.deb not a valid DEB package.
E: Prior errors apply to /var/cache/apt/archives/xinetd_1%3a2.3.15.3-1_amd64.deb
debconf: apt-extracttemplates failed: No such file or directory
dpkg-deb: error: archive '/var/cache/apt/archives/xinetd_1%3a2.3.15.3-1_amd64.deb' contains not understood data member control.tar.xz, giving up
dpkg: error processing /var/cache/apt/archives/xinetd_1%3a2.3.15.3-1_amd64.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/xinetd_1%3a2.3.15.3-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1) 

解决步骤:

1.sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份

2.sudo vim /etc/apt/sources.list #修改

替换内容:


deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
 

3.保存后更新sudo apt-get update #更新列表

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值