Eine kurze Bemerkung zu Kubuntu 20.10 und KDE und Linux Mint 20 XFCE4 (u. a.)…

Okay, das ist jetzt keine wissenschaftliche Betrachtung, schon gar keine tiefgehende Analyse, aber eine Darstellung meiner Erfahrungen der letzten ein bis zwei Monate.

Meine Hardwarebasis waren dabei ältere Lenovo- sowie HP-Notebooks, auf denen ich mehrere Distributionen ausprobiert habe. Konzentriert habe ich mich dann auf die Distros, die nicht schon beim Setup massive Probleme gemacht haben. Und das waren viele! Übriggeblieben sind:

  1. Linux Mint: Funktionierte immer, einfache Einrichtung, schnelle Aufnahme der eigentlichen Einrichtungsarbeiten, problemloses Installieren der benötigten Software, entweder über die gut ausgestatteten Repositorys, direkte Downloads von der Anwendungshomepage oder selbstkompilieren der Software. Alles kein großes Problem.
  2. Kubuntu: Wie unter 1., aber… Dazu gleich.
  3. Oracle Linux: Sehr, sehr dünn besiedeltes Repository, komplizierte Installation von Software, bei der oft massenhaft Pakete (insbesondere Librarys) recherchiert, mühsam gefunden und installiert werden mußten, bis etwas lief. Es war nicht einmal möglich, unter Chromium oder Firefox alle Videos im Web anzuschauen, es fehlten Codecs und andere Dinge, und der marktschreierisch angepriesene, angeblich unbreakable Kernel rettet einen natürlich nicht vor Abstürzen mehr oder weniger wichtiger weiterer Software, so daß ich nach ca. zwei Wochen entnervt aufgegeben und das System gelöscht habe. Mag sein, daß Oracle Linux für Server eine sehr gute Wahl ist, wenn man von vornherein präzise festschreiben kann, was das System leisten soll, für Anwender jedoch, die ihre tägliche Arbeit erledigen wollen, ist es das nicht.
  4. Debian: Es war die einzige Distro mit vernünftiger Unterstützung für 32-Bit-Systeme, von denen ich genau eines in Form eines alten Notebooks noch besitze und in Betrieb habe. Allerdings habe ich es bislang so wenig eingesetzt, daß ich dazu keine Aussage machen kann, was den intensiven Einsatz angeht.

Nun zu Kubuntu: Auf keiner Plattform der letzten Jahre habe ich soviele Applikationscrashs erlebt wie hier. Der letzte Crash fand statt, als ich mich auf Grund einer Konfigurationsänderung (Änderung der Gruppenzugehörigkeit meines Anwenderkontos) einfach mal schnell aus- und wieder einloggen wollte. Selbst während ich das hier schreibe, meldet sich der Crash-Reporter, weil irgendetwas im Hintergrund seinen Geist aufgegeben hat. Die Dinge sind nicht so dramatisch, als daß ich deswegen jetzt das System neu aufsetzen oder sonstige, größere Maßnahmen ergreifen würde, aber verglichen mit der Stabilität von Linux Mint ist Kubuntu mit KDE und Plasma-Desktop ganz schön crashfreudig. Aber ich habe bereits mit dem Gedanken gespielt, Kubuntu vollständig hinter mir zu lassen und nur noch auf Linux Mint mit dem XFCE4 zu arbeiten. Wahrscheinlich werde ich das auch umsetzen, denn was mir am meisten Spaß gemacht hat unter Kubuntu, war die Konsole (konsole), die dieses tolle Feature hat, daß man die Fenster splitten kann. Als ich dann herausgefunden habe, daß man mit apt-get install konsole genau diese Anwendung auch unter Linux Mint zur Verfügung gestellt bekommt, war der Entschluß praktisch gefaßt. Das xfce-Terminal habe ich dann sofort gelöscht.

