Around November, 2019, I bought an Acer Aspire laptop computer to replace a Sony Vaio that I had been using since February, 2004. The Sony Vaio was running Slackware 14.0, but I loaded the new Acer with Ubuntu 18.04, first trying it out with a live distribution on a flash drive.
The entire procedure worked well, but there were a few subtle configuration details needed to make it work at all. What I did is detailed here in case any of it might be useful to someone else.
What attracted me to the Acer laptop was the clock speed, number of cores, and the solid state mass storage. This table compares it to what it replaces.
Property | Acer Aspire | Sony Vaio |
---|---|---|
Host name | toad31 | toad30 |
Main memory | 8 GB | 512 MB |
Cores | 4 | 2 |
Speed | 3.1 GHz | 3.0 GHz |
Mass Storage | 512 GB SSD | 160 GB HD |
The solid state mass storage (SSD) and huge main memory are fairly standard today, although the SSDs are usually half that big, but the clock speeds in laptops are often half this or less.
The above table also shows the host name assigned to these machines, distinguished by the small difference in clock speed.
Since my work involves scientific calculations like computer simulations of chemical and physical processes, a faster processor is always better. Some 80% to 90% of the run time of much of my code can run in parallel, meaning that four cores (processors) make a big difference, eight would be better, but many more than that would not speed it up much more.
Although I have used many different Linux distributions over the years, Slackware 3.1 was the first one I installed in 1996 on a 200 MHz Pentium and remains my favorite. Indeed Slackware 9.1 was installed on toad30 in early 2004. The reason I liked it is that it was possible to configure pretty much anything I needed from a graphical screen, mice of various kinds, dial up and then broadband internet connections, email, multiple processors, web sites, remote access, and more, back when these features were new and poorly supported. But these things are standard now and configuring them is pretty much automatic in distrbutions like Ubuntu, although still not so much in Slackware.
On the other hand, Ubuntu is complicated and has many things going on that you do not want, some of them fairly outrageous. More on fixing them further on. But I miss the simplicity of Slackware. This table shows the number of processes typically running when I am doing my work and the number of file systems in operation from the ps and df commands.
Property | Acer Aspire | Sony Vaio |
---|---|---|
Host name | toad31 | toad30 |
Distribution | Ubuntu 18.04 | Slackware 14.0 |
Processes | 303 | 95 |
File Systems | 27 | 2 |
The problem with installing a Linux distribution on a laptop computer is, or used to be, the non-standard laptop hardware that may or may not be supported by free software. With a desktop computer, I can reformat the disk and install Slackware, secure in the knowledge that I can make all the hardware work. But with a laptop machine, I would like to try it out with a live distribution to see if everything works with it before I reformat the hard drive and destroy whatever Microsoft offering was on it. With the hard drive erased, it would be hard to return the computer if it did not work for me.
The flash drive with the live Ubuntu distribution was made on the toad30 Sony from the web site https://ubuntu.com/desktop by downloading the 18.04 version and writing it to a flash drive as root with
dd if=ubuntu-18.04.3-desktop-amd64.iso of=/dev/sdbThe command fdisk -l was used to list the drives and insure dd was done to the right device without mounting it.
Some changes were needed in the BIOS on the new toad31 Acer in order to boot from the flash drive. The F12 boot menu had to be enabled and secure boot needed to be disabled.
To enable the F12 boot menu, the BIOS was entered by pressing the F2 key once or twice a second after switching on until the boot menu showed up. With the right arrow, Main was selected, then F12 Boot, then Enter. Enabled was selected then Enter.
Secure boot needs to be disabled or the selected boot device will not work. For that went back to the main menu, selected Security, selected Set Supervisor Password. Then entered a password. Then secure boot could be disabled. F10 was pressed to save the settings and reboot. From now on it will request the supervisor password to enter the BIOS but not to select the boot device with F12.
From then on one could select the device from which to boot by pressing F12 repeatedly when the Acer logo displays after switching on.
From the F12 menu, one can choose either the whole flash drive or partition 1. Either way, one gets a menu to choose installing or trying it out, which takes the default, running the live system, after only a short delay. It boots directly to a graphical screen, from which one can try out Ubuntu on the Acer.
The upper right menu allows WiFi connection to an available router and from there to the internet. A connection to the old toad30 could be made by ssh with Nautilus, with the selection "Other Locations" at the bottom. Entered
ssh://192.168.0.30which is the IP address of toad30. The ssh:// is required or the Connect button will not work.
Clicked on Install running Ubuntu Live and set up the WiFi connection..
The problem right away was that the only device found was /dev/sda, which is the flash drive containing the live system. Some BIOS changes were needed. Entered BIOS by holding F2 while turning on. Went to Main and SATA Mode. Changed RST with Optane to AHCI. This is required to get Ubuntu to detect the SSD. Now it found the SSD and offered to erase the disk and install. This produced /dev/nvme0n1 with two partitions:
Partition 1, type ESP, 512 Mb
Partition 2, type ext4, 477 Gb
A useable Ubuntu system resulted.
Most people want to configure the shell to their liking. The following is what I did.
The bash shell reads /etc/profile, which sources /etc/profile.d/*, then reads ~/.profile, which sources ~/.bashrc if it is a bash shell. So the latter seems to be the right place to add statements at the end to do these things:
if [ $USER = 'root' ] ; then PS1='ESC[01;31;1m$ ESC[00m' PS2='ESC[01;31;1m> ESC[00m' else PS1='ESC[01;34;1m$ ESC[00m' PS2='ESC[01;34;1m> ESC[00m' fi export PS1 PS2
unalias ls ll l # This gives columns even through a pipe; use ls -1 for single column alias ls='ls -C' # These give colored output and columns, even through a pipe, # and / and * trailing directories and executables alias ll='ls -lF --color' alias la='ls -aFC --color' alias lf='ls -FC --color'Note that colored ls can be piped into less and viewed in color with less -r
export PATH=.:$PATH
Although installing an Ubuntu distribution provides a working system with the Firefox web browser and the LibreOffice document software, there is nothing much else that a programmer needs. Fortunately, all manner of software is available in packages that resolve all dependencies just by doing
apt install packagename packagename ...The table below shows all the packages I installed in alphabetical order, not in the order I installed them. They were installed in the order I happened to think of them or needed them, but the order doesn't appear to matter. The entry in the Package column is the packagename for the apt install command. Before doing apt install, it helps to issue
apt update apt upgradeThe first updates the list of servers from which packages may be downloaded, and the second finds upgrades for all packages that have them and offers to install them.
A few other useful apt commands are
apt autoremovewhich removes any packages that are no longer needed because they have been superceded or were installed as a dependency of a package that has been removed
apt list packagenamegives a short description of the packagename including whether it is installed and accepts globbing characters.
apt search packagenamewhere the packagename can have globbing characters, to find a likely package in the repositories.
apt show packagenameto show the .deb file information about a package, either already installed or available in the repository,
All of these commands that install programs must be issued as root. The others that show information are available to any user.
Package | Provides | Comments | |
---|---|---|---|
blt blt-dev | BLT extensions | Brought along the -dev versions of tcl and tk. | |
build-essential | C and Perl | Compilers among all the other things needed to compile programs. | |
dillo | Dillo | Minimal graphical web browser. | |
ffmpeg | Constructs and reformats movies | Useful for converting movie files from something you can't play to something you can. | |
gawk gawk-doc | awk | The version of awk in build-essential is mawk, a fairly stripped down version. gawk neatly takes precedence over mawk including for the man pages. | |
gfortran gfortran-doc | Fortran | Actually wanted f77, but is no longer available as a .deb package. However, gfortran is available, which does Fortran 95 and later extensions, and it includes f77 as a link to gfortran. Apparently gfortran compiles Fortran 77 seamlessly when called as f77. | |
gnome-tweaks | gnome configuration | Needed to adjust screen icons. | |
gnuplot gnuplot-docs | Plotting | Brings in gnuplot-nox, the bare plot routines, and the gnuplot-x11 and gnuplot-qt versions. | |
groff | Text formatting | groff-base is already installed but the -ms macros are missing, among other things. | |
gv | Display pdf and ps | groff-base is already installed but not gv. | |
hplip hplip-gui | HP printer management | Needed to get the scanner to work. | |
default-java | Java runtime | Installed openjdk-11.0.5. | |
libjpeg-turbo-progs | JPEG converters | Installed to get cjpeg and djpeg. | |
m4 m4-doc | Macro processor | ||
markdown | Markup for HTML | John Gruber's version of markdown, which is a Perl script. | |
maxima | Maxima | It removes all the versions of gnuplot and then reinstalls them since maxima uses gnuplot for its plotting. Oh well. | |
mboxgrep | Search email | Extracts messages meeting specified criteria. | |
mingw-x64 | Cross compiler | Contains programs that run on 64 bit Linux systems and produce 32 bit Windows executables, which will run on 64 bit Windows systems. The compiler seems to be x86_64-linux-gnu-gcc and associated programs installed in /usr/bin with man pages in the usual place. These work to make .exe files that run from the command line on Windows. | |
msmtp | Mail sender | Works with mutt. | |
mutt | Text mode email program, runs in a terminal, lets me use vi to compose messages. | ||
ncftp | File transfer | Command line FTP but with extra features. | |
octave | Octave | Comes up with the gui by default. Defeat it with octave --no-gui. | |
pinfo | Info reader | An alternative to info for reading info files, a little prettier but works about the same way. | |
plotutils | Plotting | Includes graph to draw graphs of data and plot to convert to various formats. | |
r-base | R | Numerical scripting language. | |
sane xsane | Scanning | Might be useful for scanning. | |
tcl tcl-doc | tcl and tclsh | Installs tcl8.6 and man pages, tcl8.6-doc. | |
timidity | Midi synthesizer | Also installs freepats and timidity-interfaces-extra. | |
tk tk-doc | tk extensions | Installs tk8.6 and man pages. | |
tkinfo | Info reader | Better for viewing info files, displaying them in a graphical browser with links. | |
urlview | Extract web addresses | Works with mutt. | |
vim | vi improved | Replaces vim-tiny in the initial installation, which is fairly restricted. Installing the full vim does syntax highlighting and works seamlessly on compressed files. | |
vlc | Movie player | Plays pretty much anything. | |
xfig fig2dev xfig-libs xfig-doc gsfonts-x11 | Drawing | Draws geometrical shapes and converts them to various formats. To make the X11 fonts, available do as root, "mkfontdir", and "xset fp rehash" so that they will be found. Now any font and size will work in xfig. | |
xpat2 | Solitare | An updated version of my favorite solitare game. |
File transfer can be done with the Nautilus file manager as described earlier. But sftp is available with
sftp ppp@toad30To make toad30 known, this line was added to the /etc/hosts file:
192.168.0.30 toad30With a get -R command one can transfer whole directories and their subdirectories from one machine to another.
The following paragraphs describe a few annoying things I found and how they were fixed more or less in the order of most annoying first.
Recovery from root lockout involves holding Shift or ESC down during power on. Allows selection of recovery mode, from which one can issue
passwd rootThen can reboot, go to root, and fix the other users' passwords. What good are passwords when you can defeat them so easily?
Finally changed the root password to a single letter and left walter and guest with no password.
A graphical login with no password was arranged by changing two files, /etc/gdm3/custom.conf and /etc/pam.d/gdm-password. Here follows a patch script for the changes, made by saving a copy of the file before changing it and then doing diff -u oldfile newfile.
--- /etc/gdm3/custom.conf.old 2019-12-29 13:38:00.816132838 -0500 +++ /etc/gdm3/custom.conf 2019-12-29 13:39:38.200357465 -0500 @@ -16,6 +16,7 @@ # TimedLoginDelay = 10 [security] +AllowRoot = true [xdmcp]and
--- /etc/pam.d/gdm-password.old 2019-12-29 13:38:35.260658344 -0500 +++ /etc/pam.d/gdm-password 2019-12-29 13:39:58.663852279 -0500 @@ -1,6 +1,6 @@ #%PAM-1.0 auth requisite pam_nologin.so -auth required pam_succeed_if.so user != root quiet_success +#auth required pam_succeed_if.so user != root quiet_success @include common-auth auth optional pam_gnome_keyring.so @include common-account
Now a reboot lets walter and guest login without being asked for a password and one can su - to root, giving the one character password. But another user cannot su - guest without being asked for a password, for which none are acceptable.
To make doubly sure, I edited /etc/apt/apt.conf.d/10periodic to put the 0 in this line
APT::Periodic::Unattended-Upgrade "0";
setxkbmap -option ctrl:swapcapsThat survives exiting the terminal and starting another one. But it reverts when one logs out and back in again.
To make it permanent across logins and across rebooting, edited .etc.default/keyboard as in this patch script:
--- /etc/default/keyboard.orig 2020-01-02 20:32:02.447125890 -0500 +++ /etc/default/keyboard 2020-01-02 20:34:55.910941711 -0500 @@ -5,6 +5,6 @@ XKBMODEL="pc105" XKBLAYOUT="us" XKBVARIANT="" -XKBOPTIONS="" +XKBOPTIONS="ctrl:swapcaps" BACKSPACE="guess"Then issued
dkpg-reconfigure keyboard-configurationThe correct answers to all the questions were already highlighted; hit Enter.
Once it happened after it was left plugged in and charging for days. A helpful article on the internet suggested it was overcharged, needed to be discharged and the static bled off. I just waited an hour or so and pushing the power switch started, asked for the BIOS supervisor password, and went to the BIOS. Had to again disable secure boot and change SATA to AHCI but then it started Ubuntu and could log in.
It seems to be a bad idea to leave this computer plugged in all the time. So I unplug it when not using it and when it is shut down.
Another time, hitting the power button brought up the ACER logos as usual but then it hung with the Ubuntu logo. Held onto the power button for several seconds to turn it off then pushed the power button again. It came up with a Grub menu showing these three options:
Ubuntu Advanced ... System SetupThe thing to do is to hit Enter to choose the first, highlighted option. It started up fine.
Yet another time I accidently blanked out the screen by clicking on something in the upper right panel. Could not get it back, forced power off, then rebooted. Came up in grub, tried to boot, went to initramfs rescue mode with message
Alert! UUID=e16..... does not exist. Dropping to shell.From initramfs issued the reboot command and it came back to grub.
The problem here appears to be that the BIOS parameters that had to be set so that Ubuntu could find the SSD got reset and the SSD was no longer visible. Thus there was no operating system to load. All the following parameters need to be restored to what was entered to install Ubuntu, the F12 boot menu had to be enabled, secure boot needed to be disabled, and SATA Mode changed from RST with Optane to AHCI. After Save and Exit the BIOS, it rebooted just fine.
One of the disadvantages of SSD is that it is not as permanent as a hard drive. At least the data were not damaged, only the configuration reset, and it can be changed back.
I have found that if I do nothing with the files in /var/crash except list the directory to see that they are there, the windows keep popping up again and again. But if I access the file, for example, read it with less, then the windows no longer appear until the next crash and next new file appears in /var/crash. A suggestion on the internet was to delete all the files in /var/crash. That works too, to get rid of the pop up windows.
The background can be changed with Activities, type settings, and select Background.
Controlling what appears in the far left, Favorites, column depends on whether it already has a .desktop entry in /usr/share/applications. If it does, you can start it by typing from Activities. Then it will have an icon in the Favorites column. Right click this icon and select Add to Favorites.
Now if this doesn't work, then an entry is needed in .local/share/applications. Here is one named xpat2.desktop that worked for the xpat2 solitare game.
[Desktop Entry] Comment=Solitare Terminal=false Name=Solitare Exec=/usr/games/xpat2 -rules Klondike Type=Application Icon=solitareHave no idea what icon file it is using, but it shows something.
gsettings set org.gnome.desktop.interface clock-show-date-true
filetype indent offThe present ~/.vim directory was empty, so wrote a new vimrc therein.
The other annoyance is that by default it takes two hits of the tab key in bash to get a list of possible word completions. The first tab completes it if there is only one possibility. If there are others, the bell rings and you have to hit tab again to see what they are. Created a new file ~/.inputrc with this statement:
set show-all-if-ambiguous onHave to restart the terminal. Now one tab completes the word if there is one possibility and shows a list if there are more. You can go through tabbing and typing just enough to limit the possibilities until you get what you wanted.
It is handled with the command-not-found package, which could be removed, but then you might have to replace it with something else. Easier to just put this into ~/.bashrc:
unset command_not_found_handle
All of the files created in the present user's home directory were copied to the others.
My WiFi printer and scanner is on the local network so I pointed the browser to http://localhost:631 to install a CUPS printer, which worked and I could print.
The initial Ubuntu install included groff-base but not groff, ghostscript, imagickmagick, netpbm, and evince but not gv. Note that one can view .pdfs as text with less, apparently using pdftotext.
Was not able to detect any scanners with scanimage -L even after installing sane and xsane and editing /etc default/saned and /etc/sane.d/net.conf. So broke down and installed hplip, which was afraid to do for fear it would break the existing installation of the printer. Now did hp-setup. Tried for an Ethernet or Wireless scanner but none was detected. Checked Manual setup and entered 192.168.0.99, which was the IP address of the printer, and it detected it. The only choice was to install this printer, which was done with trepidation. It finished normally with no other questions. However scanimage -L now detected the scanner and my scanning programs work.
Now printing worked just as before. In fact, a new printer was installed in CUPS, but it was not the default printer and thus changes nothing. Wonder if it would work better than the default one previously installed.
A way is needed to install my own programs and it makes sense to use what the distribution provides, in this case the Debian package facilities. To do this one installs the binaries, man pages, and configuration files in a temporary directory with the directory structure that they would have when installed. In addition, a file named control is constructed in a directory named DEBIAN in this same temporary directory.
Here is about the simplest example of a control file:
Package: scanfax Version: 2.1 Architecture: amd64 Depends: sane, tcl, tk, ghostscript, netpbm, libjpeg-turbo-progs Maintainer: Walter Eastes Description: Programs to scan various documents Included the program scanpages, scanphoto, and scancard to scan these documents easily.
Here's how to make the .deb package from the directory structure in tmp:
dpkg-deb --build --root-owner-group tmp scanfax_2.1.debAfter the .deb file is made, it may be installed (from root) with
dpkg -i scanfax_2.1.deb
Lots more capabilities are available with Debian packages, such as pre and post install scripts, but I seldom use them.
This page was last updated in June, 2021.