不断进步 發表於 2019-9-3 17:31:00

Debian使用小计

<h1>1. Debian无法apt install</h1>
<p>debian安装完成后,如果运行apt install,提示</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">Media change: please insert the disc labeled
<span style="color: rgba(128, 0, 0, 1)">'<span style="color: rgba(128, 0, 0, 1)">Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130504-14:44<span style="color: rgba(128, 0, 0, 1)">'
<span style="color: rgba(0, 0, 255, 1)">in the drive <span style="color: rgba(128, 0, 0, 1)">'<span style="color: rgba(128, 0, 0, 1)">/media/cdrom/<span style="color: rgba(128, 0, 0, 1)">' and press enter</span></span></span></span></span></span></span></span></pre>
</div>
<p>表示安装的时候,默认使用了CD光盘。可以在/etc/apt/sources.list中,把cdrom一行注释或是删除。</p>
<p>&nbsp;</p>
<h1>2. vim无法安装</h1>
<p>安装vim的时候提示</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or </span><span style="color: rgba(0, 0, 255, 1)">if</span><span style="color: rgba(0, 0, 0, 1)"> you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
vim : Depends: vim</span>-common (= <span style="color: rgba(128, 0, 128, 1)">2</span>:<span style="color: rgba(128, 0, 128, 1)">7.4</span>.<span style="color: rgba(128, 0, 128, 1)">488</span>-<span style="color: rgba(128, 0, 128, 1)">7</span>+deb8u4) but <span style="color: rgba(128, 0, 128, 1)">2</span>:<span style="color: rgba(128, 0, 128, 1)">8.1</span>.<span style="color: rgba(128, 0, 128, 1)">0875</span>-<span style="color: rgba(128, 0, 128, 1)">5</span><span style="color: rgba(0, 0, 0, 1)"> is to be installed
       Depends: libtinfo5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.</span></pre>
</div>
<p>需要先卸载vim-common,因为需要的版本与现在安装的不一样。</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">sudo</span> apt-get remove vim-common</pre>
</div>
<p>然后再安装libtinfo5</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">sudo</span> apt-get <span style="color: rgba(0, 0, 255, 1)">install</span> libtinfo5</pre>
</div>
<p>安装过程中,提示会删掉另外一个包,按照提示输入Yes, do as I say!继续就可以</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 0, 1)">Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ncurses</span>-base ncurses-<span style="color: rgba(0, 0, 0, 1)">term
The following NEW packages will be installed:
libtinfo5
WARNING: The following essential packages will be removed.
This should NOT be </span><span style="color: rgba(0, 0, 255, 1)">done</span> unless you know exactly what you are doing!<span style="color: rgba(0, 0, 0, 1)">
ncurses</span>-<span style="color: rgba(0, 0, 0, 1)">base
</span><span style="color: rgba(128, 0, 128, 1)">0</span> upgraded, <span style="color: rgba(128, 0, 128, 1)">1</span> newly installed, <span style="color: rgba(128, 0, 128, 1)">2</span> to remove and <span style="color: rgba(128, 0, 128, 1)">0</span><span style="color: rgba(0, 0, 0, 1)"> not upgraded.
Need to get </span><span style="color: rgba(128, 0, 128, 1)">282</span><span style="color: rgba(0, 0, 0, 1)"> kB of archives.
After this operation, </span><span style="color: rgba(128, 0, 128, 1)">4</span>,<span style="color: rgba(128, 0, 128, 1)">191</span><span style="color: rgba(0, 0, 0, 1)"> kB disk space will be freed.
You are about to </span><span style="color: rgba(0, 0, 255, 1)">do</span><span style="color: rgba(0, 0, 0, 1)"> something potentially harmful.
To continue type </span><span style="color: rgba(0, 0, 255, 1)">in</span> the phrase <span style="color: rgba(128, 0, 0, 1)">'</span><span style="color: rgba(128, 0, 0, 1)">Yes, do as I say!</span><span style="color: rgba(128, 0, 0, 1)">'</span>
?] <span style="color: rgba(255, 0, 0, 1)">Yes, do as I say!</span></pre>
</div>
<p>这个原因测试下来,好像因为桌面系统是xfce的原因。Gnome没有提示这些问题。</p>
<h1>3. zsh模式下,回车键失效</h1>
<p>安装设置成zsh后,回车键变成空格键,还有其他几个按键映射错误。运行</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">echo</span> $TERM</pre>
</div>
<p>输出是空。原来是xfce,换成gnome,没有问题。然后从gnome又换成xfce也没问题,怀疑是安装的时候默认选择xfce后续的一些配置问题。</p>
<h1>&nbsp;4.安装中断</h1>
<p>如果apt install的时候因为特殊原因终端,再次运行会报错</p>
<div class="cnblogs_code">
<pre>E: Could not get lock /var/lib/dpkg/lock – open (<span style="color: rgba(128, 0, 128, 1)">11</span><span style="color: rgba(0, 0, 0, 1)">: Resource temporarily unavailable)
E: Unable to lock the administration directory (</span>/var/lib/dpkg/), is another process using it?</pre>
<p>E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)<br>E: Unable to lock directory /var/lib/apt/lists/ <br>E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable) <br>E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?</p>

</div>
<p>运行</p>
<div class="cnblogs_code">
<pre><span style="color: rgba(0, 0, 255, 1)">ps</span> aux | <span style="color: rgba(0, 0, 255, 1)">grep</span> -i apt</pre>
</div>
<p>找到对应进程然后kill -9 关掉</p>

</div>
<div id="MySignature" role="contentinfo">
    <div id="MySignature" style="display: block; text-align: center">
        <h2>版权声明:本文版权归作者所有,如需转载,请标明出处</h2>
</div><br><br>
来源:https://www.cnblogs.com/studywithallofyou/p/11454386.html
頁: [1]
查看完整版本: Debian使用小计