User Tools

Site Tools


install_debian

If you want to send us your comments, please do so. Thanks
More on comments


Installing Debian

Introduction

Installing or reinstalling Debian. For an upgrade of Debian to a newer version see Updating Debian

You can also have a look at Newniks: Tips for new Unix users for some other views. Be warned: This is about Debian 6 Squeeze

This document was originally about Debian 7 Wheezy. It is has been worked on ever since. It has been last updated for Debian 11 Bullseye

If you make changes in files other than in /root and /home it is advised to add a comment in them so when you are reinstalling Debian you can find them with grep -rl yourremark / . We use username yymmdd as the tag for changes

What you need

  • A Debian install CD or DVD, or put the ISO file on an USB drive with like the Ventoy boot system
    • Do not use the Live version since it might install a lot of packages which are not needed. For most users install the
      • amd64 version
      • For older computers the i386 version
  • An external CD/DVD player (and its powersupply if applicable) if your PC does not have an internal CD/DVD player
  • An USB cable for the external CD/DVD player
  • An ethernet cable of sufficient length
  • A ethernet RJ45 port connected to the Internet

Dual boot with Windows

To achieve this install Windows first. Windows will be found by the Grub.

Getting the install image

If you already have images then use jigdo, see jigdo, to get the latest images
If you do not have any images download the CD or DVD which suits your needs and your computers needs from Debian on CDs. The preferred way is using Bittorent. A convenient way is using http

From now on we will mention CD meaning CD or DVD, just what you use

