Archives For Howtos

This simple tutorial shows how to install brave browser via the new apt source policy in Ubuntu 23.04 & 22.04.

Due to security issue, Debian changed its policy for adding apt sources. Ubuntu is changing the rules too. Since Ubuntu 22.04, it uses more secure key files with digital signature for system repositories and PPAs.

In Ubuntu 23.10 (in development at the moment),  it now uses deb822 .sources file instead of the previous .list file for third-party repositories. And, the new source files include ‘Signed-by’ section to specify the key file.

Step 1: Install curl command line download tool

First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to install curl and apt-transport-https package:

sudo apt install apt-transport-https curl

Type user password (no asterisk feedback) when it asks.

Step 2: Download & Install the key

Then, run curl command to download the key file and save it into /usr/share/keyrings folder.

This can be done by running the single command below in terminal:

sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg

Step 3: Add the brave apt source repository

The previous .list file with or without ‘Signed-By’ is still working! But here I’m going to show the new .sources file.

1. First, run command to create a .sources file under ‘/etc/apt/sources.list.d’:

sudo gedit /etc/apt/sources.list.d/brave-browser-release.sources

Replace gedit with gnome-text-editor for Ubuntu 23.04 and higher.

2. Then in the pop-up text editor window, paste following lines:

Types: deb
URIs: https://brave-browser-apt-release.s3.brave.com/
Suites: stable
Components: main
Architectures: amd64
Signed-By: /usr/share/keyrings/brave-browser-archive-keyring.gpg

As you see, the new source file is easy to read, but a bit hard to write for beginners. See this thread for more about it.

Step 4: Update cache & install Brave Browser

After saving the file in last step, you can now run commands below to refresh the system package cache:

sudo apt update

And, finally install the web browser via command:

sudo apt install brave-browser

You don’t have to run the command every time when a new release is out. Just launch “Software Updater”, newer release of the browser package will be available there along with system package updates.

Uninstall Brave:

To remove brave browser package, open terminal (Ctrl+Alt+T) and run command:

sudo apt remove --autoremove brave-browser

And remove the apt source repository by running command:

sudo rm /etc/apt/sources.list.d/brave-browser-release.list

Also remove the key file via command:

sudo rm /usr/share/keyrings/brave-browser-archive-keyring.gpg

Finally, run sudo apt update to refresh system package index.

For developers who want to prepare their project for the latest Python releases, here’s how to install Python 3.12 in all current Ubuntu releases.

Python 3.12 now is in Beta development stage. It features more flexible f-string parsing, new type annotation syntax for generic classes, support for the Linux perf profiler, and many performance improvements, but removed the distutils package and wstr from Unicode. See more about Python 3.12.

How to Install Python 3.12

Python is easy to install in Ubuntu by either using the popular Deadsnakes PPA or building from the source. Choose either one that you prefer.

Option 1: Install Python 3.12 from PPA

For Ubuntu 22.04, Ubuntu 20.04, and their derivatives such as Linux Mint 21, the Deadsnakes PPA has made the packages for all supported CPU architecture types: amd64, arm64/armhf, ppc64el, and s390x.

1. First, press Ctrl+Alt+T on keyboard to open terminal. Then paste the command below and hit run to add PPA:

sudo add-apt-repository ppa:deadsnakes/ppa

Type user password (no asterisk feedback) when it asks and hit Enter to continue.

2. Ubuntu 20.04+ automatically refresh package cache while adding PPA. However, Linux Mint user may need to do this job manually by running command:

sudo apt update

3. Finally, run command to install Python 3.12:

sudo apt install python3.12

Option 2: Compile and install Python 3.12 from source

Don’t trust third-party repositories or you’re running Ubuntu 23.04 or Ubuntu 18.04? It’s easy to build Python from the source tarball.

1. First download the source tarball from its ftp download page:

2. Then open ‘Downloads’ folder, extract the source tarball, finally right-click on source folder and select “Open in Terminal”.