Heute gehe ich diesen Weg weiter: Ein Windows-10-Desktop-Computer wird umgewandelt in einen Linux Mint 20 & XFCE4 Server, d. h., er wird mir vorrangig als Server dienen für Git-Experimente, da ich dann ein vernünftiges, Unix-kompatibles Filesystem habe, er soll aber auch für normale Anwendungen zur Verfügung stehen.

Meine persönliche Meinung ist also Stand heute (2021-01-28) die:

Wer ein neues System einrichten will mit dem Bedürfnis, nach kürzester Zeit effektiv damit zu arbeiten, und der erwartet, daß Nachinstallationen kein zeitraubendes Abenteuer werden, der sollte Linux Mint mit XFCE wählen. Den ganzen Schnickschnack hübsch aussehender Desktopumgebungen bezahlt man mit höherer Wahrscheinlichkeit für Crashs: Mehr und komplexere Software, bei der zeitgleich viele Komponenten interagieren müssen, erhöht einfach die Absturzwahrscheinlichkeit. Und wenn man sich anschaut, wieviele Komponenten man z. B. bei der Installation von R-Studio unter Kubuntu erst einmal installieren muß, bevor R-Studio sauber aufgesetzt werden kann, der weiß: Kubuntu ist nicht das beste System für Entwickler. Linux Mint hat mehr Komponenten für das Selberkompilieren von Software an Bord, und zwar vom Start weg.

Viel Spaß beim Ausprobieren!

Selbstgebastelte, effektive IDE in Atom für viele unabhängige Quellcode-Dateien

Dieser Artikel bezieht sich auf dieses Video:

Hier die Quelltexte zu den beiden Programmen read und cc++, die Includes werden natürlich nicht alle benötigt, aber ich hatte noch keine Zeit, das auszusortieren:

read

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <cmath>
#include <string>
#include <iomanip>
#include <unistd.h>
using namespace std;

int main(){
  int ret;
  string line;
  cout << "read (fifo reader), v1.0 by HMB" << endl;
  cout << "Waiting...\n";
  while (true){ // Progr runs in an endless loop!
    ifstream inputFile; // We open the file at the beginning
    inputFile.open("reader"); // of the loop and close it
    while (line==""){         // at the end!
      std::getline(inputFile, line); // Thus we receive just one
    }                                // line after the other.
    line = "./" + line; // This is needed by the shell ;)
    cout << "\nReceived this command:\n";
    cout << line << endl; // Control output...
    ret=system(line.c_str()); // Execution on system level
    line=""; // Empty the variable
    cout << "Program returned " << ret << ".\n";
    cout << "\n\n===== read: Waiting for new call... =====\n";
    cout <<     "=====  [Stop w/ CTRL-C or CTRL-Z]   =====\n\n";
    if(inputFile.is_open()) // By closing the file we achieve
    inputFile.close();      // the goal to read one line in
  }                         // one loop.
  return 0;
}

cc++

#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <cmath>
#include <string>
#include <iomanip>
#include <cstddef>
#include <cstdint>
#include <bitset>
using namespace std;

int main(int argc, char *argv[]){
  string a, b, c;
  cout << "\n\n===== cc++ v1.2 by HMB running: =====\n\n";
  cout << "Stage I\n";
  for (int ac=0;ac<argc;ac++){ // ac is loop counter/indicator
      cout << "ac = " << ac << ", argv[" << ac << "] = " << argv[ac] << endl;
  };
  cout << "Stage II\n";
  if (argc==1){
    cout << "Fatal: No filename!" << endl;
    return 1;
  };
  cout << "Stage III\n";
  if (argc==2){
    a=argv[1]; // Filename w/o ext
    cout << "argc = 1, a: " << a << endl;
  };
  cout << "Stage IV\n";
  if (argc==3){
    a=argv[2]; // Filename w/o ext
    b=argv[1]; // Argument no. 1 and only
    cout << "a = " << a << ",\nb = " << b << endl;
  };
  cout << "Stage V\n";
  int onceflag = 0;
  if (b=="-1"){
    // Compile once and finish, do not run!
    onceflag = 1;
    cout << "onceflag set\n";
  };

  c = "/usr/bin/g++ -std=c++17 -Wall -o " + a + " " + a + ".cpp";
  int flag = 2;
  while (1){
    int ret;
    if (flag==2){
      cout << "Executing command:\n-> " << c << endl;
      ret = system(c.c_str());
      cout << "Returned " << ret << endl;
      if (onceflag==1){
        return 0;
      }
    }
    if (ret==0){
      string arg = "";
      cout << "\nEnter arguments if you wish [# for none]: "; cin >> arg;
      string b;
      if (arg != "#"){
        b = "./" + a + " " + arg;
      } else {
        b = "./" + a;
      }

      cout << "\n\n=====   Running your compiled program:    =====\n\n";
      cout << "Command: " << a << endl;
      system(b.c_str());
      cout << "\n\n===== Your compiled program has finished. =====\n\n";
      cout << "Run again? [yes w/ compile = 2, yes w/o compile = 1, no = 0] => ";
      cin >> flag;
      if (flag==0){
        cout << "\n\n===== cc++ finished! =====\n\n";
        break;
      }
    }
  }
  return 0;
}