We prefer the xfce Netinstall ISO. On an older computer with a slower CPU (Passmark 800 and below, 2 GB or less memory the QT or LXDE desktops are advised
With http download the current stable version from:
* i386
* AMD64
Burn the downloaded ISO to a CD. Maybe you can use a USBdrive instead. How to do that is not explained here. Or create a Ventoy multi ISO boot USB drive

Pre install actions

  • Make sure there is at least 4 GB of free hard disk space. 2.8 GB is not enough
  • Set the PC clock to UTC via the BIOS. See: time shifting issues
  • Partition the hard disk. Here is more on why
    • It might be faster and more convenient to pre partition the disk to your needs using a tool like Parted Magic.
    • Create a swap partition of at least half the size of the memory with a maximum of 1GB depending or to your needs. More on Formatting
    • It is advisable to make separate partitions for some directories in the root of the filesystem ( / ).
    • We did not try LVM (logical volume management).
    • Since the partition size is static you have to estimate the size needed for the partitions. We have put a proposal for the size in the next table
DirectorySizeAdvised sizeRemark
/>= 4 GB30GBPrimary partition
/boot>= 1 GB1 GBCan be ommitted and incorporated in /
/home>= 10 GB30 GBIn extended partition
/opt>= 2 GB20 GBIn extended partition
/root0,1 GB0,1 GBIn extended partition
/tmp10 GB20 GBIn extended partition
/var>= 6 GB40 GBIn extended partition
swap1 GB1 GBIn extended partition

This comes to use when you have to reinstall Debian. A lot settings are preserved then if you keep the data of these partitions when partitioning, do NOT format them. You can cleanup /var. Keep /var/backups, /var/log, /var/mail, /var/spool

Pre reinstall actions

  • Copy /etc to /var/backup/etc
  • Save your custom themes in /usr/share/themes/
  • Cleanup /var . Keep /var/backups, /var/log, /var/mail, /var/spool

If you get Errors

If you get an error, a screen with a red background, type

CTRL ALT 2

to open a console.
To login press enter
Do

cd /var/log

check the logfiles for clues

more

can be used to step through the logfiles To go back to the install screen type CTRL ALT 1

apt error

When an apt occurs this can be caused when the CD drive you are installing from is not sr0. This can be solved by mounting the drive with the CD to /media/cdrom in a terminal screen (CRTL ALT 2). Do

mkdir /media/cdrom && mount /dev/sr[numberOfTheDriveTheCDisIn] /media/cdrom

You can check if you have mounted the right drive with

ls /media/cdrom

See also /var/log/syslog or do

tail /var/log/syslog

for more clues

Red screen

  • During installation of the basesystem. We could solve the issue by doing
    • BIOS: Setting the SATA setting in the BIOS of the Intel motherboard to RAID
    • BIOS: Enabling UEFI
    • Creating a GPT partitiontable in stead of a MSDOS one

The installation

Installation terminals

During installation, after a certain point, there are terminals avaiable

ALT-F1 The install terminal
ALT-F2 Available for the user
ALT-F3 Available for the user
ALT-F4 Install events output. Here you can see in detail what is going on

CD does not eject

If the CD does not eject by means of the eject button, go to terminal F2 and typ eject at the prompt. After inserting an other CD wait until the light on the drives stops blinking before pressing <ENTER>
Use TAB to navigate through a page
Use SPACE to select items
Use ENTER to activate

Let's go

One line per screen:

  1. Make sure your PC is connected to the Internet via an Ethernet cable connection
  2. Load the CD in the PC you want to install Debian on
  3. When the CD is booted select: Advanced options
  4. Select: Expert install
  5. Wait until the installer has been started up. This can take some time. Finally the “Debian installer main menu” shows up. Continue in this menu:
  6. Choose language
    1. Select a language
      1. Language: English - English
    2. Select your location
      1. Country, territory or area: Europe > Nehterlands
    3. Configure locales
      1. Country to base default settings locale on: United States - en_US.UTF-8
      2. Additional locales: Select what you need. We also want nl_NL.UTF-8
      3. System locale: en_US.UTF-8 Text's will be in US english.
        1. In our case if we would select nl_NL.UTF-8 text's would be in Dutch
  7. Access software for a blind person using a braille display
    1. Skip if not needed
  8. Configure the keyboard
    1. Keymap to use: American English (or according to your needs (not tested by us))
  9. Detect and mount CD-ROM
    1. CD-ROM detected
    2. Pre Debian 9: Modules to load: Select usb-storage (and others if presented and needed)
    3. CD-ROM detected:
      1. Continue
  10. Load installer components from CD
    1. Installer components to load:
      1. choose-mirror
      2. parted-udeb
    2. Loading additional components: This takes a some of time
  11. Detect network hardware
    1. If you get a screen with in the bottom “Load missing firmware from removable media?” then try to find what is missing (see the screen). Something like rt18168d-2.fw. Put is on an USB stick, or a diskette, insert is and do <Yes>. If that does not work, as in our case, do <No> and try to install the firmware after installation. When done do ALT-F2 and ENTER to start a console. Do blkid to see which device the USB stick is. Then do eject /dev/TheUSBstickDevice and remove the USB stick. Press ALT F1 to get back to the installer
  12. Configure the network
    1. Waiting time (in seconds) for link detection: 3
    2. Primary network interface
      1. Choose the wired interface you connected to the Internet
    3. Auto configure networking?:
      1. No
        1. IP adres: The IP adres you want to assign to your computer
        2. Netmask: 255.255.255.0
        3. Gateway: The IP adres of your router or gateway
        4. Name server address: The address of the DNS server, mostly of your Internet provider. Can also be your router if it is configured accordingly
        5. Currently configured network parameters: Check if all is entered as desired
      2. Yes if you were not able to load the firmware and the networkcard is not functioning (after this step that will be clear). We got a working connection even if we were not able to install the firmware. Also if and / or you want to use DHCP and thereby auto configure the network
    4. Waiting time (in seconds) for link detection: 3
    5. Hostname: The hostname (a name you can make up yourself) of your PC
    6. Domain name: Leave empty
  13. Choose a mirror of the Debian archive
    1. Protocol for file downloads:
      1. http We use http
      2. https We tried this but did not succeed. You need to enter a mirror manually, not tested further
      3. FTP. We did not test ftp
    2. Debian archive mirror country: Your country (type the first letter to move fast). For us: The Netherlands
    3. Debian archive mirror: Select one at your choice. We choose ftp.nluug.nl
    4. HTTP proxy information (blank for none): Leave blank if not needed
  14. Set up users and passwords
    1. Enable shadow passwords?: Yes
    2. Allow login as root?: Yes (or No at your choice)
    3. Root password: Enter the root password of your choice
    4. Re-enter password to verify: reenter the root password of your choice
    5. Create a normal user account now?: Yes
      1. WARNING: When upgrading old /home data to a new install then read the Migration page on how to handle the user accounts
    6. Full name for the new user: Enter the name of the user
    7. Username for your account: press Enter
    8. Choose a password for the new user: Enter a password of your choice
    9. Re-enter password to verify: Reenter the password of your choice
  15. Configure the clock.
    1. Why we use UTC: time shifting issues
  16. Set the clock using NTP?: Yes
    1. NTP server to use: press Continue (or enter an alternative first)
    2. Select your time zone: Coordinated Universal Time (UTC)
  17. Detect disks
  18. Partition disks
    1. It is advisable to make separate partitions. See pre install actions on the top of this page
    2. Partitioning method: Manual (or an other choice depending on your needs. We did not test the other choices)
    3. If there are at least two options BOIS method or EFI method then:
      1. BIOS: Proceed with the next step
      2. EFI: Set the filesystem to GPT. If there is a EFI partition leave it as is. If there is no EFI partition create a 250MB EFI partition which will be formatted to ESP format at the beginning of the harddisk. Select EFI System Partition in stead of the usual ext4 journaling file system. Set the bootable flag to on
    4. Check if all partitions are set as needed. For every partition check and or set
      1. Use as: Ext4 journaling file system
      2. Format the partition: yes if the partition is empty or all data can be deleted. We did not test not formatting the partition
      3. Mount point: At least one as root ( / )
      4. Mountoptions: defaults (Leave all unselected)
      5. Label: At your choice
      6. Reserved blocks: 5%
      7. Typical usage: standard
      8. Bootableflag: Off. On for the root ( / ) partition when MBR based partitioning is used. off for EFI based partitioning
      9. Select Done setting up the partition and press Enter
      10. Repeat this, from “Check if all partitions are set as needed”, for other partitions
    5. Create a swap partition
      1. Use as: swap area
      2. Bootable flag: off
    6. When ready select: Finish partitioning and write changes to disk. Press Enter
    7. Write changes to disk?: Check if all is as desired and if so select Yes and press Enter
  19. Install the base system. This can take some time
    1. Pre Debian 8 Jessie info
      1. pae1) Physical Address Extension. Enables 36 bits addressing space, which allows addressing of memory in excess of 4GB up to 64 GB
      2. rt Realtime kernel
    2. Kernel to install (The x's represent the version number):
      1. On a computer with a 64 bit CPU install linux-image-x.x.x-x-amd64 (If you choose linux-image-amd64 it might not be possible to remove the old kernel after an kernel upgrade, to be investigated)
      2. 32 bit CPU
        1. On a computer with a 32 bit CPU and a maximum of 3GB RAM install the linux-image-x.x.x-x-686 kernel (non pae)
        2. On a computer with a 32 bit CPU and in which there is between 3GB RAM and 4GB RAM install the linux-image-x.x.x-x-686-pae kernel. The pae kernel will solve the BIOS memory hole issue that can exist so the memory between 3GB RAM and 4GB RAM is also accessable
        3. On a computer with a 32 bit CPU and in which there is or will be more than 4GB RAM (max 64GB) install the linux-image-x.x.x-x-686-pae kernel
      3. If you have an very old PC you might need linux-image-486 (not available from Debian 8 onwards)
    3. Drivers to include in the initrd: targeted: only include drivers needed for this system
  20. Configure the package manager
    1. If you use a full CD you will be asked: “Scan another CD or DVD?” If so do that, if not select <No>. If <YES>, then the CD will not eject with the button on the drive press ALT-F2. Then ENTER to get the command prompt. Type eject and the drive will eject. Replace the CD with the next one to be scannned. Type eject -t and the tray will close. Return to the installation screen with ALT-F1. Wait until the light on the CD drive goes off and do , if <CONTINUE> is selected, red, <CONTINUE> by pressing ENTER. Repeat until all CD's are scannned. If you use a netinstall CD this question will not be asked
    2. Use a network mirror?: Yes
    3. Protocol for file downloads: http
    4. Debian archive mirror country: Your country (type the first letter to move fast). For us: The Netherlands
    5. Debian archive mirror: Select one at your choice. We choose ftp.nluug.nl
    6. HTTP proxy information (leave blank for none): Leave blank if not needed
    7. Use non-free software?: Yes (Or No if you do not want to use non-free software)
    8. Enable source repositories in APT?“ We choose <No>
    9. Debian 10 Buster: Configuring discover. Updates management on this system: Install security updates automatically
    10. Retrieving file “number” of “total”: This takes a bit off time
    11. Services to use: Select
      1. security updates (from security.debian.org)
      2. release updates
  21. Configuring discover
    1. Updates management on this system: No automatic updates (since with automatic update choices can not be made)
    2. Retrieving file “number” of “total”: This takes a bit off time
  22. Select and install software.
    1. Retrieving file “number” of “total”: This takes some time
    2. Configure populatity-contest
      1. Participate in the package usage survey?: Yes (Or No to have more privacy)
    3. Software selection
      1. Choose software to install
        1. Debian desktop environment (If you do not need a windowmanager, so just a commandline, unselect this)
        2. Items 2 until 10 as desired. We choose Xfce
        3. Standard system utilities
    4. Retreiving file x of total amount (x time remaining). Now the final installation starts. This takes a long time. 1000+ packages have to be read from CD and / or downloaded and installed
  23. Install the GRUB boot loader on a hard disk
    1. Install the GRUB boot loader to the master boot record?: Yes
    2. Device for boot loader installation: Select the device where the bootloader has to be installed. We did not try “Enter device manually
    3. Force GRUB installation to the EFI removable media path?: <Yes> Just to be sure, we did not test <No>
  24. Finish the installation
    1. Is the system clock set to UTC?: Yes
    2. Installation complete:
      1. Remove the CD from the CD drive (and close the tray)
      2. <Continue>
    3. The system will reboot now
    4. While the system reboots check the logging for errors like
      1. Missing driver for Radeon R300_gb. Solution install the firmware-amd-graphics package with aptitude
    5. After the reboot has finished login as root and check journalctl -xb for any issues and resolve them
    6. Reboot and check journalctl -xb again. Repeat until all issues are resolved
  25. Ready

Post install actions

  • Settings > Power Manager > Security >
    • “Automatically lock the session”: Never
    • “Lock screen when system is going to sleep”: Off

Login into a terminal and become root and do

  • apt-get install aptitude
  • systemctl status nftables.service to check if the firewall is active. You should see Active: active (exited) since. If so then it is ok. If not
    • run systemctl start nftables.service
    • check again with systemctl status nftables.service
  • Run a script to set up and install a lot of software. T.b.d.
    • After uninstalling fonts choose an other font in:
      • Terminal > Edit > Preferences > Appearance > “Use System font”* Off; Dejavu Sans Mono Book; Size: 12
      • Where the system font is set is not clear at this point. It is not in:
        • Menu > Settings > Appearance > Default Font > Dejavu Sans Book; Size: 10
        • Menu > Settings > Appearance > Default Monospace Font > Monospace Regular; Size: 10
        • Selecting text and pasting it with a click on the mouse wheel results in unreadable text with only blocks. This can not be solved in Menu > Settings > Somewhere in on of the items. T.b.d.
  • exo-open is from the Default Applications in Menu > Settings > Default Applications were the default WebBrowser, MailReader, TerminalEmulator and FileManager can be set
    • The configuration file is xdg/xfce4/helpers.rc
  • aptitude remove vim-tiny (set syntax on does not work in vim-tiny, it does in vim)
  • aptitude install vim and see configure vim
  • This is important, vi /root/.bashrc and add PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
  • source /root/.bashrc
  • Turn the use of the CD('s) off in /etc/apt/sources.list
  • Set the locale according to your needs following Locale
  • If exim4 is not installed install, with aptitude, dma first so there is a MTA (Mail Transport Agent) for mutt
  • Check if the clock in the panel is to UTC. Add a second clock, Orage, to the panel for local time
  • Install firmware that could not be installed before. If the computer has Realtek network hardware it might be useful to install with aptitude firmware-realtek. Also firmware-linux-nonfree, firmware-amd-graphics or an other one depending on the hardware in your computer might be useful to install. You can also search for errormessages in the output e-mail of logcheck for missing firmware
  • Set the swappiness of the swappartition. See our Swap page
  • set /etc/logrotate.d/[apt, aptitude, dpkg] to longer times so you can always see what has been installed. We choose rotate 120 monthly. A good alternative is rotate 12 yearly. Keep an eye on the logsize.
  • Set Update-alternatives for editor, view, vi, www-browser, x-terminal-emulator
  • Make sure you have your Debian backup system set up
  • Make sure you have your logging and watching of the logs set up.
  • Check if any settings have to be changed for GTK2 and GTK3 with the gsettings command

Additional software

Start aptitude and update the package list by pressing u
If any updates are found press U and then g. Evaluate what is going to be done. If satisfied press g again. When the installation is finished press Retrurn. Repeat this until there are no more updates to be installed

Do <CTRL> T and go to options.

  • Set “Prompt for confirmation on exit” to off.
  • Set “Display tabs for the information area” to on

Leave aptitude by pressing q twice

Install via aptitude according to your needs. It might be possible that some packages are not available, obsolete, to new, for the Debian version you are installing

  • firmware for hardware that does not function properly, check the bootlogd output (post systemd systems), journalctl (on systemd systems) or the output of logcheck and / or logwatch for errors and warnings
  • In a root terminal:
    • Some commandline programs, programs that function in a terminal, (links2 takes 214MB) by doing aptitude install auditd beep bc backup2l dnsutils htop iotop lshw mc mutt wipe links2 localepurge smartmontools lm-sensors nwipe logcheck package-update-indicator (and dependency packagekit (do not install the recommended packages)) syslog-summary
    • Optional
      • nwipe (If you need to wipe harddrives)
      • shiki-colors-xfwm-theme
      • xfce-keyboard-shortcuts
      • xfce4-statusnotifier-plugin
    • localepurge when asked
      • Use dpkg --path-exclude? choose No . More information
      • Also delete localized man pages? choose Yes
    • logcheck mails its output to the local mailbox. Use mutt to read it. See also the log configuration page
    • Uninstall unattended-upgrades. It is better to update manually so you can make the decision when a program asks for it
  • When you installed Xfce do: aptitude install info geany feh orage qpdfview pk-update-icon smart-notifier package-update-indicator

Remarks:

  • bootlogd is (Pre Debian 8 Jessie). The same information can be found in the local mail when the t.b.d. package is installed

Firefox

See Firefox

What can be removed from Debian

See What can be removed from Debian to make the Debian installation footprint smaller and the Debian installation safer by removing software that is not needed

Configuring bash

Change default settings and add settings to .bashrc for the user(s) and root

# Bash history 
shopt -s histappend # append to the history file, don't overwrite it
HISTCONTROL=ignorespace:ignoredups  (Is the same as HISTCONTROL=ignoreboth)
HISTFILESIZE=2000000
HISTSIZE=100000
# The prompts
#echo $color_prompt
force_color_prompt=yes
if [ "$color_prompt" = yes ]; then
  if [ $USER == root ]; then
    # For root
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \#\[\033[00m\]\$ '
  else
    # users
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\u@\h \D{%d %b %Y} \A UTC\[\033[00m\]:\[\033[01;34m\]\'
  fi
else
  # Default prompt
  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# Aliasses
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases.sh, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases.sh ]; then
  . ~/.bash_aliases.sh
fi
  • Create and fill the bash_aliases.sh file with aliases
  • Enlarge the scrollback buffer of the terminal in Edit | Preferences… | General tab | Mark Unlimited scrollback

Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
install_debian.txt · Last modified: 21-02-2024 20:05 by wim