Archives For ubuntu

Ubuntu is always not ready for use out-of-the-box, because every user has his/her own preferences. And, here’s a list of things I did after installing Ubuntu 22.04 LTS.

1. Install Media Codec:

To speed up the installing process, I never enable the network connection in Ubuntu’s installer wizard. So, the media codecs is not installed and audio/video player does not work out-of-the-box.

Press Ctrl+Alt+T on keyboard to open terminal. And, refresh the package cache if you’ve not done that.

sudo apt update

Then, install the codecs for audio, video playback, Microsoft fonts, rar support, and so forth via this command:

sudo apt install ubuntu-restricted-extras

2. Remove Firefox and install the Deb version:

I use Firefox to install Gnome Extensions regularly. But the pre-installed Firefox is a Snap package that does not support the feature.

It’s easy to remove the Firefox Snap by running command (back your data first!) in terminal:

sudo snap remove --purge firefox

However, Firefox Deb package in 22.04 repository is just a wrapper that links to Snap. Except the official Linux Tarball, there are only third-party repositories (though really trustworthy): Ubuntuzilla and “Mozilla Team” team PPA.

I personally prefer the “Mozilla Team” team PPA. And, simply run the commands below one by one will install Firefox Deb package from that repository:

sudo add-apt-repository ppa:mozillateam/ppa
sudo apt install -t 'o=LP-PPA-mozillateam' firefox

After installation, you need to set higher PPA priority to prevent Ubuntu from installing the Snap back. See here for details.

3. Select your favorite accent color

Ubuntu 22.04 introduced 10 accent colors in “Appearance” settings page. It allows you change the color of slider bar, on/off switch, check-box, highlight text background, input box border, and even folder icon.

Choose favorite accent color

4. Tweak Ubuntu Dock (the left panel)

Click to minimize, minimize the app window when click on its icon on the dock by running command:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action minimize

Shorten the left panel and move it to the bottom using system settings under “Appearance” page:

And, remove mounted and network volumes from the dock via “Configure dock behavior” setting options.

5. Setup Gnome Extensions support.

Most extensions are available to install from https://extensions.gnome.org/. Ubuntu however does not ready for it out-of-the-box.

After switching Firefox Snap to another package (or another browser), you need to press Ctrl+Alt+T to open terminal and run command to install required packages:

sudo apt install chrome-gnome-shell gnome-shell-extension-prefs

It installs the agent to be able to install Gnome Extensions from web browser, as well as the “Gnome Extensions” app to manage all available extensions on your system:

Manage Gnome Extensions

(Update) 6. Install Gnome Extension Manager:

Started in Ubuntu 22.04, there’s a cool new graphical tool made into official repositories. It’s “Extension Manager“, which allows to search, install, remove and manage Gnome Extensions.

With the tool, you do not have to remove the pre-installed Firefox or use another browser any more.

Search extensions

To install the Extension manager, open terminal by pressing Ctrl+Alt+T on keyboard and run command:

sudo apt install gnome-shell-extension-manager

7. Install Gnome Tweaks / Dconf Editor.

For more configuration options about desktop appearance and behavior, Gnome Tweaks and Dconf Editor are highly recommended.

And, they are both available to install either from Ubuntu Software or by running the command below in terminal:

sudo apt install gnome-tweaks dconf-editor

8. Weather forecast in Clock menu

Gnome’s (the default desktop) core weather app will add weather condition about the next few hours in the clock menu.

Simply install the app by running the command below in terminal:

sudo apt install gnome-weather

Then launch it from the ‘Activities’ overview screen. Setup your location and see the daily or hourly weather forecast. The clock menu will display hourly forecast automatically after that.

9. Install some extensions

There are many great Gnome extensions. Here are few of them that are highly recommended:

10. Enable ability to apply another Gnome Shell themes.

There are tons of Gnome Shell themes available to change the look and feel of the top-bar, dock, and system menus.

To be able to apply one of these themes, you have to first install the ‘User Themes extension’:

Then, use “Gnome Tweaks -> Appearance” page to select an installed theme for Shell use.