Kubuntu: How to access your phone via the commandline

When I connected my phone to my Kubuntu laptop using a USB cable I experienced an astonishing phenomenon: Opening up a Dolphin (file manager) window I could easily navigate to it, browse the whole directory contents, but when I tried to get there via commandline I had no chance at all! Same for Double Commander, of course.

Dolphin presents the phone as a device mounted by means of

mtp

(Media Transfer Protocol). I started to install jmtpfs, just as one example. But launching jmtpfs it threw this error:

Device 0 (VID=12d1 and PID=107e) is a Huawei P9 Plus. 
error returned by libusb_claim_interface() = -6LIBMTP PANIC: Unable to initialize device 
terminate called after throwing an instance of 'MtpErrorCantOpenDevice' 
 what():  Can't open device 
Aborted (core dumped)

The solution to the problem is listed in this error message but I was to dumb to recognize it, at least for some time. The reason is:

DO NOT AUTOMATICALLY MOUNT ALL AND EVERYTHING!

If you do (and so did I) KDE mounts the phone asap after connection, and Dolphin can use this connection right away. But you will not be able to find even a trace of gvfs! And jmtpfs cannot access the bus (because it’s already claimed by another process) and therefore gives an error message! I tried to find the mountpoint all over the place, to no avail. Even lsusb did not help and showed nothing which I could identify as the connection to my phone.

Then I installed the following software using apt-get install:

gvfs-bin
gvfs-backends
gvfs-fuse
gvfs-daemons
gigolo

Gigolo is a graphical backend which is fine for trouble-shooting.

After I had installed these packages, I eventually found the crucial gvfs directory in

/run/user/<youruid>/gvfs

To get to know your UID enter

id -u <username>

or

echo $UID

You can install a symbolic link like

/mnt/gvfs

and access the directory from there which works also fine with Double Commander! Do not try to create symbolic links deeper than gvfs, this won’t work!

After I had installed the abovementioned packages, lsusb showed my phone with bus and device ID. Now I can navigate through the phone’s directory structure by console commands, Double Commander, and everything else which is appropriate.

PS: Important!

After this article had been published I found out that the problem occurred again. But I could resolve it (hopefully forever now) by taking my user account out of the plugdev group. I simply had to logout and login, then I could do with the device whatever I wanted.

PPS:

I would have liked more to find out all the details about the processes which are invoked under KDE in order to taylor the configuration to my needs. But this was too complex and would have afforded serious amounts of work and investigation. That’s exactly something I don’t like at all with KDE. It looks nice, it has a very comfortable user interface which gives easy access to many things you’ld probably like to control, but there are limits which are hard to overcome even by very experienced and knowledgable users who also do not back off on great amounts of work. But at the end of the day that’s a matter of taste.

 

Creating a developer cycle within Atom (edit, compile, run, check output)

The fabulous Atom editor lacks one feature out of the box, and that is a developer’s cycle for compiler languages (or similar applications). Compared to Visual Studio Code it’s exactly one thing missing:

