[Ubuntu系统] Ubuntu Linux操作系统

1634 0
Honkers 2025-3-10 23:53:54 | 显示全部楼层 |阅读模式

一.Ubuntu简介

Ubuntu Linux是由南非人马克·沙特尔沃思(Mark Shuttleworth)创办的基于Debian Linux的操作系统,于2004年10月公布Ubuntu的第一个版本(Ubuntu 4.10“Warty Warthog”)。Ubuntu适用于笔记本电脑、桌面电脑和服务器,特别是为桌面用户提供尽善尽美的使用体验。Ubuntu几乎包含了所有常用的应用软件:文字处理、电子邮件、软件开发工具和Web服务等。用户下载、使用、分享未修改的原版Ubuntu系统,以及到社区获得技术支持,无需支付任何许可费用。

官方网站:企业开源和Linux | Ubuntu

镜像下载地址:https://mirrors.sdu.edu.cn/ubuntu-releases/24.04.1/ubuntu-24.04.1-desktop-amd64.iso

二.Ubuntu的安装详解

选择安装ubuntu

选择语言和键盘

是否连接到互联网

安装ububtu

选择安装方式

设置账户密码

选择时区

安装前准备确认选择

三.Ubuntu的用户使用

1.Ubuntu用户常规登录方式

在系统中root是无法直接登录的,因为root用户权限过大会导致安全问题

如果需要使用root用户权限可以使用sudo+需要的命令

需要切换root用户

  1. root@haha:~# vi /etc/pam.d/gdm-password
复制代码

 设置root用户密码就可以登录root用户

  1. root@haha:~# passwd root
  2. 新的密码:
  3. 重新输入新的密码:
  4. passwd:已成功更新密码
复制代码

2.ubuntu用户密码破解

系统默认安装完成后grub启动时间为0,建议改为5s,否则启动太快无法修改参数

  1. root@haha:~# vim /etc/default/grub
复制代码

  1. root@haha:~# grub-mkconfig > /boot/grub/grub.cfg
复制代码

当密码忘记时

改为

 

ctrl+x

设置密码后重新登录root用户即可

四.Ubuntu的软件管理 

1.dpkg命令

列出系统中已经安装的软件包信息

  1. root@haha:~# dpkg -l
  2. 期望状态=未知(u)/安装(i)/删除(r)/清除(p)/保持(h)
  3. | 状态=未安装(n)/已安装(i)/仅存配置(c)/仅解压缩(U)/配置失败(F)/不完全安装(H)/触发器等待(W)/触发器未决(T)
  4. |/ 错误?=(无)/须重装(R) (状态,错误:大写=故障)
  5. ||/ 名称 版本 体系结构 描述
  6. +++-=============================================-========================================-============-================================================================================
  7. ii accountsservice 23.13.9-2ubuntu6 amd64 query and manipulate user account information
  8. ii acl 2.3.2-1build1 amd64 access control list - utilities
  9. ii adduser 3.137ubuntu1 all add and remove users and groups
  10. ii adwaita-icon-theme 46.0-1 all default icon theme of GNOME
  11. ii alsa-base 1.0.25+dfsg-0ubuntu7 all ALSA driver configuration files
  12. ii alsa-topology-conf 1.2.5.1-2 all ALSA topology configuration files
  13. ii alsa-ucm-conf 1.2.10-1ubuntu5 all ALSA Use Case Manager configuration files
  14. ii alsa-utils 1.2.9-1ubuntu5 amd64 Utilities for configuring and using ALSA
  15. ii amd64-microcode 3.20231019.1ubuntu2.1 amd64 Processor microcode firmware for AMD CPUs
  16. ii anacron 2.3-39ubuntu2 amd64 cron-like program that doesn't go by time
  17. ii apg 2.2.3.dfsg.1-5build3 amd64 Automated Password Generator - Standalone version
  18. ii apparmor 4.0.1really4.0.0-beta3-0ubuntu0.1 amd64 user-space parser utility for AppArmor
  19. ii apport 2.28.1-0ubuntu3.1 all automatically generate crash reports for debugging
  20. ii apport-core-dump-handler 2.28.1-0ubuntu3.1 all Kernel core dump handler for Apport
  21. ii apport-gtk 2.28.1-0ubuntu3.1 all GTK+ frontend for the apport crash report system
  22. ii apport-symptoms 0.25 all symptom scripts for apport
  23. ii appstream 1.0.2-1build6 amd64 Software component metadata management
  24. ii apt 2.7.14build2 amd64 commandline package manager
  25. ii apt-config-icons 1.0.2-1build6 all APT configuration snippet to enable icon downloads
  26. ii apt-config-icons-hidpi 1.0.2-1build6 all APT configuration snippet to enable HiDPI icon downloads
  27. ii apt-utils 2.7.14build2 amd64 package management related utility programs
  28. ii aptdaemon 1.1.1+bzr982-0ubuntu44 all transaction based package management service
  29. ii aptdaemon-data 1.1.1+bzr982-0ubuntu44 all data files for clients
  30. ii aspell 0.60.8.1-1build1 amd64 GNU Aspell spell-checker
  31. ii aspell-en 2020.12.07-0-1 all English dictionary for GNU Aspell
  32. ii at-spi2-common 2.52.0-1build1 all Assistive Technology Service Provider Interface (common files)
  33. ii at-spi2-core 2.52.0-1build1 amd64 Assistive Technology Service Provider Interface (D-Bus core)
  34. ii avahi-daemon 0.8-13ubuntu6 amd64 Avahi mDNS/DNS-SD daemon
  35. ii baobab 46.0-1build1 amd64 GNOME disk usage analyzer
  36. ii base-files 13ubuntu10.1 amd64 Debian base system miscellaneous files
  37. ii base-passwd 3.6.3build1 amd64 Debian base system master password and group files
  38. ii bash 5.2.21-2ubuntu4 amd64 GNU Bourne Again SHell
  39. ii bash-completion 1:2.11-8 all programmable completion for the bash shell
  40. ii bc 1.07.1-3ubuntu4 amd64 GNU bc arbitrary precision calculator language
  41. lines 1-39
