初始化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
网友评论