Build/compile and run in a console window which is part of the IDE!

Okay, Atom is no IDE! At least not in its basic configuration. But nevertheless I wondered how an editor which is so feature-rich and ingeniously constructed, couldn’t offer such a feature. You may use console windows in one or more of Atom’s panes, but you can’t send any output into these consoles nor can you send commands to them. (Again: At least not out of the box.)

But there’s one package which solves the problem to a high degree: The solution goes by the name

process-palette

Within this package you can easily create your own commands which can be enriched with pre-defined, Atom-integrated variables (several options for file identification and different paths), and you can define a target (or display, if you will) to manage the output. This may look like this:

Atom/process-palette

Atom/process-palette

Above you see three panes: On the left, process-palette’s own output pane, in the middle the editor, on the right, a bash console in its own pane.

Atom/process-palette

Atom/process-palette

Here you see three built-in commands and the g++ command, created by me. It shows how easy it is to build commands exactly to one’s own needs. And down here comes the option which is the most important to me:

Atom/process-palette

Atom/process-palette

There’s the section output, and here you can define the target which will show the output of your command, in this case process-palette’s own output panel.

Still unsolved: You can only use these targets:

Atom/process-palette

Atom/process-palette

Panel is the output panel which is locked to the left hand Atom pane, I couldn’t find a way to place it in the middle pane or the right one. No chance to use another Atom pane with a running bash or something.

Another draw-back: process-palette’s output-panel is read only. You can’t interact with your program, type in arguments or something.

But at least, that’s a nice solution with regard to an effective development cycle: You don’t even have to leave the editor pane, just press CTRL-SHIFT-R (or whatever you have defined) and the compiler builds your executable and runs it within the output panel. That’s it and that’s what I wished for.

PS: But I have found an even better solution, stay tuned, it will be published soon!

How to animate a plot in RStudio

The first thing I came across was how to construct a hexagon in R. After I figured out how to define one and how to plot it, the next idea was to animate it. And this is the source code:

# Hexagon ----------------------------------------------------------------

# Activate plot window prior to start
# Aspect ratio can be set using xlim 

# Limit for loop counter: -G thru +G:
G = 240

# Loop counter:
i = -G; 

# Setting direction to upwards:
ri = 1;
while(i == i) {
   a=-i;
   b=i;
   U <- c(cos((a+90)*2*pi/360), cos((a+30)*2*pi/360), cos((a+330)*2*pi/360), cos((a+270)*2*pi/360), cos((a+210)*2*pi/360), cos((a+150)*2*pi/360), cos((a+90)*2*pi/360));
   V <- c(sin((b+90)*2*pi/360), sin((b+30)*2*pi/360), sin((b+330)*2*pi/360), sin((b+270)*2*pi/360), sin((b+210)*2*pi/360), sin((b+150)*2*pi/360), sin((b+90)*2*pi/360));
   # Try 0.1s first, for fast computers 0.04 or 0.05:
   Sys.sleep(.06);
   plot(U, V, xlim = c(-10, 10), ylim = c(-2, 2), pin = c(5, 5), type = "l");

   if(ri == 1){
      # counterclockwise:
      i = i + 20; 
   } else {
      # clockwise:
      i = i - 3; 
   }
   # switch direction:
   if(i >= G){
      ri = 0;
   } 
   if(i <= -G){
      ri = 1; 
   }
   print(i); 
}

With the correct setting of the start values and defining U and V the plot command creates this plot of a basic hexagon:

Running the whole code section brings it to life. The sys.sleep command is essential, you have to experiment with the value in order to adapt the program to your computer.

This Python program outputs a Collatz sequence for a given number:

# Calculate Collatz sequence
import sys
from math import *
def collatz(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1
def collatz_seq(s):
    global z
    z=0
    while True:
        z=z+1
        print(s, end=" ")
        if s==1:
            return
        s=collatz(s)
def inputafterstart():
    global n
    n=int(input("Enter an integer greater 1: "))
###=========================###
### Program starting point! ###
###=========================###
if len(sys.argv)-1==0:
    # We got a commandline argument:
    inputafterstart()
else:
    n = int(sys.argv[1])
print("Calculating with", n, "as argument!")
collatz_seq(n)
print("\nReady after",z,"loops.")

The next step was to create a table containing all the values of a Collatz sequence. The table looks like this:

run,value
146,9870987
145,29612962
144,14806481
143,44419444
142,22209722
141,11104861
140,33314584
139,16657292
138,8328646
137,4164323
136,12492970
135,6246485
134,18739456
133,9369728
132,4684864
131,2342432
130,1171216
129,585608
128,292804
127,146402
126,73201
125,219604
124,109802
123,54901
122,164704
121,82352
120,41176
119,20588
118,10294
117,5147
116,15442
115,7721
114,23164
113,11582
112,5791
111,17374
110,8687
109,26062
108,13031
107,39094
106,19547
105,58642
104,29321
103,87964
102,43982
101,21991
100,65974
99,32987
98,98962
97,49481
96,148444
95,74222
94,37111
93,111334
92,55667
91,167002
90,83501
89,250504
88,125252
87,62626
86,31313
85,93940
84,46970
83,23485
82,70456
81,35228
80,17614
79,8807
78,26422
77,13211
76,39634
75,19817
74,59452
73,29726
72,14863
71,44590
70,22295
69,66886
68,33443
67,100330
66,50165
65,150496
64,75248
63,37624
62,18812
61,9406
60,4703
59,14110
58,7055
57,21166
56,10583
55,31750
54,15875
53,47626
52,23813
51,71440
50,35720
49,17860
48,8930
47,4465
46,13396
45,6698
44,3349
43,10048
42,5024
41,2512
40,1256
39,628
38,314
37,157
36,472
35,236
34,118
33,59
32,178
31,89
30,268
29,134
28,67
27,202
26,101
25,304
24,152
23,76
22,38
21,19
20,58
19,29
18,88
17,44
16,22
15,11
14,34
13,17
12,52
11,26
10,13
9,40
8,20
7,10
6,5
5,16
4,8
3,4
2,2
1,1

Stored as a CSV file you can import it and run this code:

# Collatz plot ------------------------------------------------------------

library(sys)

a <- collatzdata # collatzdata is a table of a Collatz sequence
                 # starting with 9870987, which has two columns: 
                 # run -> the running number of the sequence
                 # value -> the pertinent number
                 # | run | value    |
                 # ------------------
                 # | 146 |  9870987 |
                 # | 145 | 29612962 |
                 # | ... |   ...    |

i=150
while(i>=1){
   b<-filter(a,run<i+1)
   plot(b,type="l")
   Sys.sleep(.1)
   i=i-2
   print(paste("Iteration # ",i),quote=FALSE)
}

You may watch this YT video to see it performing:

Resizing and extending the disk of a Kubuntu VM in Oracle VirtualBox

First of all, shut off the pertinent VM.

Choose File -> Virtual Media Manager… in Oracle VM VirtualBox Manager. Here you choose the correct disk for your machine and change the size appropriately.

Then boot your Kubuntu VM. Since KDE Partition Manager is NOT able to resize the partition although the OS is aware of the extended storage, you have to

apt-get install gparted

Of course, you could also do this on the command line but using GParted is easy, isn’t it? And it works great! So, that’s all you have to do, resize, apply the changes and reboot.

Done.

Installing R & RStudio on Kubuntu 20.10 Desktop using apt-get install r-base-dev

Step 1:

Download the font from here:

http://www.fontineed.com/font/Hu_Adobe_Garamond

Extract the archive and install the font. This can be done most easily by double-clicking the font file.

Step 2:

Launch the commands apt-get update and apt-cache showpkg r-base:

root@VM-KU2010D:/home/you# apt-get update
Hit:1 http://de.archive.ubuntu.com/ubuntu groovy InRelease
Get:2 http://de.archive.ubuntu.com/ubuntu groovy-updates InRelease [110 kB]
Hit:3 http://security.ubuntu.com/ubuntu groovy-security InRelease 
Get:4 http://de.archive.ubuntu.com/ubuntu groovy-backports InRelease [101 kB]
Get:5 http://de.archive.ubuntu.com/ubuntu groovy-updates/main amd64 DEP-11 Metadata [24,1 kB]
Get:6 http://de.archive.ubuntu.com/ubuntu groovy-updates/universe amd64 DEP-11 Metadata [15,0 kB]
Get:7 http://de.archive.ubuntu.com/ubuntu groovy-backports/universe amd64 DEP-11 Metadata [600 B]
Fetched 251 kB in 1s (281 kB/s) 
Reading package lists... Done
root@VM-KU2010D:/home/you# apt-cache showpkg r-base 
Package: r-base
Versions: 
4.0.2-1build1 (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_groovy_universe_binary-amd64_Packages) (/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_groovy_universe_binary-i386_Packages)
Description Language: 
File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_groovy_universe_binary-amd64_Packages
MD5: 5787ca79ed716232c4cc2087ed9b425b
Description Language: en
File: /var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_groovy_universe_i18n_Translation-en
MD5: 5787ca79ed716232c4cc2087ed9b425b


Reverse Depends: 
r-base-core,r-base 1.4.1-1
ugene,r-base
zim,r-base
science-numericalcomputation,r-base
science-meteorology,r-base
science-economics,r-base
reapr,r-base
r-doc-info,r-base 1.4.1-1
r-doc-html,r-base 1.4.1-1
r-base-html,r-base 1.4.1-1
bali-phy,r-base
python3-pywps,r-base
netperfmeter-plotting,r-base
med-physics,r-base
libstatistics-r-perl,r-base
Dependencies: 
4.0.2-1build1 - r-base-core (2 4.0.2-1build1) r-recommended (5 4.0.2-1build1) r-base-html (0 (null)) r-doc-html (0 (null)) elpa-ess (0 (null)) r-doc-info (16 (null)) r-doc-pdf (0 (null)) 
Provides: 
4.0.2-1build1 - 
Reverse Provides: 
root@VM-KU2010D:/home/you#

At the time of this writing R v4.0.3 is the latest one. If you want the somewhat earlier version you may install it now using apt-get install r-base.

To install the newer one, do the following:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

The command is deprecated but it still works.

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu groovy-cran40/'

Install it with apt-get install r-base.

In the following I go with R v4.0.3 BUT I choose r-base-dev! Hence, the following may or may not apply exactly to what you experience if you stay with r-base. In addition I install r-base-core-dbg and r-base-html.

Next comes RStudio.

apt-get install libclang-dev

This is required by RStudio !

If you receive a hint to perform

apt --fix-broken install

do so! Now download the deb package for your system:

https://rstudio.com/products/rstudio/download/#download

and install it:

dpkg -i <your package>

You can now start RStudio via the menu. First of all, I install the packages ggplot2 und ggthemes, and this works right away. I test it with the faithful dataset which is provided by RStudio for testing purposes:

> library(ggplot2)
> library(ggthemes)
> ggplot(faithful) + geom_point(aes(x=eruptions,y=waiting),shape='square')
> ggplot(faithful) + geom_point(aes(x=eruptions,y=waiting),shape='square') + theme_bw()
> ggplot(faithful) + geom_point(aes(x=eruptions,y=waiting),shape='square') + theme_dark()
> ggplot(faithful) + geom_point(aes(x=eruptions,y=waiting),shape='square') + theme_economist()

Works! Work done!

 

 

 

 

 

RStudio & Rcmdr: Installation problems w/ tcltk2 on Kubuntu 20.10 Desktop

First, on Linux Mint 20 the installation of Rcmdr is no problem at all. But on Kubuntu, it is. When you try to install Rcmdr from within RStudio by

install.packages("Rcmdr")

you may run into the error msg:

Error: package or namespace load failed for ‘tcltk’:
.onLoad failed in loadNamespace() for 'tcltk', details:
call: fun(libname, pkgname)
error: Tcl/Tk support is not available on this system
Error: package ‘tcltk’ could not be loaded
In addition: Warning message:
S3 methods ‘as.character.tclObj’, ‘as.character.tclVar’, ‘as.double.tclObj’, ‘as.integer.tclObj’, ‘as.logical.tclObj’, ‘as.raw.tclObj’, ‘print.tclObj’, ‘[[.tclArray’, ‘[[<-.tclArray’, ‘$.tclArray’, ‘$<-.tclArray’, ‘names.tclArray’, ‘names<-.tclArray’, ‘length.tclArray’, ‘length<-.tclArray’, ‘tclObj.tclVar’, ‘tclObj<-.tclVar’, ‘tclvalue.default’, ‘tclvalue.tclObj’, ‘tclvalue.tclVar’, ‘tclvalue<-.default’, ‘tclvalue<-.tclVar’, ‘close.tkProgressBar’ were declared in NAMESPACE but not found 
Execution halted
ERROR: lazy loading failed for package ‘tcltk2’
* removing ‘/home/hmb/R/x86_64-pc-linux-gnu-library/4.0/tcltk2’
Warning in install.packages :
installation of package ‘tcltk2’ had non-zero exit status
ERROR: dependency ‘tcltk2’ is not available for package ‘Rcmdr’
* removing ‘/home/hmb/R/x86_64-pc-linux-gnu-library/4.0/Rcmdr’
Warning in install.packages :
installation of package ‘Rcmdr’ had non-zero exit status

This most probably means that your system is missing the libs

tcl-dev

and

tk-dev

Install them using

apt-get install tcl-dev tk-dev

Now rebuild R (make, ./configure…).

Afterwards RStudio should be able to let you install the package tcltk2. And as a consequence, you should be able to install Rcmdr, too.

 

 

The Ultimate Guide to Installing R and RStudio from Scratch

The following recipe is applicable to a machine (maybe a virtual one) running under Kubuntu 20.10 Desktop, but may be helpful for other Linux distros, too. In order to brush things up for Google: We are talking about ./configure, make, make install of R (r-project.org) and installing RStudio (rstudio.com) on a Linux computer.

One advice before you start working on your computer: Please, read this article completely before you begin hammering on your keyboard! It is of utmost importance, that you understand what you do and how you have to do it! Okay? Thank you!

This article is the result of at least two days of hard work, reading more than one hundred articles and error descriptions, searching for libraries, their applicable names for apt-get/apt install, and much more. You know that. But, let’s begin.

One warning: If you have installed Anaconda on your machine, remove it, and do it exactly like it is described by the Anaconda people! I have just tried to repair my installation of R on a second machine which had Anaconda on it, and the make run ended up with errors and there were path references pointing to my Anaconda installation. I’m more than just suspicious that there are only two ways to go: Either you go for native R or you go the Anaconda way. Then you can stop reading any further. Or you read until the end of the article and make a new decision.

When you install RStudio, there is no R environment or R language coming as a companion. You should install R first, and then RStudio on top. And here is how I dit it:

Installing R

First, download the tarball from https://www.r-project.org/.

In the following we use two commands which need two preliminary dashes you have to use, these may be hard to recognize depending on your display. DO NOT enter these two commands right way, this is just an announcement of things to come:

  1. apt --fix-broken install with two dashes before fix like so: --fix
  2. ./configure --enable-R-shlib with two dashes before enable like so: --enable
    
    And do not forget the preliminary ./ (dot slash) directly followed by configure!

Second, do these preparations (either with sudo in front of every single command or better, become root by sudo su) before beginning work on the tarball:

  1. apt-get install libclang-dev
  2. It is possible that you get a hint to use apt --fix-broken install. If so, do it!
  3. apt install gfortran
  4. apt install g++
  5. apt-get install libreadline6 libreadline6-dev
    
    (Read the PS about this command if it fails for you!)
  6. apt install libncurses-dev
  7. apt-get install xorg-dev
  8. apt-get install libbz2-dev
  9. apt-get install liblzma-dev
  10. apt install libpcre2-dev
  11. apt install libbiojava-java

Now we extract the tarball and enter the new R directory. Here we have to do the following:

  1. make clean
  2. ./configure --enable-R-shlib (Do note the leading ./ ! 
    And there are two dashes before enable!)
  3. make
  4. make install

Step 2. is most important! The option ‒‒enable-R-shlib (WordPress shows the two dashes possibly as one! Be careful!) is not documented, but RStudio will tell you about it if you installed without using it! In this case, it doesn’t find its shared library. And this is essential! And you cannot repair it by creating a symbolic link. That’s the wrong way to (pseudo-)resolve the problem.

Installing RStudio

Now download the RStudio package and install it:

dpkg -i rstudio-1.3.1093-amd64.deb

This is the one for standard PCs with 64 bit OS, take care to download the right one for your machine.

Run RStudio, it should start without a problem.

A little unsolved problem in RStudio [SOLVED, see PPS!]

In RStudio I encountered one minor problem though, regarding ggplot.

The command

p1 <- ggplot() + geom_line(aes(y=value, x=run), data = somedata) 
p1

throws this error:

Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) : 
X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 11 could not be loaded

I have tried to install additional fonts and lots and lots of other things, but to no avail.

There are numerous hints out there to resolve this but none of them worked for me. But at least I found out the following: There are different themes to choose from when using ggplot(), if you don’t see themes marked (ggthemes) you may install them by

install.packages("ggthemes")

or use the package menu to do so. You should see a list like this:

RStudio ggplot() themes

RStudio ggplot() themes

You activate them as follows:

p1 <- ggplot() + geom_line(aes(y=value, x=run), data = somedata) + theme_calc()

theme_calc() worked fine for me and showed this graph:

Graph w/ theme_calc()

Graph w/ theme_calc()

You may choose theme_void() as an alternative or a starter. It seems as if the default theme doesn’t work at all, but other themes do. If you find a way to repair this, let me know!

Good luck!


PS:

Installation of libreadline-stuff may fail with the error that no targets can be found. In this case, visit

https://www.ubuntuupdates.org/package/core/groovy/main/base/libreadline-dev

Here you can download a deb-package which can be installed using dpkg -i.

PPS:

I’m still working on the ggplot2 bug. At least I consider it a bug. The good news is that I’ve got in contact with one of the developers of RStudio, and I’m somewhat optimistic that we will be able to sort things out, stay tuned!

Update, 2021-01-07: And here we are: I have found a solution! It was not a bug, it was indeed a simple font missing, and I have discovered a website where you can download a suitable font legally and for free:

http://www.fontineed.com/font/Hu_Adobe_Garamond

Once you have installed this font correctly on your system, you can use all themes! I’m so happy about this, I can’t tell 😂😝😃😝😁 ☑

But, folks, the question remains: I have told the developer that from my point of view it is not the best of all ideas to hardcode a fontname in the source code! And this is especially true for software which is supposed to run on quite a number of different OS platforms. The only system I know which has pre-installed Adobe fonts was SUN Solaris in the good days of old. It’s quite typical for people coming from this platform to code things like this.

And I think it is an excellent idea to remove this codepiece from RStudio. Just my two dollars 😬 !

 

How to install Oracle’s guest additions on a Kubuntu VM

I’m sure that you will encounter problems when you fire up your new Kubuntu 20.10 Desktop virtual machine under the impression things would work out fine with just giving the VM the ISO file with these additions.

The install process will most likely fail. This is due to some missing parts which have to be installed beforehand. Here are the necessary commands you may just copy’n paste.

But either enter sudo before each command or become root with sudo su:

  1. sudo su (that's the easy way)
  2. apt-get install gcc
  3. apt-get install make

Now you may mount the ISO file with the additions and start
autorun.sh manually (as root). You find it here:

/media/<username>/VBox_GAs_6.1.16

After that, the Auto-resize Guest Display option should work!

The ISO file can be found here:

http://download.virtualbox.org/virtualbox/6.1.16/