初始化root密碼
sudo passwd
bobokaka@bobokaka-desktop:/etc/apt$ sudo passwd
新的 密碼:
重新輸入新的 密碼:
passwd:已成功更新密碼
bobokaka@bobokaka-desktop:/etc/apt$
1.0 查看系統信息
lsb_release -a
bobokaka@bobokaka-desktop:~/桌面$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
bobokaka@bobokaka-desktop:~/桌面$
2、進入 /etc/apt/ 目錄
bobokaka@bobokaka-desktop:~/桌面$ cd /etc/apt/
bobokaka@bobokaka-desktop:/etc/apt$ ls -al
總用量 44
drwxr-xr-x 8 root root 4096 11月 18 22:06 .
drwxr-xr-x 129 root root 12288 11月 18 22:06 ..
drwxr-xr-x 2 root root 4096 11月 18 22:07 apt.conf.d
drwxr-xr-x 2 root root 4096 4月 8 2022 auth.conf.d
drwxr-xr-x 2 root root 4096 4月 8 2022 keyrings
drwxr-xr-x 2 root root 4096 4月 8 2022 preferences.d
-rw-rw-r-- 1 root root 2824 11月 18 22:06 sources.list
drwxr-xr-x 2 root root 4096 4月 8 2022 sources.list.d
drwxr-xr-x 2 root root 4096 8月 9 19:48 trusted.gpg.d
bobokaka@bobokaka-desktop:/etc/apt$
3、備份默認源文件
bobokaka@bobokaka-desktop:/etc/apt$ sudo cp sources.list sources.list_bak
[sudo] bobokaka 的密碼:
bobokaka@bobokaka-desktop:/etc/apt$ ls -al
總用量 48
drwxr-xr-x 8 root root 4096 11月 18 22:25 .
drwxr-xr-x 129 root root 12288 11月 18 22:06 ..
drwxr-xr-x 2 root root 4096 11月 18 22:07 apt.conf.d
drwxr-xr-x 2 root root 4096 4月 8 2022 auth.conf.d
drwxr-xr-x 2 root root 4096 4月 8 2022 keyrings
drwxr-xr-x 2 root root 4096 4月 8 2022 preferences.d
-rw-rw-r-- 1 root root 2824 11月 18 22:06 sources.list
-rw-r--r-- 1 root root 2824 11月 18 22:25 sources.list_bak
drwxr-xr-x 2 root root 4096 4月 8 2022 sources.list.d
drwxr-xr-x 2 root root 4096 8月 9 19:48 trusted.gpg.d
bobokaka@bobokaka-desktop:/etc/apt$
4、編輯源配置文件
在home下面新建一個sources.list
編輯內容
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
複製並覆蓋數據
bobokaka@bobokaka-desktop:/etc/apt$ sudo cp /home/bobokaka/sources.list /etc/apt/sources.list
bobokaka@bobokaka-desktop:/etc/apt$ cat sources.list
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
bobokaka@bobokaka-desktop:/etc/apt$
5、跟新軟件庫
sudo apt update
6、升級軟件
sudo apt upgrade