Ubuntu22.04 LTS partition and configuration optimization (one step)

Ubuntu 22.04 LTS Introduction

A long-term support release focused on stability, security, and user-friendliness for both personal and business users. It provides a modern desktop environment and various software updates while focusing on system performance and security. Whether for daily use or professional use, Ubuntu 22.04 LTS is a reliable and powerful operating system choice.

Key points:

1. Long-term support: The LTS version means it will receive official support and updates for up to 5 years, including security patches and software updates. This makes Ubuntu 22.04 ideal for business and personal users as they can rely on a stable and reliable operating system.
2. GNOME desktop environment: Ubuntu 22.04 LTS will continue to use the GNOME desktop environment as the default desktop. GNOME provides an intuitive, modern and powerful user interface that is highly customizable.
3. New software versions: As the Ubuntu version is upgraded, many software packages will also be upgraded, including core components and applications. This will include updated kernels, new versions of the LibreOffice office suite, Firefox browser, and more.
4. Improved performance and stability: Ubuntu 22.04 LTS will introduce some performance and stability improvements to improve overall system responsiveness and user experience.
5. Security enhancement: Ubuntu has always focused on security, and 22.04 LTS will continue to enhance system security. This includes timely security updates, hardened security configurations, and enhanced privacy features.


1. System disk U disk production

Prepare an empty USB flash drive in advance to install Ubuntu 22.04 LTS. You need to follow the following steps:

  1. A USB flash drive: Please ensure that the USB flash drive has sufficient capacity (at least 8GB), and it is best to be empty, because when the system is written to the USB flash drive, all data will be erased regardless of whether there is any data.

  2. Download the Ubuntu 22.04 LTS image file: from the Ubuntu official website (https://ubuntu.com/download) or from the domestic Tsinghua source (https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/22.04.2/ ubuntu-22.04.2-desktop-amd64.iso) Download Ubuntu 22.04 LTS image file, usually with ISO suffix

  3. Create a bootable USB flash drive: Install a Rufus tool, select your target USB flash drive in Rufus, then select the downloaded Ubuntu ISO system file, select "Writing Mode" as "ISO Image" and click the "Start" button. After completion, your USB flash drive will become a bootable Ubuntu installation medium.

  4. Set the computer startup priority: Press the F1 or Delete key immediately after turning on the computer, enter the computer's BIOS or UEFI settings, find the boot options, select your USB flash drive as the preferred boot device, save the settings and exit.


2. System installation and partitioning

install the system

  1. Install Ubuntu: Insert the prepared boot USB flash drive and restart the computer. The computer should boot from the USB drive and display the Ubuntu installation menu. Select the "Install Ubuntu" option and follow the on-screen instructions to proceed with the installation wizard.

  2. Partition as needed: During the installation process, you can choose to install Ubuntu using the entire hard drive or manual partitioning. If you choose manual partitioning, set the partitioning scheme as needed.

Partition

  1. /swap swap partition (virtual memory), the type is logical partition, (for 8G and below RAM, choose twice the size, the above size is the same as the RAM size)

  2. EFI boot partition, type is logical partition, default is ext4. It is recommended to divide it into 512 ~ 1024M. Note: put it at the beginning of the space. [As for whether to divide /boot partition: If your motherboard bios is set to UEFI+GPT partition table mode, you don’t need to set this when partitioning ubuntu . /boot partition, just set the efi system partition in step 3 below; but if you are using the legacy+MBR partition table, then set the /boot partition normally. This is very important, especially when installing dual systems or multiple systems, avoid Destroy boot files of other systems]

  3. /home user partition, type is logical partition, default is ext4, divided into 50GB, all user files are here.

  4. / Root directory (root partition), type is main partition, default is ext4, Linux system files are all here

Set user and password

  1. The installation program will ask you to set your computer's username, password and other related information. Please enter it as prompted.

Finally set the startup items

  1. Complete the installation: Unplug the USB flash drive, immediately press the F1 or Delete key to enter the computer BIOS when restarting the computer, set the hard disk as the first startup item, save and restart.

3. Configuration optimization

1. First, back up the official software source

cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. Then edit and change it to Tsinghua Source

sudo gedit sources.list

------------------Delete all the original content, copy the following paragraph into it, and remember to save it at the end! ! ! ----------------------------------------

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse main universe restricted
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates multiverse main universe restricted

3. Finally close the text editor and execute the following 3 commands:
sudo apt-get update

sudo apt-get upgrade

sudo apt-get install wget git vim python3-pip python3-venv
4. Ubuntu modify the pypi source to Douban, copy the following entire line of commands, and execute it
sudo mkdir ~/.pip&&touch ~/.pip/pip.conf&&echo -e '[global]\nindex-url=https://pypi.douban.com/simple\ntimeout = 6000\n[install]\ntrusted-host=pypi.douban.com\n#disable-pip-version-check = true' > ~/.pip/pip.conf

4. Desktop optimization

Note: Please back up important data before making any of the following optimizations or changes.

  1. Install graphics drivers: Depending on your hardware configuration, installing appropriate graphics drivers can improve graphics performance. You can use the Software & Updates application to check and install the corresponding driver.

  2. Adjust appearance and themes: You can personalize your desktop environment by changing your desktop background, application themes, icon themes, and more. In the Settings app, select the Appearance tab and you can change the relevant settings.

  3. Optimize startup applications: In the Startup Applications application, you can manage applications that start automatically. Disabling applications that do not need to start automatically at system startup can speed up system startup.

  4. Install extensions and plug-ins: By installing GNOME Shell extensions and plug-ins, you can enhance the functionality and customization of your desktop environment. You can use the GNOME Extensions website (https://extensions.gnome.org/) to browse and install various extensions and plug-ins.

  5. Adjust animations: In the Settings app, select the Appearance tab, then click the Behavior tab. Here you can adjust settings for window switching, workspaces, and other animation effects.

  6. Disable unnecessary services and startup items: By disabling unnecessary services and startup items, you can reduce the consumption of system resources. You can use the System Monitor application to view and manage running processes and services.

  7. Optimize power management: In the Settings app, select the Power tab and you can adjust power management policies to extend battery life or improve performance.

  8. Clean up system junk files: Regularly cleaning up system junk files can free up disk space and improve system performance. You can use the included Disk Usage Analyzer application to identify and delete unnecessary files.

Guess you like

Origin blog.csdn.net/qq_42183962/article/details/131165900