依然天下无双 發表於 2023-7-7 00:00:00

BT5不能使用apt-get命令的解决方案

<p>
        <strong>执行apt-get install xxxx时,报以下错误</strong></p>
<blockquote>
        <p>
                E: There are problems and -y was used without --force-yes</p>
</blockquote>
<p>
         </p>
<p>
        <strong>解决方案:</strong></p>
<blockquote>
        <p>
                vim /etc/apt/sources.list</p>
</blockquote>
<p>
         </p>
<p>
        删除原有,添加如下:</p>
<blockquote>
        <p>
                deb http://old-releases.ubuntu.com/ubuntu/ natty main restricted universe multiverse<br>
                deb http://old-releases.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse<br>
                deb http://old-releases.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse<br>
                deb http://old-releases.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse<br>
                deb http://old-releases.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse<br>
                deb-src http://old-releases.ubuntu.com/ubuntu/ natty main restricted universe multiverse<br>
                deb-src http://old-releases.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse<br>
                deb-src http://old-releases.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse<br>
                deb-src http://old-releases.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse<br>
                deb-src http://old-releases.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse</p>
</blockquote>
<p>
         </p>
<p>
        注意:这里使用的是ubuntu的源,也可以网上找源去,不过bt系列的源已经停止更新了,部分软件已经找不到了</p>
<p>
        kali可以添加以下源:</p>
<blockquote>
        <p>
                deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib<br>
                deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib</p>
</blockquote>
<p>
         </p>
<p>
        <strong>替换源</strong></p>
<blockquote>
        <p>
                apt-get update</p>
</blockquote>
<p>
         </p>
<p>
        如果把源改了以后,在bt5上执行apt-get install xxx时报以下错误</p>
<blockquote>
        <p>
                E: Sub-process /usr/bin/dpkg returned an error code (1)</p>
</blockquote>
<p>
         </p>
<p>
        <strong>处理方法:</strong></p>
<blockquote>
        <p>
                mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //现将info文件夹更名<br>
                mkdir /var/lib/dpkg/info //再新建一个新的info文件夹<br>
                apt-get update<br>
                apt-get -f install<br>
                mv /var/lib/dpkg/info/* /var/lib/dpkg/info.bak<br>
                rm -rf /var/lib/dpkg/info //把自己新建的info文件夹删掉<br>
                mv /var/lib/dpkg/info.bak /var/lib/dpkg/info //把以前的info文件夹重新改回名字<br>
                apt-get update</p>
</blockquote>
<p>
        最后:bt系列的源不再更新了,上述方法可能不能够完全解决你的问题,建议用kali去做任务</p>
<p>
        原文链接:https://www.idaobin.com/archives/174.html</p>
頁: [1]
查看完整版本: BT5不能使用apt-get命令的解决方案