复制代码

 安装deb包

  1. root@haha:~# ls
  2. 公共 模板 视频 图片 文档 下载 音乐 桌面 QQ_3.2.13_241121_amd64_01.deb snap
  3. root@haha:~# dpkg -i QQ_3.2.13_241121_amd64_01.deb
  4. 正在选中未选择的软件包 linuxqq。
  5. (正在读取数据库 ... 系统当前共安装有 155388 个文件和目录。)
  6. 准备解压 QQ_3.2.13_241121_amd64_01.deb ...
  7. 正在解压 linuxqq (3.2.13-29927) ...
  8. 正在设置 linuxqq (3.2.13-29927) ...
  9. 正在处理用于 hicolor-icon-theme (0.17-2) 的触发器 ...
  10. 正在处理用于 gnome-menus (3.36.0-1.1ubuntu3) 的触发器 ...
  11. 正在处理用于 desktop-file-utils (0.27-2build1) 的触发器 ...
复制代码

查看软件包信息

  1. root@haha:~# dpkg -L linuxqq
  2. root@haha:~# dpkg -s linuxqq
复制代码

卸载deb软件

  1. root@haha:~# dpkg -r linuxqq
复制代码

2.管理软件仓库

  1. root@haha:~# cd /etc/apt
  2. root@haha:/etc/apt# ls
  3. apt.conf.d auth.conf.d keyrings preferences.d preferences.d.save sources.list sources.list.d trusted.gpg.d
  4. root@haha:/etc/apt#
  5. root@haha:/etc/apt# vim sources.list
  6. root@haha:/etc/apt#
复制代码