3. When terminal opens, run the commands below one by one to configure and build Python:

./configure --enable-optimizations
sudo make -j4 && sudo make altinstall

NOTE: You have to first install all build dependency libraries before running last 2 commands. See this tutorial for details.

Verify:

Once installed Python 3.12, verify by running command:

python3.12 --version && pip3.12 --version

Set Python 3.12 as default

It’s NOT recommended to set non-preinstalled Python package as default for Python3, since it will break some core applications.

However, you may try to set python3.12 as python by running the commands below one by one:

  • First, run command to find out where Python 3.12 executable is installed to:
    whereis python3.12

    It’s either /usr/bin/python3.12 or /usr/local/bin/python3.12.

  • Then, add Python 3.12 as an alternative link to python (replace /usr/local/bin/python3.12 according last command output).
    sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3.12 1
  • Finally, run command to set default for /usr/bin/python executable if more then one available:
    sudo update-alternatives --config python

Uninstall Python 3.12:

If you installed Python 3.12 using the PPA repository, simply open terminal and run command to remove it:

sudo apt remove --autoremove python3.12

For the PPA, run command to remove it:

sudo add-apt-repository --remove ppa:deadsnakes/ppa

If you built the Python 3.12 from source tarball, then there’s no uninstaller script to automate the job.

However, you may manually remove the installed files by running commands:

cd /usr/local/bin && sudo rm python3.12* pip3.12 idle3.12 pydoc3.12 2to3-3.12
cd /usr/local/lib && sudo rm -R python3.12 pkgconfig libpython3.12.a

RedHat announced the release of Podman Desktop 1.0 general availability (GA) on Tuesday. Here’s how to install it in all current Ubuntu releases.

Podman Desktop is a container management tool.  It provides a simple and user friendly user interface to easily create, manage, and deploy Podman, Docker, Lima, Openshift Local, Kind, etc containers and complex container configurations all in one place.

The app provides out-of-the-box Kubernetes environment based on Kind, allowing to create a multi-node Kubernetes cluster on local machine, and test applications without having to install and configure Kubernetes manually.

Other features include:

  • Install and run in Windows, macOS, and Linux
  • Keep Podman and other dependencies up to date
  • Manage multiple container engines at the same time.
  • Compatabile with Docker Compose
  • VPN and proxies configuration
  • And more and more, see release note for details.

How to Install Podman Desktop 1.0 in Ubuntu:

The application is available to install in most Linux using Flatpak package. Fedora 38 & Linux Mint 21 can simply search for and install it from either Gnome Software or Software Manager.

For all current Ubuntu users, follow the steps below one by one to get it.

1. First, open terminal either by searching from ‘Activities’ overview or by pressing Ctrl+Alt+T on keyboard.

2. Then, run command to enable flatpak support.

sudo apt install flatpak

Ubuntu 18.04 user need to run the 2 sudo commands to add the Flatpak PPA first.

3. Finally, install Podman Desktop by running command:

flatpak install https://dl.flathub.org/repo/appstream/io.podman_desktop.PodmanDesktop.flatpakref

NOTE: Besides the software package itself, there may be other run-time libraries to install automatically.

Once installed, search for and launch it from ‘Activities’ overview and enjoy!

NOTE: first time installing a flatpak app may needs a log out and back in to make app icon visible.

Uninstall Podman Desktop

To remove the software package, also press Ctrl+Alt+T on keyboard to open terminal and run command:

flatpak uninstall io.podman_desktop.PodmanDesktop

Also run flatpak uninstall --unused to remove useless runtime libraries.

The ‘Tab’ key bash auto-completion does not work for you? Here’s how to re-enable this feature in Ubuntu.

When typing in terminal/command console, user can press ‘Tab’ key to auto-complete command, options, file path & name. This feature is quite useful and available out-of-the-box for every user with home directory.

If you broke something done and the feature does no longer work, then this tutorial could help.

