Step 1 - Netinstall CD

Netinstall >
updated November 2019


The following method is ideal for building a minimal Debian/Devuan install (without bloat) as it can install just the basic system without a desktop environment or any software packages, following which, you boot into a command prompt (or you can chroot from a working Debian system) where you install whatever else you need, through an internet connection. The Netinstall ISO does give you the choice to install a full Desktop Environment as well, if you choose to, but then you can't specify exactly what you want installed at that level.

Another method is to get a Live CD with a full DE (desktop environment) of your choice, if you prefer, but again you lose the fun of building the install yourself, cut down to the exact packages you want on your box.

Each release of Debian/Devuan is code-named and passes through three stages of development life before becoming stable -
1st, Experimental (do not use, it is for developers! there will be many breakages of your system),
2nd, Unstable (don't either, there will still be breaks),
and 3rd, Testing (where packages are sent down to before becoming stable, and will still have bugs, but are newer versions than those in stable).

A new release is called Stable, packages are well-tested and bugs mostly already repaired, security updates are maintained but software is not so cutting-edge as in testing and it's sometimes needful to obtain packages direct from developers to run the most up to date versions.

You can follow any release stage (e.g. Testing), by adding its stage name to your sources list (see below) which means you will always keep your system at that level, regardless whether testing becomes stable in a new release. If you add the code name of the current testing to your sources, you will stay with that release when it becomes stable and will need to change the code name in order to follow testing again.

However, when Testing is still new in life there may be some things that could break your system (most likely you'll have package install conflicts to sort out)... so its advisable to run stable while testing still needs ironing out, and it's highly recommended for production systems or servers. You can still install some packages from testing as well, by using the "-t testing" option with apt-get, while your default release is set to stable (but that's mish-mashing releases which may not be healthy).

Upgrading from Stable to Testing is very straight forward - see my page upgrade debian.




Pre-install, get an ISO file...

An ISO file contains every file needed to be put on a CD/DVD/USB stick in order to make a bootable medium with the chosen type of Debian/Devuan Linux. A suitable ISO to USB program will unpack the ISO to the USB stick.


Netinstall CD/Live ISO


Devuan

if you would like to install Debian without the controversial "systemd-sysv" package, and stay with "sysvinit" (that Debian wheezy used for its init or start-up scripts), I advise installing the Devuan branch of Debian (rather than trying to exclude systemd, which is very difficult to do if not impossible due to dependency issues).

Devuan is a fork of Debian, mirroring most packages to Debian repositories, but providing its own versions where Debian packages demand systemd - thus providing a systemd-free Debian...

download from here, live ISO and netinst CD from under 'installer-iso'
files.devuan.org/devuan_ascii
devuan.org/get-devuan

If you use a live ISO (with a desktop environment) the first part of the install method on this page will not be needed (desktop packages) and the resulting install will not be very minimal, or with the exact packages you'd like installed - but it is a faster way if you just need a box with Debian running, like for a server that you won't be using for personal use.....

If you want to install straight into the testing branch, which is currently beowulf, you can find the ISO files here, under beowulf/main/
https://pkgmaster.devuan.org/devuan/dists/

There's also Refracta Live CD made with Devuan.. sourceforge.net/projects/refracta


Debian

Look at the Debian site here Debian.org
Debian Stable  (under "Small CDs")
Debian Testing (under "Netinst")


Build your own ISO

Or you could build your own Live Cd (an advanced method and you need a running Linux OS to work from), a custom-made Debian with all the software you need pre-installed, using Live Helper -see my Remote install page.

But this method may not work for building Devuan... I would still recommend installing a base system and then installing the desktop afterwards from the command line, or in a chroot environment from a Linux OS on another partition.


Make a bootable USB stick

Put the ISO onto a usb stick with a few easy steps with Unetbootin - see my usbinstaller page

Or with a dd command:
 

changing input file to the ISO name and output file 'X' to your usb device e.g. sdb1 - but check first with `lsblk`
Note: dd command will write over everything on the output location.

Or onto a Dvd, using any free Dvd writer software (burn the ISO to Dvd), or with Linux command line..
 





Prepare to install

The netinstall CD image that you downloaded installs only the very basic Linux system - and it's actually enough if you know what you're doing afterwards. All the packages necessary to build a desktop environment and run programs you'll retrieve later.

To install a bit more than the basic system you'll need to have an internet connection available, either by ethernet cable or with a wireless network (so long as you have the ESSID, password and the wireless firmware files).

The installer may ask for missing wireless firmware. You can get a zipped archive of firmware from Debian, and simply copy it to the USB stick with the Live ISO and unpack it there. The installer will search for what it wants. https://www.debian.org/releases/stable/amd64/ch06s04.html.en

If you know what wireless adapter your box has, you can look on Debian.org https://wiki.debian.org/WiFi#PCI_Devices

If your firmware comes packaged as a .deb binary, you can search/download it from https://packages.debian.org/ download and unpack it to copy the firmware files out.

Otherwise, the wireless and other firmware can be loaded after Debian is installed (see below). But note that running the Netinstall CD without a network connection will leave you without proper repo sources in the sources.list file, and possibly some important components.

I did this in June 2017 and noticed the following packages were missing after netinstall: consolekit (can't boot without it), aptitude, sudo, grub2




Get a partition ready!

If you have a brand new PC to install on, or one with nothing worth keeping on the disk (like Windoze), you can format the harddisks with the installer.

On a PC which already has an OS installed, use the Gnome partition editor (gparted) to make free space for your new partitions, or do this with the installer.

You can get the Gparted Live CD or install it if you have a Linux OS already on the PC.
  1. shrink a large partition which has some unused space, to make enough for your combined system and home area, perhaps 30 or 40Gb (see below about resizing Windows).

  2. Note: it's not advisable to move a partition along on the hdd, as Gparted will actually copy the whole file system, sector by sector, taking a very long time. Shrinking from the right should be fast, but if you need to move the partition along to the right, it would be better to copy the data off it, delete it and then create new partitions.

  3. make an Extended partition, size = total size of the partitions needed for Linux, or else resize existing Extended partition to add Logical partitions to it.
  4. in the extended partition, make a Logical partition for the Linux system, 15-20GB, formatted with ext4,
  5. and another Logical for the home partition (if you choose to make it separate - actually a good idea because then you can make a fresh install or clone any time over the system without wiping over you home partition with all your configuration files), anything from 2Gb to 20Gb... formatted ext3 or ext4 also.
  6. then a swap area (but no need to make if there's an existing swap of another Linux install) which just needs 1Gb to work fine in my opinion and formatted as Linux swap - you can also forget this and just set up a swapfile on your system partition.


Windows dual-boot

If you are planning to dual boot Debian with Windows (i.e. have both installed and choose from a menu which one to boot) it will be easy as chips if your Win OS partition was custom sized with separate data partitions - then you just need to resize any data partition to make space for Debian. However, if your PC came with factory-installed Windoze, then the OS partition may indeed take up half or even the whole of the hard-disk. In that case, you'll need to run some operations in W so that you can shrink the OS partition down to a more moderate 50 to 80Gb.

I ran the following tasks in Win7 to do this (and these may be old now, I don't use or touch W any more):

Finally I shrunk it right down to the size I wanted it with Gparted (but you may want to back up the partition before doing this).

If you're going to to wipe the W partition (yeah!) but there's data on it, back-up what you need first.

Take care if you actually shift a Windows (Win 7) partition along the HDD, say to make more space for a Linux partition, as this will LIKELY render the Windows OS unbootable because the W boot sector will be changed. You would then need to fix that with a Windows Disk by running the repair boot option.


Debian installer might not see the Win OS and so you will need to do some work to add the Windows OS to the boot menu later. Some tips on my GRUB page - although I only cover Legacy GRUB. Windows 8 boots with UEFI boot menu which makes it complex to have Debian on the same menu (see here for example). With Debian on the Legacy menu you'll have to switch between Legacy and UEFI menus in BIOS settings.

If you want to install dual boot with Windoze and use UEFI boot menu, you should check your ISO installer is UEFI enabled.




The Net install CD (base system)

1. I chose Graphical expert install (plain Graphical install does the job but it gives no option to add locales).

2. configure network hardware: insert usb stick at firmware prompt for network hardware (didn't work)

NOTE: the installer didn't search for the firmware on the Live CD usb stick, it actually wanted me to insert another - and pulling out and inserting again gave a problem later on, failed to install the base system.

3. then set up the network by either Ethernet (eth0) or wireless (wlan0), if you have the ESSID ready (your wireless network name)

4. Partitioning - assuming the partitions were set up with Gparted earlier:

5. install software.. uncheck all (tap Spacebar) including graphical desktop (which installs the bloated Gnome, or Xfce with a lot of extras), select laptop if installing to a laptop. Or select nothing!

6. Install GRUB (if for clean install) or otherwise don't - add the new install to GRUB later by running update-grub on another working Linux install on the same box - see my GRUB page It may fail to install anyway.

Then finish the install, to set-up users and passwords... and you can restart and boot into the system - as yet without a desktop (it will be just a command prompt).

If you already have a working Linux install on the same box, the easiest method is to chroot into the new install from that (chroot="change root", kind of jump into one system from another) and run the following config and desktop install commands... see my chrooting page. Although it might be a good idea to check that the install made you a bootable system by booting into it once.

And for the following tasks you must be logged in as root, or else switched to root with the `su` command and root password, if logged in as a user. If chrooting into the new install then you will definitely be switched to root already.




Sources list

If the installer failed to download the APT files and didn't make the sources.list properly, you'll need to put that right before you can retrieve/install packages from Debian. APT is the the package manager that controls package installation and it first retrieves the lists of packages from the Debian release you choose, with their current version numbers.

 
(and hit Enter)

The command "nano" there opens a file to edit inside the command-line (because you don't have a graphical file editor yet).

(You'll need these lines handy, on another screen while you follow these steps)
Make sure you have the repository lines like the ones below in the file.

example of lines needed:
 

and for security updates:
 
see http://http.debian.net/

You could also add the multimedia repository (deb-multimedia) to the sources file, which has many useful codecs, but its not recommended by Debian.

My sources list for Debian looks like so:
 

Then save the file, either with Ctrl-X (close file), y (yes) and Enter.

then update your Debian's package lists (which are updated frequently at the server side repository)
if your lists are old you'll get errors when installing packages because old package versions will no longer be available.

Run the update with (while still root user)
 


you can make a system upgrade now as well if you like, to make sure all is up to date, including the kernel etc.
 




Prevent install of "recommended" packages

Setting this up in the APT conf file does the same thing as adding the option --no-install-recommends to every install command. It prevents all the "recommended" packages being installed which are promoted by whatever you install and that means a lot less files will be downloaded and less disk space used, and quite possibly a few less processes running. Besides, why would you want to install what something else wants?

still as root, type
 

fill the file with:
 

"0" also works.

You can knock out the downloading of language packs with every apt-get update, by adding to the same file:
 

and add whatever language you need to be downloaded before the "none"
then save the file, Ctrl-X, y, Enter




Install the desktop environment

Follow this part only when using the Netinstall CD (a Debian Live CD will have a desktop environment already -though you might still need some of the following packages).

The Debian command to install software via the Terminal is 'apt-get install'... You will need these 'apt-get' commands handy on paper or on another screen as you won't have a desktop at this stage of install.

If you like, you can make some files with package lists (e.g. desktop, apps, build) which you can save to a USB stick. Then, on the command line that we've just been using, after netinstall CD and reboot, you mount the stick (find its device id with "lsblk" command, perhaps sdb1), mount it with `mount /dev/sdb1 /mnt` and change to the Usb mount with `cd /mnt` - then use `ls` command to see what's there and e.g. `cd pkg-list` to change to the directory with those package list files you made.

and run:
 

where "desktop" is the name of a file with package names.

Note: you'll need the network up! If with LAN cable it should connect without any work. If wireless network, you will need to edit the /etc/network/interfaces file to show your SSID and pass phrase - see Enable wireless below.

Another way would be to chroot into the new install from another Debian install, as I mentioned already.

And you could also make some scripts to automate the process somewhat, and to save forgetting anything - see my basic example on my LXDE fast install page.


XFCE Desktop

Apologies for anything that no longer works!!! I don't run Xfce any more and so I can't really make corrections here.

To install a fully-functioning XFCE desktop, enter this on the command line:
 


I took out synaptic apt-xapian-index gdebi as I hardly need them (package manager, and gui package installer)

This gets you a window manager, light desktop, display manager (login), network manager, power manager, browser, text editor and a cool terminal.

For a web browser, there's midori (memory light), or others on my Step4 page.

wicd is an alternative to network-manager-gnome (but the latter may handle mobile/vpn better).
lightdm is your best choice of display manager. Gnome's gdm3 comes with bloat of dependencies.
firestarter is no longer maintained, so you are better off using iptables for firewall.


LXDE Desktop

To install LXDE, (Lightweight X Desktop Environment) a slightly less memory-hungry desktop, enter this on the command line:
 


lightdm to be prefered over xdm, and gdm3 comes with a gnome dependency bloat.

I took out synaptic apt-xapian-index gdebi as I hardly need them.

Again, you can choose between chromium, iceweasel and midori, you have wicd instead of network-manager-gnome, and you can set up ip tables instead of firestarter (see my firewall page)

It's possible to run openbox alone without installing the lxde package (but just the parts of it you might need) and without even a Display Manager (login screen etc), but its a little complex to set up unless you're handy with Debian already.

To do that I leave out lxde and lightdm, and add instead: openbox lxpanel lxtask leafpad. Then at boot, when reaching the command prompt, just type "startx" and Enter. But you may have problems with Xorg display permissions if you opt out of installing a display manager -see Xorg issue

Warning! this is not perhaps a good idea for beginner Debian users. Installing LXDE will be more straightforward. But see see my page, plain openbox if this is the way you want to go!


In case you ran Netinstall without an internet connection, you will need to check that these packages are installed (check anyway):
 





Install Thunar file manager

Thunar is the best light-weight graphical file browser in my opinion, beating the default LXDE file manager, because of its ability to carry out possibly any action whatsoever on files through its custom right-click menu actions. There are more powerful file browsers about, such as Dolphin or Krusader (both KDE), but you should look at this one first, and see my custom actions on my thunar page. For example, Krusader can do some picture resizing actions - but you need the KIO plugins installed, whereas with thunar, all you need is imagemagic (a small program) and a few custom actions and you can resize pic's with two clicks - or resize a whole directory of pic's, even recursively.

There are alternative file browsers too, such as xfe (with no bookmarking except your own real symlinks), gentoo (two pane with task buttons), emelfm2 (lots of task buttons), and rox-filer (very basic graphical).

But for those bored of GUI mouse-clicking browsers there's Ranger, a file browser which runs in a terminal window (takes up my 2nd desktop in full screen) - see my ranger page.

 



Additional installs

Prepare for bluetooth, NTFS and FAT32 support, ssh, archiving, Java, printing, pgp, time, screens
 

(note that the opensource java, openjdk and icedtea actually change their pkg name with each new version)



before booting into the desktop, you could set up the wireless and edit your sudoers file (see below)




Sudoers file

To give your user(s) super-user priveleges, they need to be added to the sudoers file. This means that they can run commands with 'sudo' infront to do things as super-user (nearly root) with their user password.

as root still (and if you already rebooted then you need to open a Terminal and "switch user" to root, with the command 'su' and enter the root password), run "visudo" with,
 
which will allow you to safely edit the sudoers file using the friendly nano editor (otherwise you'll have to learn vim if you run just `visudo`)

and you can either add this line after the root's line:
 

but the more recommended practice is to add the sudo group to sudoers, so that the file doesn't fill up with dozens of user names, like this:
 

note: if you add a user name line with "ALL=(ALL:ALL) ALL" under the %sudo group line, it will supersede the group line, so that the sudo group actually won't be effective!

write to file by Ctrl-X, y, Enter

and if you added the sudo group to sudoers, you must add your user(s) to the sudo group!
 

Note: if there's no "sudoers" file just install sudo.




Enable the wireless

If you don't have the wireless firmware installed yet, first identify the wireless chipset, using this command
 
Then go to the Debian Wi-Fi page (and you'll need to reboot into the Desktop to get to the internet) https://wiki.debian.org/WiFi#PCI_Devices and find the correct firmware for your device.

If the firmware is included in the kernel, but wireless still doesn't work, check the interfaces file below, and check that your wireless interface is wlan0 or wlan1 (with wicd you need to set this in Preferences).
 

comment out everything except the lines (i.e. insert a '#' before each line to comment out)
 

check if user is added to netdev group with
 

and add your user to that group if it wasn't listed with above command
 

then restart networking with:
 
or just reboot into the desktop

Then do
 

or sometimes using `wlan1`, depending on your wireless hardware.

Note: you can check what device it is using `ifconfig` (my wireless changed to "wlp3s0")




Add groups

While you're adding groups, here's some more you'll probably need: dialout plugdev lpadmin admin clamav fuse audio

to add user to a new group, make the group, e.g., as root do
 

then add the user,
 

to add them all in one go, use something like this:
 
where the -f option prevents groupadd from stopping if the group already exists.




Auto-mount partitions at boot time (fstab file)

Linux uses a small file called "fstab" to list disk partitions so the system can mount them with any particular options/permissions. You need to make this file tidy so that your partitions are nicely mounted at boot (those you want mounted) and you can read/write to them without the file manager saying "not authorized" etc.

Note: to write to NTFS file systems you need ntfs-3g (install line above)

Find the disks and their sizes on system to note their device names (e.g. sda2)
 

List the uuid's of disks
 

You need to add an fstab entry for each harddisk partition that wants mounting at boot. So open the fstab file with:
 

First of all, you can omit the USB or DVD device lines that might have been added during the install.
Don't touch the lines for your linux install (mounted on /) or home partition (/home), or swap, and don't give two lines the same mount point (especially not both "/")!

example of line for NTFS partition
 

example of a data partition with ext3 format
 

create mounts for any partitions you added that are mounted in /media, e.g.
 

and mount the partitions to the mount points (or you can reboot), e.g.
 
(my examples)

check the partitions are mounted with:
 

If you can't write to the partition (it's read-only):
 

If your installation CD (e.g. Debian Live Build) left you with NO fstab file at all, you will need to add good root, home (if separate) and swap lines above the ones for data partitions.

example (tab separated):
 

currently, I put /var on its own partition as the contents change quite a lot (e.g. apt cache) and / is on a solid state disk that shouldn't need so many write operations
 

since Debian 7 /tmp is on tmpfs (RAM) so it doesn't need moving to another partition


If using a swap file instead of a partition, the correct fstab line will look like this:
 


Note: if changing from a swap partition to using a swapfile, you need to edit the file /etc/initramfs-tools/conf.d/resume and replace the UUID entry with /swapfile.

then do, as root
 


there's an fstab documentation here ..ubuntu.com/community/Fstab


And that's it for installing the desktop, you can boot into it now hopefully.

unmount any usb device that you might have used files from, with 'umount /mnt'
then type 'reboot' to terminate processes and boot into your new desktop!




Quick desktop settings


Get sound working:

In XFCE, add Mixer to the panel and Left click on it, to open Alsa Mixer, then add 'master', 'speaker', 'PCM', 'Pc Beep' (so as to silence it!) and check unmute sound.

In LXDE, add Volume Control applet, right-click on it and open settings.

Check that your user is in the audio group with `groups <user>`


Display: select theme, Tango icons or whichever you like

Set power options: like close laptop lid suspends PC or turns off the display, critical battery warning, inactivity time, screen sleep time, uncheck lock screen, etc.

Removable media: in the file manager settings, check auto mount when hot-plugged or inserted


XFCE problem: on login, the default session shows Xsession, not Xfce, so open a file

 
and edit   'user-session=lightdm-xsession'  -->   'user-session=xfce'

or uncomment the line "#usersession=default" (remove "#") and change "default" to xfce




Install build dependencies


Get dependencies needed for building software from source (you could leave this for another time).
 

Note: bear in mind that the build dependencies will need updating all the time, whenever you have to build from source, to enable compiling without meeting dependency problems. All you have to do is run the above command again and all that needs updating will be, but do remember to run 'apt-get update' first.




Next page:

Step2 - video editors, ffmpeg, XnViewMP, Libre Office