Opera Browser is a fast, secure, and feature-rich web browser known for its built-in ad blocker, VPN, and support for a wide range of extensions. It offers a smooth browsing experience with unique features like the integrated social media sidebar, battery saver mode, and a customizable news feed. Opera is available in multiple versions, including stable, beta, and developer builds, allowing users to choose between a tested version or the latest experimental features.
On Ubuntu 24.04, 22.04, or 20.04, you can install Opera Browser using the official Opera APT repository, which provides access to the latest stable, beta, and developer builds. This method ensures that your Opera installation stays up-to-date with the latest features and security updates directly from the Opera development team. This guide will walk you through the process of setting up the Opera APT repository and installing the version of Opera that best suits your needs.
Update the Ubuntu System Before Installing Opera Browser
Before diving into the process, ensuring that your Ubuntu system is current with all available packages is essential. This ensures compatibility and reduces potential conflicts during the installation of the Opera Browser.
Open your terminal and run the following command:
sudo apt update
After checking for updates, proceed to upgrade any packages that might be outdated:
sudo apt upgrade
Setting Up Required Packages for Opera Browser Installation
Now, it’s time to ensure your system has the necessary dependencies for Opera Browser:
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y
These packages are foundational and frequently found across many Linux distributions.
Importing Opera Browser’s GPG Key
To ensure the authenticity of the Opera Browser packages, we’ll import its GPG key with the following command:
curl -fsSL https://deb.opera.com/archive.key | gpg --dearmor | sudo tee /usr/share/keyrings/opera.gpg > /dev/null
This security measure ensures that the software you’re installing is genuine and hasn’t been tampered with.
Adding Opera Browser APT Repository to Your System
Finally, we’ll add the Opera Browser’s APT repository to our system:
echo deb [arch=amd64 signed-by=/usr/share/keyrings/opera.gpg] https://deb.opera.com/opera-stable/ stable non-free | sudo tee /etc/apt/sources.list.d/opera.list
This lets your system recognize and fetch Opera Browser packages directly from its official source.
Update and Install Opera Browser – stable build (recommended)
First, update your apt repository index to reflect the changes in the new repository. This is done with the following apt update command:
sudo apt update
Now install the software with the following command:
sudo apt install opera-stable
During installation, you might notice a prompt asking if you wish to configure and allow for more recent version upgrades by adding Opera’s repository file to the “/etc/apt/sources.list.d/” directory.
Note: You must not select ‘yes’ and instead select ‘no’. You’ve already imported the necessary repository list earlier. The method employed by Opera is a standard procedure for matching the GPG key with the repository to ensure the software’s authenticity and integrity.
Note: You will be prompted to do this for each version stable, beta, and developer, so select no every time.
Once installed, confirm the version of Opera Browser installed:
opera --version
This will also verify the installation was successful.
Install Opera Browser Beta and Developer Builds
If you’re interested in exploring Opera’s cutting-edge features, you might want to consider installing its Beta or Developer builds. These builds are designed for users who wish to test the latest functionalities before rolling out to the general public. One of the great things about Opera’s various builds is that they coexist independently. You can install and use the Stable, Beta, and Developer builds concurrently on the same system without conflicts.
Install Opera Browser Beta Build
To get started with the Beta build, execute the following command:
sudo apt install opera-beta
After installation, you might want to check the installed version to confirm that everything went smoothly. To do this, run:
opera-beta --version
Install Opera Browser Developer Build
For those eager to experience the absolute latest features and developments from the Opera team, the Developer build is the way to go. To install it, use the following command:
sudo apt install opera-developer
Just as with the Beta build, you can verify the successful installation of the Developer build by checking its version:
opera-developer --version
Launch Opera Browser via GUI or CLI Methods
Terminal Commands for Launching Opera Browser
If you’re already in the terminal and wish to launch the Opera Browser, input the relevant command based on the version you installed:
opera
For the beta version:
opera-beta
And for the developer version:
opera-developer
While using the terminal is efficient for some, it might not be the most convenient method for daily use.
Accessing Opera from the Desktop
For a more direct approach, especially if you’re not working in the terminal, you can easily find and launch the Opera Browser from your desktop environment:
Navigate to Applications, use the Search function, and then select Opera {version} from the list of applications.
Management Commands for Opera Browser
Update Opera Browser
To start, open your terminal. Here, you’ll execute the APT update command. This command scans your system for any available updates, ensuring all your installed applications are up-to-date.
sudo apt update
You can upgrade your system once the update command has completed its scan. To do this, run:
sudo apt upgrade
This command will upgrade all outdated packages on your system. However, if you prefer to update the Opera Browser package specifically, you can do so by running the following command:
sudo apt upgrade opera-stable
Note that if you have installed other versions of Opera Browser, such as Beta or Developer, you can upgrade them by appending “-beta” or “-developer” to the command, respectively.
Remove Opera Browser
Opera Browser APT Remove Commands
First, identify the version of Opera Browser you have installed. Once you’ve determined the version, run the corresponding command to remove it:
sudo apt remove opera-stable
sudo apt remove opera-beta
sudo apt remove opera-developer
Remove Opera APT Repository and GPG Key
After removing the Opera Browser package, delete the Opera APT repository from your system. This step is significant if you no longer wish to install or re-install Opera Browser in the future. Run the following command to remove the repository:
sudo rm /etc/apt/sources.list.d/opera.list
Optionally, you can also delete the GPG key associated with the Opera Browser package:
sudo rm /usr/share/keyrings/opera.gpg
Note: This step is optional and depends on your plans for using Opera Browser on your system.
Fixing Multiple Opera Sources.list
Identifying and Resolving Duplicate Sources.list Entries
You might have inadvertently imported multiple sources if you chose “YES” while installing Opera Browser.list files. This situation becomes evident when you run an update command and notice your terminal cluttered with duplicate sources. Although this doesn’t hinder the update process, addressing the issue with a cleaner system is preferable.
Clearing Opera Browser Duplicate Entries
To rectify this, begin by removing the additional entries, ensuring to retain the original:
sudo rm /etc/apt/sources.list.d/opera*
Re-Adding Single Opera Repository
Next, re-introduce the single, necessary repository:
echo deb [arch=amd64 signed-by=/usr/share/keyrings/opera.gpg] https://deb.opera.com/opera-stable/ stable non-free | sudo tee /etc/apt/sources.list.d/opera.list
Executing this command re-installs all three versions of the browser: stable, beta, and developer. This step assumes you initially installed all three during the tutorial.
Refresh APT Index Cache
Finally, ensure to update your system to apply the changes:
sudo apt update
Following these steps, you resolve the issue of duplicate sources, leading to a cleaner update process. Moreover, updates for all three Opera Browser versions will be received from a single source.list instead of three. In the event of accidental deletion of the original entries, refer back to this tutorial to copy the necessary import directory code.
Resolving Opera Browser’s Language Switching Issue
Many users who prefer languages other than English face difficulties when changing the language in Opera Browser. This is because the browser tends to exhibit issues with language switching. I’ve received several personal emails addressing this concern.
Setting the Opera Browser Language
To resolve this issue, you must set the browser’s language and include a launch command in the application file, which requires modification. Depending on the language and the version of Opera you are using (if it’s the English version), you might need to install additional language packs. Below is a comprehensive guide to help you through this process.
Modifying the Application File
Open your terminal and use the following command as an example:
sudo sed -i 's/Exec=opera %U/Exec=opera --lang={LANGUAGE CODE} %U/g' /usr/share/applications/opera.desktop
In this command, replace {LANGUAGE CODE} with the appropriate code for your desired language (e.g., ‘de’ for German, ‘es’ for Spanish, ‘ja’ for Japanese, etc.). This modification is for the Opera stable version. If you have installed the beta or developer versions, you need to adjust their application files similarly:
- For Opera beta: /usr/share/applications/opera-beta.desktop
- For Opera developer: /usr/share/applications/opera-developer.desktop
Installing Language Packs (If Necessary)
If you have installed the English version of Opera and are experiencing difficulties in switching languages, you might need to install additional language packs using the following command:
sudo apt install $(check-language-support -l {language extension})
Here’s an example for German:
sudo apt install $(check-language-support -l de)
Applying Language Settings
Below, I’ve provided commands for some of the most popular languages for easy copy-pasting. Please note that these commands are for the stable version of Opera. As mentioned earlier, you need to adjust the commands for the beta or developer versions. Ensure you’ve also added the language on the browser’s GUI side.
German
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=de %U/g' /usr/share/applications/opera.desktop
French
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=fr %U/g' /usr/share/applications/opera.desktop
Italian
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=it %U/g' /usr/share/applications/opera.desktop
Japanese
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=ja %U/g' /usr/share/applications/opera.desktop
Korean
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=ko %U/g' /usr/share/applications/opera.desktop
Spanish
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=es %U/g' /usr/share/applications/opera.desktop
Portuguese
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=pt %U/g' /usr/share/applications/opera.desktop
Polish
sudo sed -i 's/Exec=opera %U/Exec=opera --lang=pl %U/g' /usr/share/applications/opera.desktop
Conclusion
With Opera Browser installed on your Ubuntu system using the official APT repository, you can enjoy a secure and customizable browsing experience. This method ensures that you have access to the latest stable, beta, or developer builds, depending on your preference. Regular updates through the repository will keep your Opera installation current with the newest features and security improvements, providing a reliable and versatile web browsing experience on Ubuntu.
my system responds: “Unable to locate package opera-stable” after following every previous step (repeatedly). is there something I can check that might be different on my system?
Running:
Operating System: Ubuntu Studio 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 6.5.0-35-lowlatency (64-bit)
Graphics Platform: X11
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Hi Carl,
Please open up /etc/apt/sources.list.d/opera.list, use nano for example
sudo nano /etc/apt/sources.list.d/opera.list
. What does it say in it?Seems like the package cannot be located, so this is a first step, as it could be many things.
Thanks.