挂载镜像

  1. root@haha:~# mkdir /guazai
  2. root@haha:~# lsblk -p
  3. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
  4. /dev/loop0 7:0 0 4K 1 loop /snap/bare/5
  5. /dev/loop1 7:1 0 73.9M 1 loop /snap/core22/1663
  6. /dev/loop2 7:2 0 74.3M 1 loop /snap/core22/1564
  7. /dev/loop3 7:3 0 10.7M 1 loop /snap/firmware-updater/127
  8. /dev/loop4 7:4 0 11.1M 1 loop /snap/firmware-updater/147
  9. /dev/loop5 7:5 0 505.1M 1 loop /snap/gnome-42-2204/176
  10. /dev/loop6 7:6 0 91.7M 1 loop /snap/gtk-common-themes/1535
  11. /dev/loop7 7:7 0 269.8M 1 loop /snap/firefox/4793
  12. /dev/loop8 7:8 0 10.8M 1 loop /snap/snap-store/1244
  13. /dev/loop9 7:9 0 10.5M 1 loop /snap/snap-store/1173
  14. /dev/loop10 7:10 0 38.8M 1 loop /snap/snapd/21759
  15. /dev/loop11 7:11 0 44.3M 1 loop /snap/snapd/23258
  16. /dev/loop12 7:12 0 500K 1 loop /snap/snapd-desktop-integration/178
  17. /dev/loop13 7:13 0 568K 1 loop /snap/snapd-desktop-integration/253
  18. /dev/sda 8:0 0 40G 0 disk
  19. ├─/dev/sda1 8:1 0 1M 0 part
  20. └─/dev/sda2 8:2 0 40G 0 part /
  21. /dev/sr0 11:0 1 5.8G 0 rom /media/root/Ubuntu 24.04.1 LTS amd64
  22. root@haha:~# mount /dev/sr0 /guazai
  23. mount: /guazai: WARNING: source write-protected, mounted read-only.
  24. root@haha:~# lsblk -p
  25. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
  26. /dev/loop0 7:0 0 4K 1 loop /snap/bare/5
  27. /dev/loop1 7:1 0 73.9M 1 loop /snap/core22/1663
  28. /dev/loop2 7:2 0 74.3M 1 loop /snap/core22/1564
  29. /dev/loop3 7:3 0 10.7M 1 loop /snap/firmware-updater/127
  30. /dev/loop4 7:4 0 11.1M 1 loop /snap/firmware-updater/147
  31. /dev/loop5 7:5 0 505.1M 1 loop /snap/gnome-42-2204/176
  32. /dev/loop6 7:6 0 91.7M 1 loop /snap/gtk-common-themes/1535
  33. /dev/loop7 7:7 0 269.8M 1 loop /snap/firefox/4793
  34. /dev/loop8 7:8 0 10.8M 1 loop /snap/snap-store/1244
  35. /dev/loop9 7:9 0 10.5M 1 loop /snap/snap-store/1173
  36. /dev/loop10 7:10 0 38.8M 1 loop /snap/snapd/21759
  37. /dev/loop11 7:11 0 44.3M 1 loop /snap/snapd/23258
  38. /dev/loop12 7:12 0 500K 1 loop /snap/snapd-desktop-integration/178
  39. /dev/loop13 7:13 0 568K 1 loop /snap/snapd-desktop-integration/253
  40. /dev/sda 8:0 0 40G 0 disk
  41. ├─/dev/sda1 8:1 0 1M 0 part
  42. └─/dev/sda2 8:2 0 40G 0 part /
  43. /dev/sr0 11:0 1 5.8G 0 rom /guazai
  44. /media/root/Ubuntu 24.04.1 LTS amd64
  45. root@haha:~#
复制代码

更新测试

  1. root@haha:~# apt update
  2. 获取:1 file:/guazai noble InRelease
  3. 忽略:1 file:/guazai noble InRelease
  4. 获取:2 file:/guazai noble Release [1,072 B]
  5. 获取:2 file:/guazai noble Release [1,072 B]
  6. 获取:3 file:/guazai noble Release.gpg [833 B]
  7. 获取:3 file:/guazai noble Release.gpg [833 B]
  8. 获取:4 file:/guazai noble/main amd64 Packages [53.1 kB]
  9. 忽略:4 file:/guazai noble/main amd64 Packages
  10. 获取:5 file:/guazai noble/restricted amd64 Packages [15.2 kB]
  11. 忽略:5 file:/guazai noble/restricted amd64 Packages
  12. 获取:4 file:/guazai noble/main amd64 Packages [53.1 kB]
  13. 获取:5 file:/guazai noble/restricted amd64 Packages [15.2 kB]
  14. 命中:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble InRelease
  15. 命中:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates InRelease
  16. 命中:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports InRelease
  17. 命中:9 http://security.ubuntu.com/ubuntu noble-security InRelease
  18. 正在读取软件包列表... 完成
  19. 正在分析软件包的依赖关系树... 完成
  20. 正在读取状态信息... 完成
  21. 有 88 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。
  22. root@haha:~# apt install -y nginx
  23. 正在读取软件包列表... 完成
  24. 正在分析软件包的依赖关系树... 完成
  25. 正在读取状态信息... 完成
  26. 将会同时安装下列软件:
  27. nginx-common
  28. 建议安装:
  29. fcgiwrap nginx-doc
  30. 下列【新】软件包将被安装:
  31. nginx nginx-common
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行