没有不值得去解决的问题,也没有不值得去学习的技术!

Initial Ubuntu Configuration: Basic Settings and Software Installation

After installation, open the Fcitx5 configuration tool (fcitx5-configtool), and add "Wubi-Pinyin" in the "Input Method" tab to start using it.

This article is based on a real installation and configuration process of Ubuntu 26.04 on a ThinkPad T570. All commands are actual operation records, including some failed attempts and explanations, aiming to provide a complete and reproducible initialization guide.

Environment Overview

  • Operating System: Ubuntu 26.04 (codename resolute)
  • Hardware: ThinkPad T570, NVIDIA GeForce 940MX discrete graphics card
  • Terminal: GNOME Terminal + bash

1. Changing Software Sources (Including Failed Attempt)

Right after installing the system, to improve download speeds, I first attempted to replace the official source with the Alibaba Cloud mirror. I executed the following command:

Bash
sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list

After entering the password, the command executed successfully (without errors). However, when I subsequently ran sudo apt update, the output showed:

Plaintext
Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute InRelease
Hit:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu resolute-updates InRelease
...

This indicates that the software source actually in use is already the Tsinghua University TUNA mirror, rather than the official source or the Alibaba Cloud source. Why did the sed command not take effect? I checked the contents of /etc/apt/sources.list:

Bash
cat /etc/apt/sources.list

The output was:

Plaintext
# Ubuntu sources have moved to /etc/apt/sources.list.d/ubuntu.sources

It turns out that starting from Ubuntu 24.04, the APT source configuration migrated to the DEB822 format. The traditional sources.list file has been deprecated, and the actual configuration is located at /etc/apt/sources.list.d/ubuntu.sources. I viewed this file:

Bash
cat /etc/apt/sources.list.d/ubuntu.sources

The output was:

Plaintext
Types: deb
URIs: http://cn.archive.ubuntu.com/ubuntu/
Suites: resolute resolute-updates resolute-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: resolute-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

As you can see, the official source address is cn.archive.ubuntu.com (China region CDN mirror), yet apt update showed that data was being fetched from mirrors.tuna.tsinghua.edu.cn. This is because Ubuntu’s cn.archive.ubuntu.com domain automatically redirects via DNS or HTTP to the fastest domestic mirror site (in this case, the Tsinghua source). Therefore, a fresh installation of Ubuntu 26.04 has already automatically obtained a high-speed domestic mirror, so there is no need to manually change the source.

The aforementioned sed command failed to take effect for two reasons: first, it modified the wrong file (sources.list is deprecated); second, even if the correct DEB822 file were modified, the original string archive.ubuntu.com does not exist in the current configuration. If you still wish to force the use of a specific mirror (such as Alibaba Cloud), you can edit /etc/apt/sources.list.d/ubuntu.sources, replace URIs: http://cn.archive.ubuntu.com/ubuntu/ with URIs: http://mirrors.aliyun.com/ubuntu/, and then execute sudo apt update. Considering that the existing automatic redirection mechanism is already quite fast, I kept the default configuration and proceeded with the subsequent steps.


2. System Update and Package Upgrade

Execute the update and upgrade all installed packages:

Bash
sudo apt update && sudo apt upgrade -y

The output showed:

  • Hit the Tsinghua source, security source, etc.
  • 12 packages can be upgraded (including base-files, gnome-control-center, snapd, etc.)
  • Download size 45.3 MB, automatically installed

Meanwhile, the system prompted that there are old kernel packages (such as linux-headers-7.0.0-14) that are no longer needed, which will be cleaned up later.

Sample upgrade output:

Plaintext
Setting up gnome-control-center (1:50.0-0ubuntu6.1) ...
update-initramfs: Generating /boot/initrd.img-7.0.0-15-generic

3. Installing NVIDIA Graphics Driver

3.1 Checking Available Driver Versions

Bash
ubuntu-drivers devices

Output:

Plaintext
model    : GM108M [GeForce 940MX] (ThinkPad T570)
driver   : nvidia-driver-580 - distro non-free recommended

The system recommends nvidia-driver-580.

3.2 Trying the Outdated autoinstall Command (Failed)

Bash
sudo ubuntu-drivers autoinstall

Error reported:

Plaintext
Error: No such command 'autoinstall'.

This indicates that the new version of ubuntu-drivers has deprecated autoinstall; install should be used instead.

3.3 Using the Correct Installation Command

Bash
sudo ubuntu-drivers install

After execution, the system prompted:

Plaintext
All the available drivers are already installed.

This means the NVIDIA driver was already present in the system, and there was no need to install it again. Why would a fresh Ubuntu installation come with the NVIDIA proprietary driver?

This is closely related to the options selected during system installation. During the Ubuntu 26.04 installation process, there is an interface titled “Install recommended proprietary software?”, which contains two key options:

  • “Install third-party software for graphics and Wi-Fi hardware” – The text below this option explicitly states: “Includes but is not limited to NVIDIA drivers and similar software.” If checked, the installer will automatically detect hardware (such as NVIDIA graphics cards, Broadcom wireless network cards, etc.) and download and install the corresponding proprietary drivers from the software sources.
  • “Download and install support for additional media formats” – This option installs multimedia decoders (such as MP3, H.264, etc.), which is unrelated to graphics drivers but is usually checked by users along with the previous option.

Because “Install third-party software for graphics and Wi-Fi hardware” was checked during this installation, the system automatically completed the deployment of the NVIDIA GeForce 940MX driver during the installation process. Therefore, the ubuntu-drivers install command run after installation prompted “All the available drivers are already installed.”

💡 Note: Even if this option was not checked during installation, you can manually run sudo ubuntu-drivers install or sudo apt install nvidia-driver-580 after the system installation to install the driver. Both methods achieve the same result.

4. Enabling the Firewall

Bash
sudo ufw enable

Output:

Plaintext
Enabling and activating the firewall at system startup

Basic security protection has been enabled.


5. Installing Common Software and Multimedia Support

Install git, curl, vim, htop, unzip, and ubuntu-restricted-extras (multimedia decoders + Microsoft fonts):

Bash
sudo apt install git curl vim htop unzip ubuntu-restricted-extras

5.1 Automatic Installation of Dependencies

The system will automatically install dependency packages such as cabextract, git-man, liberror-perl, libmspack0t64, ttf-mscorefonts-installer, unrar, and vim-runtime.

5.2 Accepting the Microsoft Font EULA

When installing ttf-mscorefonts-installer, a license agreement window will pop up. As shown in the figure below, the full EULA text is displayed first:

Figure 3 – Microsoft Font EULA content

Then an acceptance dialog box appears, with “No” highlighted by default:

Figure 4 – Prompt asking whether to accept the EULA terms

Operation method: Use the Tab key to move the highlight to “OK” or “Yes”, and then press Enter to confirm. Afterward, all fonts (Andale, Arial, Times New Roman, etc.) are automatically downloaded and extracted.

5.3 Font Download and Installation Process

The terminal output showed that 11 .exe files were being downloaded from SourceForge, and cabextract was used to extract the TrueType fonts. Finally, it prompted:

Plaintext
All fonts downloaded and installed.

6. Cleaning Up Old Kernels and Dependencies

According to the system prompt, remove the old kernel packages that are no longer needed:

Bash
sudo apt autoremove -y

Packages to be removed:

  • linux-headers-7.0.0-14
  • linux-image-unsigned-7.0.0-14-generic
  • linux-modules-7.0.0-14-generic
  • And 7 packages in total

This frees up approximately 319 MB of space. At the same time, GRUB updated automatically and detected the Windows Boot Manager (the dual-boot entry was preserved).


7. Verifying the Final State of the Graphics Driver

Run nvidia-smi again to confirm the driver is working properly:

Plaintext
Tue May 26 20:03:04 2026       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.159.03             Driver Version: 580.159.03     CUDA Version: 13.0     |
|   0  NVIDIA GeForce 940MX           Off | 00000000:02:00.0 Off |                  N/A |
| N/A   46C    P8            N/A  /  200W |       4MiB /   2048MiB |      0%      Default |
+-----------------------------------------------------------------------------------------+

8. Installing Chinese Input Method (IBus Pinyin)

Bash
sudo apt install ibus-libpinyin

The system prompted that it is already the latest version. After installation, the input method framework needs to be configured.

8.1 Selecting the Input Method Framework

Open the “Language Support” window to switch the keyboard input method system. The figure below shows the Fcitx5 framework:

Figure 1 – Selecting Fcitx5 in Language Support

However, Ubuntu officially recommends using IBus, especially for complex input methods like Chinese and Japanese:

Figure 2 – Selecting IBus in Language Support

Since we installed ibus-libpinyin, ensure that the “Keyboard input method system” is set to IBus (as shown in the figure above). Afterwards, log out of the current session and log back in, then add “Chinese (Intelligent Pinyin)” under “Settings → Keyboard → Input Sources”. Press Windows + 空格 to switch between Chinese and English input.

I initially installed the IBus Pinyin input method (ibus-libpinyin), and I could type Pinyin normally using Win + Space. However, Pinyin input was not efficient enough for me, and I prefer a mixed Wubi-Pinyin input mode, so I decided to switch to the Fcitx5 framework. I executed the following command to install Fcitx5 and its Chinese plugins:

Bash
sudo apt install fcitx5 fcitx5-chinese-addons

Typical output after execution is as follows (if already installed, it will prompt that it is the latest version):

Plaintext
Reading package lists... Done
Building dependency tree... Done
fcitx5 is already the newest version (5.1.7-1ubuntu1).
fcitx5-chinese-addons is already the newest version (5.1.6-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

After installation, open the Fcitx5 configuration tool (fcitx5-configtool), and add “Wubi-Pinyin” in the “Input Method” tab to start using it.

After installation, open the Fcitx5 configuration tool (fcitx5-configtool), and add "Wubi-Pinyin" in the "Input Method" tab to start using it.

Under the default Wayland display server, Fcitx5 usually runs perfectly fine (this is the case on my ThinkPad T570). If you encounter compatibility issues such as the candidate box not following the cursor, you can log out and switch to an Xorg session (click the gear icon on the login screen and select “Ubuntu on Xorg”).


9. Configuration Summary and Follow-up Suggestions

After executing all the above commands, the system status is as follows:

ItemStatus
Software SourceDefault mirror (domestic high-speed)
System PackagesAll up to date (12 packages upgraded)
Old KernelCleaned up, 319MB freed
NVIDIA Driver580.159.03, CUDA 13.0, working normally
FirewallEnabled
Basic Toolsgit, curl, vim, htop, unzip installed
Multimedia SupportDecoders + Microsoft fonts installed
Chinese Input Methodibus-libpinyin available

Optional Follow-up Optimizations (I did not perform any of the following operations)

  • Laptop Battery Management: sudo apt install tlp tlp-rdw && sudo systemctl enable tlp
  • System Backup: sudo apt install timeshift
  • GNOME Customization: sudo apt install gnome-tweaks gnome-shell-extensions
  • Development Environment: Python (python3-pip, python3-venv), Node.js, Docker, etc.
  • Disable Ubuntu Pro Prompt: sudo pro config set apt_news=false

Conclusion

This article documents the complete command-line operations from post-installation to getting the system ready, including failed attempts and correct solutions. I hope this guide, compiled from real operations, helps you quickly configure your own Ubuntu environment. If you encounter any issues during the configuration process, feel free to troubleshoot by comparing with the steps and screenshots in this article.

Your Ubuntu 26.04 is now ready! 🎉

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系