Difference between revisions of "Debian"

From Organic Design wiki
(See also: Debian with onion, takeaway style!)
m (Issues)
(39 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[File:Debian-logo.svg|100px|right]][http://www.debian.org/intro/about Debian] is a free operating system using the [http://www.kernel.org Linux kernel], but most of the basic OS tools come from the [http://www.gnu.org GNU project]; hence the name GNU/Linux. At Organic Design we install Debian on our [[server]]s using the [[install a new server]] [[procedure]], and have been using it for over ten years.
+
[[File:Debian-logo.svg|100px|right]][http://www.debian.org/intro/about Debian] is a free operating system using the [http://www.kernel.org Linux kernel], but most of the basic OS tools come from the [http://www.gnu.org GNU project]; hence the name GNU/Linux. At Organic Design we install Debian on our [[server]]s using the [[install a new server]] [[procedure]], and have been using it since around 2005.
  
As of June 2013 we decided to change from [[Ubuntu]] to Debian for our workstations as well since Ubuntu is increasingly becoming the "microsoft of the free software world" with pay software and services at every corner and [http://www.fsf.org/blogs/rms/ubuntu-spyware-what-to-do compulsory spyware] riddled throughout system.
+
In June 2013 we decided to change from [[Ubuntu]] to Debian for our workstations as well since Ubuntu is increasingly becoming the "microsoft of the free software world" with pay software and services at every corner and [http://www.fsf.org/blogs/rms/ubuntu-spyware-what-to-do compulsory spyware] riddled throughout system, see [[Debian legacy issues]] for notes about various issues and solutions encountered back then. But then in early 2014 we changed to [[Linux Mint]] for our workstation machines, mainly due to the fact that they're very up to date with their choice of Linux kernel version which allowed me to use my touch-screen on my [[Samsung ATIV Smart PC Pro (XE700T1C)]] and fixed a long-standing bug on Beth's [[Lenovo Ideapad S10-3]] which prevented it from resuming from standby. As of mid 2019 we've moved back to Debian again because Mint's Cinnamon desktop is stuck on an insecure path through its dependence on Xorg whereas most desktop managers are now moving to the more secure and slim [[w:Wayland (display server protocol)|Wayland]] display server. With the recent release of Debian 10, I decided to move back and give it a try!
  
== Installation ==
+
== Gnome3 extensions and addons ==
[[File:Bad Windows and Ubuntu.svg|200px|right]]Installation is covered [http://www.debian.org/releases/stable/i386/apas02.html.en here] and for our typical situation involves downloading the first of the [http://cdimage.debian.org/debian-cd/7.0.0/amd64/iso-dvd/ amd64 DVD iso images] and copying it onto a memory stick using the following commands from a root shell where X is the number of the device that the USB stick is on which can be obtained from ''dmesg'' or ''df'' etc. Note that the numbers on the end of devices such as ''/dev/sda'''1''''' refer to the partitions within the device, but the boot record is outside of any specific partition, so the number must be excluded in the command to refer to the device as a whole.
+
[[File:Gnome3 on Debian10.jpg|right|600px]]I don't really like Gnome much, I prefer Cinnamon, but the problem is that Cinnamon is not very secure since it's stuck on the old xorg desktop manager. Here are some things that can be done after installing a Gnome3 based system to make it a bit more familiar.
{| width=400
+
* install the gnome icon color packages via apt
|{{code|<bash>
+
* install the following Gnome extensions:
umount /dev/sdX
+
** [https://extensions.gnome.org/extension/1160/dash-to-panel/ Dash to Panel] ''- makes a proper panel with favourite and loaded apps''
cp debian.iso /dev/sdX
+
** [https://extensions.gnome.org/extension/608/gnomenu/ Gno Menu] ''- adds a good menu to the panel''
sync
+
** [https://extensions.gnome.org/extension/615/appindicator-support/ KStatusNotifierItem/AppIndicator Support] ''- adds the familar background app status icons to the panel''
</bash>}}
+
** [https://extensions.gnome.org/extension/800/remove-dropdown-arrows/ Remove Dropdown Arrows] ''- removes ugly dropdown menu arrows from the panel''
|}
+
** [https://extensions.gnome.org/extension/355/status-area-horizontal-spacing/ Status Horizonal Spacing] ''- removes excessive spacing between icons in the panel''
 +
** [https://extensions.gnome.org/extension/1112/screenshot-tool/ Screenshot Tool] ''- adds screenshot tool to panel''
 +
* use the Tweaks utility to change icon colours, add an applications menu and window buttons and configure extensions, remove extensions [https://extensions.gnome.org/local/ here].
  
== Required utilities and libraries ==
+
== Issues & gotchas ==
{{code|<bash>apt-get install build-essential autoconf libtool subversion git python-qt4</bash>}}
+
* root's default paths are missing, so either add e.g. <tt>export PATH=$PATH:/usr/sbin</tt> to root's '''.bashrc''', or <tt>/usr/sbin/usermod -a -G sudo user</tt> and use ''sudo'' instead of ''su''
 +
* I need to restart and enter my drive-unlock password twice for every damn update! Don't know if this is Debian or Gnome3, but it's discussed [https://gitlab.gnome.org/GNOME/gnome-software/issues/181 here] and [https://ask.fedoraproject.org/t/gnome-software-center-wants-me-to-restart-to-install-updates/1283/10 here]. GNOME software comes with Software & Updates. Software & Updates can be removed and replaced with GNOME Package Updater.
 +
* Gnome3 has changed the touchpad default behaviour, now to do a right-click you tap with two fingers, you can revert to the old area-based behaviour using Tweaks
 +
* My internal Atheros bluetooth device suddenly disappeared, it came back after I installed the latest firmware from [http://ftp.us.debian.org/debian/pool/non-free/f/firmware-nonfree/ ftp.us.debian.org].
 +
* [https://askubuntu.com/questions/1131885/help-w-possible-missing-firmware-lib-firmware-i915-kbl-guc-ver9-14-bin-for-mo/1132350#1132350 Possible missing firmware /lib/firmware/i915]
 +
* GDM has been replaced by LightDM now so to set e.f. auto login, uncomment the relevant line in ''/etc/lightdm/lightdm.conf''
  
== Post install checklist ==
+
== Improvements over Mint/Cinnamon ==
This is my personal checklist of items I do after a fresh installation of Debian 7 to get everything I use running and to get it looking the way I like it :-)
+
* It still has the problem of not standing by when using bluetooth 3G, but seems to work better
*Advanced settings (then add all buttons to windows from shell menu, also fonts, see below)
+
* The USB 3G stick setup was easy and works well
*Keyboard (add '''US, Alternative International''' and then [[Brazilian keyboard settings|fix the Cedilla]])
 
*[[Geany]] (the local page shows context-action, colour and line-spacing tweaks)
 
*VLC
 
*Pidgin (with OTR and plugin pack and copy backed up .purple after install)
 
*Icedove (Thunderbird - '''apt-get install icedove enigmail''')
 
*Skype (details on installation from the i386 .deb with MultiArch [http://wiki.debian.org/skype#Debian_7.0_.22Wheezy.22 here] - note it says sound crashing needs ''libpulse0:i386'' too, or try ''libasound2-plugins:i386'' if still crashing)
 
*World clock (zones in ''~/.tzlist'', use custom format ''%H:%M (%A)'' - the annoying window-size bug is not present in Debian)
 
*Go to details in system settings and set the default programs
 
*[[Bitmessage]] (needs python-qt4 and install the local email client support)
 
*Fonts - all the fonts looked a bit ugly, in advanced settings I changed them to plain DejeVu Sans Semi-condensed, reduced to 10pt and changed the hinting to "slight", and the monospace font to Liberation Mono 9pt.
 
*Icons (gnome-brave-icon-theme, then set in advanced settings/theme)
 
*[[Transmission]] (apt-get install transmission-qt)
 
 
 
After that checklist is done here's what it looks like:
 
 
 
[[File:Debian7 desktop.png|800px]]
 
 
 
== SSD optimisation ==
 
I've had one too many mechanical disk failures and have finally decided to move over to SSD. They still have a long way to go as a technology since they still suffer from the major problem of flash technology in general which is that each memory bit can only be written to a thousand times (3 thousand on the most recent technology). So I'm just going to get a small cheap one initially and hopefully in six months or so they'll be longer lasting and more practical sizes. I've started with a 120GB Samgsung 840 series, for [http://thewirecutter.com/reviews/the-best-laptop-ssd-for-most-is-the-samsung-840/ these reasons]. Most of the following optimisation tips are taken from [http://wiki.debian.org/SSDOptimization?action=show&redirect=SSDoptimization SSD optimisation] in the Debian wiki, and another good artile [https://wiki.archlinux.org/index.php/Solid_State_Drives here] in the Arch Linux wiki.
 
 
 
=== Swap ===
 
Most systems these days have enough RAM that they rarely ever use the swap file at all unless there's a bug that chews up memory. If you have 4GB or more you may as well disable the swap partition completely from ''/etc/fstab'' or by installing your OS with no swap in the first place.
 
 
 
I upgraded my RAM to 8GB when I got the SSD and then installed Debian 7 with no swap by electing to manually set up my partitions and then making a single primatry partition that occupies the entire disk. The installer strongly warns against continuing without a swap partition, but allows you to continue and installs fine without it.
 
 
 
=== Mount options ===
 
There are some important mount options that should be enabled in ''/etc/fstab'' for the filesystem on SSD paritions. The filesystem should be ''ext4'' not ''ext3'' to work well with an SSD.
 
*'''discard:''' SSD's use the [[w:TRIM|ATA TRIM command]] for sustained long-term performance and wear-leveling, but it needs to be activated by adding the ''discard'' mount option.
 
*'''noatime:''' Use this option to prevent logging of read accesses to the file system via an update to the ''atime'' information associated with the file.
 
*'''commit=N:''' Set this to the number of seconds to wait before committing changes to the physical storage. By waiting longer before performing a journal commit multiple writes are often performed in one go. This option is often ised on laptops when running on battery to reduce the number of spinups for the drive saving power.
 
 
 
=== Using RAM disk ===
 
To mount ''/tmp'' and ''/var/log'' in RAM. Add these lines to the end of ''/etc/fstab'' to mount them in ''tmpfs'' (temporary file system). Debian-based operating systems already mount ''/var/run'' and ''/var/lock'' to RAM-disk by default.
 
{{code|<pre>
 
tmpfs /tmp    tmpfs defaults,noatime,mode=1777 0 0
 
tmpfs /var/log tmpfs defaults,noatime,mode=1777 0 0
 
</pre>}}
 
 
 
Save, then ''sudo mount -a'' and reboot for the changes to take effect. Running ''df'', you should see a new line with ''/tmp'', and ''/var/log'' mounted on ''tmpfs''.
 
 
 
My current ''/etc/fstab'' file looks as follows, I used slightly different parameters than those recommended above so they matched those already being used for the ''/var/run'' and ''/var/lock'' mount points.
 
{{code|<pre>
 
UUID=123****789 /        ext4  noatime,discard,commit=60,errors=remount-ro  0  1
 
tmpfs          /tmp      tmpfs  rw,nosuid,nodev,noexec,relatime              0  0
 
tmpfs          /var/log  tmpfs  rw,nosuid,nodev,noexec,relatime              0  0
 
</pre>}}
 
 
 
 
 
Another long regularly changing log file I found was ''.xsession-errors'' in my home directory. I moved this into ''/var/log'' which is in RAM disk by editing ''/etc/X11/Xsession'' and changing the ''ERRFILE'' setting to:
 
{{code|<pre>ERRFILE=/var/log/.xsession-errors</pre>}}
 
 
 
=== Digital coin log files ===
 
The ''debug.log'' files in the digital coin apps such as [[Bitcoin]], [[Litecoin]] and [[Namecoin]] reside in the user's data directory and are very active files which on an SSD are best in RAM. These files can be linked to the ''syslog'' which is in RAM (if the configuratons above have been done). Or even linked straight into ''/dev/null''.
 
 
 
=== Creating log files on startup ===
 
Some services will fail to start if theor log files or directories don't exist. I added a few lines into their startup scripts in ''/etc/init.d'' in their "start" case to fix this. The ones I had to do this for were as follows.
 
 
 
;Nginx
 
{{code|<bash>
 
if [ ! -d "/var/log/nginx" ]; then
 
  mkdir /var/log/nginx
 
fi
 
</bash>}}
 
 
 
 
 
;MariaDB
 
{{code|<bash>
 
if [ ! -d "/var/log/mysql" ]; then
 
  mkdir /var/log/mysql
 
  touch /var/log/mysql/mariadb-bin.index
 
  chown -R mysql:mysql /var/log/mysql
 
fi
 
</bash>}}
 
 
 
=== SSD links ===
 
*[http://www.anandtech.com/show/7203/samsungs-3d-vertical-nand-set-to-improve-nand-densities Samsung's new VNAND technology]
 
 
 
== Iceweasel (Firefox) ==
 
Mozilla's conditions for use of their trademarked names require that distro's using their products clear any patches with them first, but in Debians view this compromised their own strict seurity measures so rather than this they opted to hange the branding of the products. Debian's fork of [[Firefox]] is [http://wiki.debian.org/Iceweasel Iceweasel].
 
 
 
'''Language:''' Install the ''en_GB'' languages and if ''en_US'' keeps re-establishing itself as the default, you can forcefully remove the ''en_US*'' files from ''/usr/lib/xulrunner-*/dictionaries/''.
 
 
 
=== Addons ===
 
*[https://addons.mozilla.org/en-US/firefox/addon/3006 Download Helper] ''- download videos from youtube and other online video content sites''
 
*[http://www.getfirebug.com/docs.html Firebug]
 
*DoNotTrackMe (from [https://www.abine.com/dntdetail.php here]) or Ghostery (from [http://www.ghostery.com here])
 
*Flash player (apt-get install flashplugin-nonfree)
 
 
 
=== Disable page prefetching ===
 
Firefox downloads webpages from links it thinks you may click. This may make the experience seem faster but really it just bogs down Firefox and your netbook. Type ''about:config'' in the address bar, then set ''network.prefetch-next'' to ''false''.
 
 
 
== Centrino Wireless-N 1030 ==
 
This was not included by default in the first installation DVD of Debian 7 so I had to do the following after installation. If I had had a LAN cable at the time te installer could actually have retrieved the necessary driver for me and installed it, but I only had wifi access, and that was the thing that needed fixing so I had to continue installation and deal with it afterwards.
 
{{code|<bash>
 
echo "deb http://http.debian.net/debian/ wheezy main contrib non-free" >> /etc/apt/sources.list
 
apt-get update
 
apt-get install firmware-iwlwifi
 
modprobe -r iwlwifi ; modprobe iwlwifi
 
</bash>}}
 
 
 
== Bluetooth ==
 
I found that I couldn't get any of my bluetooth devices to pair in the default install of Debian 7. The devices would show up in the detected list and the pairing process would initiate properly, but would then fail to complete. Using the ''bluez'' tools from the terminal worked though with the following procedure I found [http://www.ctheroux.com/2012/08/a-step-by-step-guide-to-setup-a-bluetooth-keyboard-and-mouse-on-the-raspberry-pi/ here]. Strangely, after I got the first thing (my mouse) working with this process, then my phone was able to pair from the GUI as normal even though it had failed prior to getting the mouse to work.
 
{{code|<bash>hcitool scan</bash>}}
 
This process gives you the MAC address of your device which you can then begin the pairing process with as follows. This will ask you for the pin which you type in to your device etc or use ''0000'' if it's a device like a mouse or headset.
 
{{code|<bash>bluez-simple-agent hci0 12:34:56:78:9A:BC</bash>}}
 
 
 
 
 
You then make the device trusted so that it can automatically connect in future:
 
{{code|<bash>bluez-test-device trusted 12:34:56:78:9A:BC yes</bash>}}
 
 
 
 
 
And then finally, connect to the device:
 
{{code|<bash>bluez-test-input connect 12:34:56:78:9A:BC</bash>}}
 
 
 
 
 
It should now be shown as normal in the bluetooth menus and settings window and should connect automatically when the session starts.
 
 
 
== DVD::Rip ==
 
We like to use [http://www.exit1.org/dvdrip DVD::Rip] for converting DVDs into a single video file for simpler viewing and transportation. Detailed information about the first time setup and optimal settings is in our [[DVD format conversion]] article, but here is some specific information for what I needed to do to install it on Debian 7 as there were no sources available for using APT.
 
 
 
I needed to compile it from source, so I needed to install the ''make'' tools, and also the required dependency ''transcode'' was not installed by default on the system.
 
{{code|<bash>apt-get install build-essential transcode</bash>}}
 
 
 
Also I was unable to use ''libdvdcss'' from VideoLAN, but found that ''libdvdcss2'' worked which is available from the ''deb-multimedia.org'' software source.
 
{{code|<bash>
 
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
 
apt-get update
 
apt-get install libdvdcss2
 
</bash>}}
 
 
 
 
 
When I first tried to build it I came across a missing Perl dependency called ''Locale::TextDomain'' so I installed this with ''CPAN'' as follows:
 
{{code|<pre>perl -MCPAN -e shell
 
> install Locale::TextDomain</pre>}}
 
 
 
Then ''cd'' into the downloaded and unpacked ''dvdrip'' source directory and build it as follows:
 
{{code|<bash>perl Makefile.PL
 
make
 
make test
 
make install</bash>}}
 
 
 
Finally you can modify the example ''.desktop'' file that comes with the source to point the ''Exec'' field to the ''bin/dvdrip'' file and the ''Icon'' field to point to the nice ''SVG'' icon that comes with the source, then copy it into your ''.local/share/applications'' directory as usual.
 
 
 
Then go to the [[DVD format conversion]] article for instructions on first time setup and best ripping settings and practices.
 
 
 
== Distribution upgrade ==
 
To upgrade Debian, first ensure that there are no conflicting or held back packages. If there are, these issues are best sorted out first.
 
{{code|<bash>dpkg --audit
 
dpkg --get-selections | grep hold</bash>}}
 
Then run ''aptitude'' and press "g" and only carry on when you have the message "No packages are scheduled to be installed, removed or upgraded".
 
 
 
Next change all your sources over in ''/etc/apt/sources.list'' from the old distro name such as ''squeeze'' to the new one such as ''wheezy''. And then do the upgrade in two steps, first upgrade the packages and then do the ''dist-upgrade'' as follows:
 
{{code|<bash>apt-get update
 
apt-get upgrade
 
apt-get dist-upgrade</bash>}}
 
 
 
It's best to use the package maintainer's version of any updated configuration files it mentions. You can have a second shell window open so you can check the changed parts of the configuration that have changed and back them up or copy them across to the freshly created version.
 
  
 
== See also ==
 
== See also ==
*[https://tails.boum.org/about/index.en.html Tails] ''- Debian with onion, takeaway style!''
+
*[[Debian legacy issues]]
*[[Linux migration checklist]]
+
*[[Install a new desktop]] ''- our procedure for what to install and configure on a local workstation after the bare OS is installed''
 
*[[GNOME]]
 
*[[GNOME]]
 
*[https://wiki.debian.org/Gnome Gnome page on Debian wiki]
 
*[https://wiki.debian.org/Gnome Gnome page on Debian wiki]
 
*[http://www.linux-watch.com/news/NS3128387759.html Etch release delayed by financial arguments]
 
*[http://www.linux-watch.com/news/NS3128387759.html Etch release delayed by financial arguments]
*[[gNewSense]]
+
*[https://tails.boum.org/about/index.en.html Tails] ''- Debian with onion, takeaway style!''
 +
*[http://www.tuxera.com/community/ntfs-3g-faq/#unprivileged Permissions problems mounting NTFS devices]
 +
*[https://www.zdnet.com/article/debian-10-buster-linux-arrives/ ZDnet on Debian Buster]
 +
*[https://www.reddit.com/r/gnome/comments/9gmy1z/since_top_icons_plus_isnt_maintained_anymore_and/ Top 20 Gnome extensions]
 
[[Category:Linux]][[Category:Debian]][[Category:Libre software]]
 
[[Category:Linux]][[Category:Debian]][[Category:Libre software]]

Revision as of 07:26, 16 March 2020

Debian-logo.svg

Debian is a free operating system using the Linux kernel, but most of the basic OS tools come from the GNU project; hence the name GNU/Linux. At Organic Design we install Debian on our servers using the install a new server procedure, and have been using it since around 2005.

In June 2013 we decided to change from Ubuntu to Debian for our workstations as well since Ubuntu is increasingly becoming the "microsoft of the free software world" with pay software and services at every corner and compulsory spyware riddled throughout system, see Debian legacy issues for notes about various issues and solutions encountered back then. But then in early 2014 we changed to Linux Mint for our workstation machines, mainly due to the fact that they're very up to date with their choice of Linux kernel version which allowed me to use my touch-screen on my Samsung ATIV Smart PC Pro (XE700T1C) and fixed a long-standing bug on Beth's Lenovo Ideapad S10-3 which prevented it from resuming from standby. As of mid 2019 we've moved back to Debian again because Mint's Cinnamon desktop is stuck on an insecure path through its dependence on Xorg whereas most desktop managers are now moving to the more secure and slim Wayland display server. With the recent release of Debian 10, I decided to move back and give it a try!

Gnome3 extensions and addons

Gnome3 on Debian10.jpg

I don't really like Gnome much, I prefer Cinnamon, but the problem is that Cinnamon is not very secure since it's stuck on the old xorg desktop manager. Here are some things that can be done after installing a Gnome3 based system to make it a bit more familiar.

  • install the gnome icon color packages via apt
  • install the following Gnome extensions:
  • use the Tweaks utility to change icon colours, add an applications menu and window buttons and configure extensions, remove extensions here.

Issues & gotchas

  • root's default paths are missing, so either add e.g. export PATH=$PATH:/usr/sbin to root's .bashrc, or /usr/sbin/usermod -a -G sudo user and use sudo instead of su
  • I need to restart and enter my drive-unlock password twice for every damn update! Don't know if this is Debian or Gnome3, but it's discussed here and here. GNOME software comes with Software & Updates. Software & Updates can be removed and replaced with GNOME Package Updater.
  • Gnome3 has changed the touchpad default behaviour, now to do a right-click you tap with two fingers, you can revert to the old area-based behaviour using Tweaks
  • My internal Atheros bluetooth device suddenly disappeared, it came back after I installed the latest firmware from ftp.us.debian.org.
  • Possible missing firmware /lib/firmware/i915
  • GDM has been replaced by LightDM now so to set e.f. auto login, uncomment the relevant line in /etc/lightdm/lightdm.conf

Improvements over Mint/Cinnamon

  • It still has the problem of not standing by when using bluetooth 3G, but seems to work better
  • The USB 3G stick setup was easy and works well

See also