Ubuntu 22.04 Jammy Jellyfish now is in final beta stage! Here’s how you can upgrade to the new LTS from Ubuntu 20.04!

NOTE: the steps below now will upgrade to Ubuntu 22.04 Beta at the moment. Though, the beta will be upgraded to the final stable release automatically in next month by running regular updates.

What’s New in Ubuntu 22.04:

The new Ubuntu 22.04 LTS features Linux Kernel 5.15 and GNOME 42 desktop. It’s a long term support release with 5 years support. The Final Beta was announced with changes including:

  • Full dark/light mode via appearance settings.
  • 10 accent colors.
  • New screenshot UI (press Print-Screen to start it).
  • Switch Firefox to Mozilla’s Snap package.
  • Defaults to Wayland compare to Ubuntu 20.04.
  • LibreOffice 7.3, Thunderbird 91.
  • Python 3.10, Ruby 3.0, Mesa 22, PulseAudio 16, CUPS 2.4, PostgreSQL 14.2
  • See release note for more.

Preparation:

Before getting started, there are some things need to do first! They are important to prevent upgrade failure.

1.) Backup! Backup! Backup! The upgrade process may fail due to different reasons. So, it’s important to back your data, bookmarks, etc.

2.) Disable third-party PPAs. This can be done by launching ‘Software & Updates’ utility and navigate to ‘Other Software’ tab.

If possible, I’d recommend to purge PPAs which also downgrade these third-party software packages. Especially for ffmpeg, mesa, etc.

Disable or remove 3 party PPAs

3.) Also in ‘Software & Updates’ tool, navigate to ‘Updates’ tab. There choose ‘Notify me of a new Ubuntu version: For long term support versions‘.

4.) Remove proprietary drivers from ‘Additional Drivers’ tab, and use an open-source driver instead. You may skip this step if your PC does not have a dedicated GPU.

5.) Remove other Desktop Environments! If you have other desktops (e.g., KDE, XFCE, Cinnamon), it’s better to remove them, so to speed up the upgrade process.

6.) Disable User Extensions. Disable user installed Gnome Extensions via Gnome Tweaks tool!

Upgrade to Ubuntu 22.04:

NOTE: The upgrade process may fail! If you can’t afford to have a broken system, please do a clean install instead of upgrading it!

1.) Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to install all available system updates:

sudo apt update && sudo apt full-upgrade

install all available system updates

And, restart your computer if you have not run system updates for a long time.

2.) Next, in terminal run the command below to run update manager to check distribution update:

update-manager -d -c

If there are still available updates or removals, click on ‘Install Now’ and re-run the command.

3.) Once you see the prompt for Ubuntu 22.04. Click on “Upgrade” button, and confirm in the next ‘Release Notes’ dialog.

4.) It will pop-up another dialog asks to confirm via ‘Start Upgrade’ button. Once you click on it, the ‘Distribution Upgrade’ wizard will pop-up indicates the upgrading process.

5.) Don’t go far away from your computer!! There will be a few more confirm dialogs, so you have to keep an eye on the screen.

If everything goes well, there will be a dialog asks to “Restart” to complete the upgrade.

Sadly, I went out when it was ‘Getting new packages‘. And the upgrade process failed at blank screen when I was back! So there’s no screenshot for this step.

Troubleshoot:

There may be various reasons that the upgrade failed. Here are the issues in my case.

As mentioned, the upgrade failed in my case and the laptop run into blank screen. And, I did following steps that successfully finish the upgrade.

1.) Force reboot and login. Press Ctrl+Alt+F2 (F3 ~ F6) and type username, then password to log into tty console if GDM (login screen) does not start. Or, select boot “Advanced -> recover mode -> drop root shell prompt” from boot-loader if Ubuntu refused to boot!

2.) Once logged in, try running command to configure unfinished packages:

sudo dpkg --configure -a

3.) And, try to fix broken dependencies via command:

sudo apt -f install