Step 1: Install bash-completion package

For Debian, Ubuntu, and most other Linux, this feature is implemented by bash-completion package files. So the first step is to make sure that package is installed on your system.

To do so, open terminal/command console and run command:

sudo apt install bash-completion

Step 2: Enable Bash Completion

For each user, there’s a .bashrc file in user home directory. The file runs automatically on every login, and it contains the rule to enable bash completion.

1. First, run command to edit the file:

nano ~/.bashrc

2. When the file opens, add the following lines or make sure the lines below exist:

if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

To save file, press Ctrl+X, type y and hit Enter.

You can alternatively edit the system wide config file:

sudo nano /etc/bash.bashrc

Then enable the corresponding lines (remove # at the beginning for each line), so it applies to all users at login.

After saving the change, it should work immediately in new terminal window or command console.

In addition

The default configuration files for bash completion is located in “/usr/share/bash-completion”. However, some Linux Distro or may be 3rd party program may add rules by creating files under “/etc/bash_completion.d/”.

So, if the feature does not work for a specific command, go check the config file under “/etc/bash_completion.d/”.

For Ubuntu 23.04, Fedora 38 and other Linux with Python 3.11 as default, Pithos 1.6.1 was released today to fix the plugin support!

Pithos is a simple free open-source GTK client for Pandora music & podcasts, writing in Python programming language.

The previous versions lack plugin support for the latest Linux Distributions due to Python 3.11. When you try to open the ‘Plugins’ tab in Preferences, it just shows a blank page.

If you start it from command line, it will output something look like:

Traceback (most recent call last):
  File "/usr/share/pithos/pithos/plugin.py", line 147, in on_got_bus
    plugin = plugins[name] = load_plugin(name, window, bus)
                             
  File "/usr/share/pithos/pithos/plugin.py", line 101, in load_plugin
    module = __import__('pithos.plugins.' + name)
             
  File "/usr/share/pithos/pithos/plugins/mpris.py", line 66, in 
    class PithosMprisService(DBusServiceObject):
  File "/usr/share/pithos/pithos/plugins/mpris.py", line 647, in PithosMprisService
    @dbus_method(MEDIA_PLAYER2_IFACE)
     
  File "/usr/share/pithos/pithos/plugins/dbus_util/DBusServiceObject.py", line 138, in decorator
    in_args = _create_arginfo_list(func, in_signature)
              
  File "/usr/share/pithos/pithos/plugins/dbus_util/DBusServiceObject.py", line 123, in _create_arginfo_list
    arg_names = inspect.getargspec(func).args

To fix the issue, the new 1.6.1 was released. Which, also fixed the issue that very short songs are being labeled as advertisements.

Nothing else!

How to Install Pithos 1.6.1 in Ubuntu via PPA

For all current Ubuntu releases, including Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04, Ubuntu 22.10, Ubuntu 23.04, and their based systems, I’ve uploaded the app package into this PPA repository.

To add the PPA and install Pithos package, do:

  1. First, press Ctrl+Alt+T key combination on keyboard to open terminal. When it opens, run the command below to add the PPA:
    sudo add-apt-repository ppa:ubuntuhandbook1/apps

    Type user password when it asks (no asterisk feedback) and hit Enter to continue.

  2. Then, run command to fresh the package cache for old Ubuntu 18.04 and Linux Mint:
    sudo apt update
  3. Finally, install or update the lightweight Pandora Radio client to listen online music:
    sudo apt install pithos

As the application does not update frequently, you may also download & install the .deb package directly from this page.

For most Linux, Pithos is also available to install as Flatpak package runs in sandbox.

Uninstall Pithos

To remove the Ubuntu PPA, open terminal and run command:

sudo add-apt-repository --remove ppa:ubuntuhandbook1/apps

Or, open ‘Software & Updates’ utility and remove the source line under ‘Other Software’ tab.

To remove Pithos, use command:

sudo apt remove --autoremove pithos