randombio.com | computer notes Tuesday, March 28 2023 Installing and configuring Debian 11.5Many problems with solutions. But nothing a big enough paper clip can't handle |
Debian is one of the best versions of Linux for scientific uses. Unlike others, it provides a vast amount of software such as R, Bioconductor, autodock-vina, and Scilab. This saves you from the frustration of trying to compile things and resolve dependencies—which is still a challenge in Linux. The only drawback is that its installation software is buggy.
This article describes the rough spots you may encounter in trying to install and configure Debian 11.
While it's possible to download and install a stripped-down version for a single DVD, this abrogates the main benefit of Debian, which is its size and completeness. Most people will want at least the first three DVDs. Those are no longer available online, and must be purchased. The best option is to buy the complete set of 19 DVDs. You'll also need a functioning Internet connection and a bent paper clip. I recommend a size #1, or "large".
Do an inventory of your hard drives before starting. If you're upgrading, make
sure you know which drives you want to save and which partition you want
to boot from. Since drive names can change in Linux, you need the Disk
Identifier or Disk model. The easiest way to get that is to type
/usr/sbin/fdisk -l
(as root, letter 'l'
=list)
and print out the list. Take note of which one has the word "boot" next
to it.
If you're switching from Windows, you could get this from the Device Manager. But in all honesty, I never heard of anyone trying to keep a Windows NTFS-formatted partition in Linux.
The Debian installer has trouble with DVDs. It takes control of the DVD tray, disables the eject button, and then asks you to insert the next DVD, but doesn't open the tray. Avoid the temptation of clicking 'Back' or unplugging the DVD (in the case of a USB version). In every computer I've used, I had to open the tray manually with a paper clip.
The rest of the installation is uneventful, though it's a bit tiring to paperclip the DVD drive 19 times. When it gets to the end it tells you to put DVD #1 in the tray, even if DVD #1 is already there. This doesn't mean your DVD is damaged; it means it's finished installing. Click 'Back', then 'Continue'. It will grumble a bit and proceed to the next step, which is to install the Grub boot manager. Make sure you select the right partition to put it on, otherwise you'll have to go into the Bios and select it each time you reboot.
Another trick is that after the first boot, you should not go directly
to installing software. Configure the network first so that you can access
the Internet. Test it by typing host security.debian.org
to
make sure you can resolve Internet addresses before starting. Anything
with a pink spiral next to it in Synaptic
(the graphical
package installer) requires this, and they often get selected automatically
without your knowledge.
The last step is to make sure your /etc/profile
is set up so
the installer can find ldconfig
. Test it by becoming root and
typing
which ldconfig
It should say
/usr/sbin/ldconfig
If not, you need to put /usr/sbin
in /etc/profile
and source it by typing . /etc/profile
. (A dot followed by
a space means "source".)
If you skip these steps, Synaptic will likely bomb out when you try to install
software. Normally it will re-try, but if it can't access that website or
run ldconfig
it will just stop dead, and your long list of
software that you selected will be un-installable. And it will be a long
list: there are 19 DVDs, and you should scan all 19. Someday Debian will
switch to thumb drives, but it's not there yet.
Once you're sure the machine can boot up correctly, and all the above steps
are done, start /usr/sbin/synaptic
(as root) and install your
software a few pieces at a time. This will help avoid the possibility of
hitting a "fix broken packages first", "failed", or the dreaded "an error
occurred" message, which means you have to start package selection over.
A package 'breaks' when Synaptic can't run ldconfig or reach the internet.
To fix this, quit Synaptic, set the path for ldconfig, start Synaptic again,
and select 'fix broken packages' entry in the menus. It converts the red boxes
to green boxes, indicating that it's installed, but it's not really installed.
Click "apply", and it will try to install it again.
You might think that Synaptic would know where ldconfig is located, since it just installed it. But apparently not.
A minor gripe is that there's no way to select groups of packages. For instance, there are 1,900 packages for Go language, 3,875 for the Glasgow Haskell compiler, 5,500 for python, and 1,075 packages for R-cran (the statistics program whose name is a single letter, making it tough to find on the Internet) and it would be a royal pain to click on each of them. There is also no way to "select all" in the list as in some other distributions. On the plus side, Synaptic will eventually resolve most or all the unresolved dependencies, and best of all you don't need your paper clip to do it. (But save it, you will probably need it again.)
Trying to install everything you need at once only increases the chances of hitting a fatal error. I always make a printed list of the packages that I often need. Here are the command lines to do it (as root):
# apt list --installed > stuff
# chown yourname.yourgroup stuff
$ cat stuff | grep -v automatic > debian-installed-packages-list.txt
The last line gets rid of the ones that are installled automatically, reducing the list (in my case) from 4288 to 699 packages. With patience, it's even possible to install Bioconductor this way, but I had better success going through CRAN, using R commands like this (within R):
install.packages("ssizeRNA", dependencies=TRUE, repos='http://cran.rstudio.com/')
install.packages("nlme", dependencies=TRUE, repos='http://cran.rstudio.com/')
if (!require("BiocManager", quietly=TRUE)) install.packages("BiocManager")
BiocManager::install("ssizeRNA")
Most other distributions don't include Bioconductor, but Debian gives you a choice. Doing it within R can be a challenge, because lots of R packages won't even compile. Oh, I almost forgot: make sure to install the C++ and Fortran compilers as well as Python.
Now on to the problems.
Cinnamon or other window manager can't log in
Symptom: On boot-up, it goes directly to runlevel 5 (graphics + network).
The Window Mangler comes up. You type the correct name and password. After
a few seconds, the login prompt appears again with no hint of what's wrong
and no way to reboot.
Cause: This can occur when you re-install Linux but keep the same home partition. If the OS assigns you a different user ID than you had before, many window managers won't let you log in and won't tell you why.
Solution: Click on the Gear icon that shows up when you enter your username
and select Gnome if possible. If that doesn't work, you can boot up in Repair
mode. Get to the command line, navigate to your home directory, and type
chown -R myusername:myusername .
(the dot is essential.)
If that doesn't work, as a temporary emergency fix, you may need to use
chmod u+rwx /home/myusername
or even chmod a+rwx /home/myusername
to fix the permissions. Don't set the entire hard drive to 777 as our Linux
consultant did. That would stop everything from working.
Network Manager not working
Symptom: When setting up network on a system with two interfaces, changes in
one interface also silently show up in the other, gaslighting you into thinking
you typed your IP in the wrong place.
Cause: The Network Manager automatically knows about your network interfaces, but doesn't know they need to be configured independently. This is an obvious bug.
Solution: Click on "Add new interface"
gnome-software using up CPU
Symptom: Some process named gnome-software
keeps running,
driving the CPU system load up to 1.0.
Solution: This software seems to perform no function and there's no explanation
how it got started. Use kill -9
to get rid of it.
Opera browser sending out network traffic
Symptom: Since Firefox and its derivatives still cause Linux to hang, we
have to use Opera. When Opera starts up, network traffic shoots up even
before I open a web page. Can't find anything in the settings to stop it.
Solution: Use Waterfox in Windows.
Only two fatal problems and you're only one paper clip short. Not bad for Linux.