In my case, some third-party packages (e.g., libfilezilla12 from xtradeb PPA, and libreoffice-common from LibreOffice Fresh PPA) break the dependencies! And, the command failed with something look like:

trying to overwrite ‘…’, which is also in package libfilezilla12 0.27.1~extradeb1
Errors were encountered while processing:

E: Sub-process /usr/bin/dpkg returned an error code(1)

To fix the issue, just remove the package via command (replace package name ‘libfilezilla12’ accordingly):

sudo dpkg -P libfilezilla12

Then re-run the sudo apt -f install until it’s done successfully without error!

4.) Install all available system updates via command:

sudo apt full-upgrade

If everything goes well, clean up via command:

sudo apt remove --autoremove

And finally restart computer via reboot command.

5.) Some packages are however missing in my case after restart. They were fixed by manually installing the packages via the commands below.

  • No login screen or non-gnome login screen, run command and then reboot:
    sudo apt install gdm3 && sudo dpkg-reconfigure gdm3
  • Miss pre-installed extensions (left-dock, desktop icons, and appindicator), run command and then log out and back in:
    sudo apt install gnome-shell-extension-ubuntu-dock gnome-shell-extension-appindicator gnome-shell-extension-desktop-icons-ng

Want GCC 4.8 with c++11 complete feature? Well here’s how to install it in Ubuntu 12.04, Ubuntu 13.04, Ubuntu 12.10 via the PPA.

The PPA provides both GCC 4.7.3 and GCC 4.8.1 for Ubuntu users. In this tutorial, you can follow below steps to upgrade gcc version in your system.

1.) Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run below commands to add the ppa:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

2.) Then install gcc 4.8 and g++ 4.8:

sudo apt-get update; sudo apt-get install gcc-4.8 g++-4.8

3.) Once installed, run following commands one by one to use gcc 4.8 instead of previous version.

sudo update-alternatives --remove-all gcc 

sudo update-alternatives --remove-all g++

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20

sudo update-alternatives --config gcc

sudo update-alternatives --config g++

Now you have the gcc 4.8 with c++11 complete feature in your system. Check out by:

gcc --version

gcc (Ubuntu 4.8.1-2ubuntu1~13.04) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

R Statistical PackageIf you have problem installing R statistical package via the official document. Here’s easy guide with pictures shows you how to install R package in Ubuntu 13.04, Ubuntu 12.04, Ubuntu 12.10, Ubuntu 10.04.

R Package is available in Ubuntu Software Center by default, but it’s old. This tutorial will install the latest verson – so far it is 3.0.1 – in Ubuntu via the via official repository.

Add R Statistical Package Repository:

Search for and open Software & Updates from unity dash home.

software&updates

Navigate to Other Software tab, click Add and paste below line in pop-up window.

For Ubuntu 12.04: deb http://cran.stat.ucla.edu/bin/linux/ubuntu precise/

For Ubuntu 13.04: deb http://cran.stat.ucla.edu/bin/linux/ubuntu raring/

For Ubuntu 12.10: deb http://cran.stat.ucla.edu/bin/linux/ubuntu quantal/

For Ubuntu 10.04: deb http://cran.stat.ucla.edu/bin/linux/ubuntu lucid/

add r package repository

You can change “cran.stat.ucla.edu” to other mirrors.

Install R Statistical Package:

After added the repository, press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run below command to get the key:

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

add r package keyring

Finally, you can use Synaptic Package Manager (install it from Ubuntu Software Center) to install R Package.

install r package ubuntu

Gdebi is a lightweight deb packages installer which was the default in Ubuntu Desktop. Now Ubuntu uses Ubuntu Software Center which is slow and frequently gives me ‘The package is of bad quality’ error.

You can easily install Gdebi package installer (default in Linux Mint) and set it as default deb installer by this tutorial.

Go to Ubuntu Software Center, search for and install GDebi Package Installer (gdebi) package:

install gdebi package installer

Then, open your file manager and go to Properties window of one deb package by right-clicking on it. Under open with tab, highlight Gdebi package installer and click Set as default button.

set default package installer

That’s it. Enjoy!