「Linux」 debian的安装与配置

Posted by Dawn-K's Blog on December 1, 2020

debian

[toc]

debian的版本

debian有四个版本 stable unstable testing sid. 先折腾stable版本.

安装

使用virtual box 进行安装,分区时选择 guide /home parti

  1. Graphics Install

  2. Select a language. Choose English.

不要选择Chinese 使用中文的系统环境会给一些命令行操作带来不便, 甚至会增加错误排查的难度. 即使在英文的系统环境中, 也可以通过安装中文输出法来键入中文.

  1. Select your location. Choose Other -> Asia -> China.

  2. Configure locales. Just leave the default setting (United States - en_US.UTF-8).

  3. Configure the keyboard. Just leave the default setting (American English).

  4. Configure the network. You can continue without network configuration.

  • Hostname: Just leave the default setting (debian).
  • Domain name: Just leave the default setting ().
  1. Set up users and passwords.
  • Root password: The root account is very important. If you forget the root password, you can not fully control the operating system.

  • Full name for the new user: Anything will be fine. Username for your account: Anything will be fine, too. But pay attention to the restriction.
  • Choose a password for the new user: This password is different from the root’s one, because they belong to different accounts.
    1. Configure the clock. Just wait.
    2. Partition disks. This step will perform disk partitioning.
    3. Partitioning method: If you are installing Debian directly on the physical machine, choose Manual instead to select the new partition you prepared in the previous steps. Otherwise the existing data will be lost! If you are going to use virtual machine, then choose Guided - seperate /home partition. For more details, click help or search the Internet. After finishing configuration, select Finish partitioning and write changes to disk and click Continue.

Write the changes to disks?: Select Yes.

请再三确认重要数据已经备份并检查分区配置 一旦点击Yes, 操作将不可逆转.

Install the base system. Just wait.

Configure the package manager

Use a network mirror?: Select No. Select and install software. Just wait.

Configuring popularity-contest: Just select your favor. Software selection: Just leave the default setting. Install the GRUB boot loader on a hard disk

Install the GRUB boot loader to the master boot record?: Choose Yes. Device for boot loader installation: Select /dev/sda. Finish the installation. Click Continue.

配置

安装好之后虽然可以进入系统,但是会发现dawnk用户是没有root权限,甚至连sudo都没有,这时候应该退出然后重新以root账户登入,然后 apt-get install sudo 然后编辑系统配置文件/etc/sudoers,仿照root那一行,在下面添加dawnk ALL=(ALL)

问题

空间不足的问题

you don't have enough free space in /var/cache/apt/archives

此时先使用 df -h 命令查看各个分区的使用情况,发现是/太小了,所以就创建软连接将对应的分区给链接过来即可(会不会造成其他用户的使用问题??)

1
2
3
mkdir -p /home/dawnk/debs/partial
sudo rm -rf /var/cache/apt/archives
ln -s /home/dawnk/debs /var/cache/apt/archives # 软连接一定一定要用绝对路径!!