刘伟男 發表於 2023-1-13 16:16:00

Debian 11 操作系统

<h3>(0)安装注意</h3>
<p>安装过程中</p>
<h3 id="item-1">(1) 禁用 CD ROM 存储库</h3>
<p>如果您碰巧使用 DVD 安装 Debian 11,那么每次您选择更新任何内容时,它都会抛出一个错误消息,表示存储库 cdrom 没有发布文件。</p>
<p>禁用 CD 存储库:</p>
<p>打开终端,切换到 root 用户,然后从 /etc/apt/sources.list 文件中注释相关部分。</p>
<div class="cnblogs_code">
<pre># deb cdrom:/<span style="color: rgba(0, 0, 0, 1)"> bullseye contrib main

<span style="color: rgba(0, 0, 255, 1)"># deb cdrom:/</span><span style="color: rgba(0, 0, 0, 1)"><span style="color: rgba(0, 0, 255, 1)"> bullseye contrib main</span>

deb http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ bullseye main</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ bullseye main</span>
<span style="color: rgba(0, 0, 0, 1)">
deb http:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">security.debian.org/debian-security bullseye-security main contrib</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">security.debian.org/debian-security bullseye-security main contrib</span>
<span style="color: rgba(0, 0, 0, 1)">
# bullseye</span>-<span style="color: rgba(0, 0, 0, 1)">updates, to get updates before a point release is made;
# see https:</span><span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports</span>
deb http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ bullseye-updates main contrib</span>
deb-src http:<span style="color: rgba(0, 128, 0, 1)">//</span><span style="color: rgba(0, 128, 0, 1)">mirrors.163.com/debian/ bullseye-updates main contrib</span></pre>
</div>
<p>禁用它之后,您就可以继续更新存储库索引而不会出现任何问题。</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"># sudo apt update
</pre>
</div>
<h3 id="item-2">(2) 配置 sudo user</h3>
<p>在系统中安装 sudo 包,以获得管理特权。还需要将用户添加到 sudo 组。</p>
<p>安装 sudo 并将用户名添加到 sudo 组,请执行如下命令</p>
<p><strong>注意:</strong> 必须用 root 用户运行命令。添加用户 zcx 到 sudo 用户组,以便现在所有的任务都可以由本地用户执行。</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">$ su - root
# apt install sudo -y
# usermod -aG sudo zcx<br>###<code class="language-csharp">usermod<span class="token punctuation">: command not found<br># 将/usr/sbin写入环境变量<br></span></code># <code class="language-bash">export PATH=/usr/sbin:$PATH</code><br># <code class="language-undefined">vi ~/.bashrc <br># <code class="language-bash">export PATH=/usr/sbin:$PATH <br># source ~/.bashrc<br></code></code># su zcx<br>$ sudo apt update</pre>
</div>
<h3 id="item-3">(3) 安装更新</h3>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">$ sudo apt update
$ sudo apt upgrade -y
<br>###重新启动系统
$ sudo reboot
</pre>
</div>
<h3>&nbsp;(4) 安装neovim</h3>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"># sudo apt install neovim<br># nvim
</pre>
</div>
<h3>&nbsp;(5)安装拼音输入法</h3>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"># sudo apt install fcitx5 fcitx5-chinese-addons
</pre>
</div>
<p>然后在搜索框输入im-config(input method)中激活fcitx5作为输入方式</p>
<p>然后打开fcitx5-configure,配置拼音输入法:去掉“Only Show Current Language”前面的勾。然后找“pinyin”,添加到左侧输入法中,点OK。</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;"># reboot
</pre>
</div>
<p>&nbsp;开机后ctrl+space切换输入法</p>
<h3>&nbsp;(6)硬盘挂载</h3>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">###查看硬盘详细信息
# sudo fdisk -l /dev/sda
###输出
NumberStart (sector)    End (sector)Size       CodeName
   1            2048          206847   100.0 MiB   0700Microsoft basic data
   2          206848      3907024895   1.8 TiB   0700Microsoft basic data

###查看硬盘UUID
# sudo blkid /dev/sda2
###输出
/dev/sda2: UUID="9E5ED2D65ED2A5F5" TYPE="ntfs" PARTUUID="0a212984-02"

###修改/etc/fstab文件
# for 1.8T
UUID=9E5ED2D65ED2A5F5 /media/disk1 ntfs defaults02
# for 3.6T
UUID=78f5b032-393b-4ff7-a918-16af28ef0c3b /media/disk2 ext4 defaults02
</pre>
</div>
<p>&nbsp;(7)禁止自动休眠</p>
<div class="cnblogs_Highlighter">
<pre class="brush:bash;gutter:true;">### 查看休眠状态
# systemctl status sleep.target

### 设置禁止休眠
# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

### 查看休眠状态
# systemctl status sleep.target<br>### 输出loaded:masked,成功
</pre>
</div>
<p>setting里点击Power,Blank Screen设置为Nerver,设置永不熄屏。 </p><br><br>
来源:https://www.cnblogs.com/matrixray/p/17050072.html
頁: [1]
查看完整版本: Debian 11 操作系统