Installing Ubuntu on an Acer Aspire Laptop Computer

by Walter Eastes

Introduction

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.

Why Acer, Why Ubuntu?

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

Ubuntu Live on a Flash Drive

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/sdb
The 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.30
which is the IP address of toad30. The ssh:// is required or the Connect button will not work.

Installing Ubuntu

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.

BASH Prompts and Aliases

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:

Installing Software

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 upgrade
The 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 autoremove
which 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 packagename
gives a short description of the packagename including whether it is installed and accepts globbing characters.

apt search packagename
where the packagename can have globbing characters, to find a likely package in the repositories.

apt show packagename
to 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 Email 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

File transfer can be done with the Nautilus file manager as described earlier. But sftp is available with

sftp ppp@toad30
To make toad30 known, this line was added to the /etc/hosts file:
192.168.0.30	toad30
With a get -R command one can transfer whole directories and their subdirectories from one machine to another.

Fixing Annoyances

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.

All of the files created in the present user's home directory were copied to the others.

Printing and Scanning.

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.

Making Debian Packages

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.deb
After 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.

Best viewed with any browser