经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 数据库/运维 » Linux/Shell » 查看文章
Ubuntu Server搭建个人服务器
来源:cnblogs  作者:vector_qiu  时间:2023/4/17 9:17:45  对本文有异议

Ubuntu Server20.04.5 LTS

【参考资料】

Ubuntu官方地址:https://www.ubuntu.com/

Ubuntu论坛地址:https://ubuntuforums.org/

Ubuntu Wiki地址:https://wiki.ubuntu.com/

Ubuntu帮助地址:https://help.ubuntu.com/

Ubuntu邮件列表地址:https://discourse.ubuntu.com/t/mailing-lists/https://ubuntu.com/server/docs)

1.下载Ubuntu镜像

官网下载:https://releases.ubuntu.com/

国内镜像下载:

华为镜像:https://repo.huaweicloud.com/ubuntu-releases/

阿里镜像:http://old-releases.ubuntu.com/releases/

2.安装

官网安装教程:https://ubuntu.com/server/docs/install/step-by-step

博客:

http://t.csdn.cn/aDPUu

2.1 网络配置(静态IP配置)

  • 静态IP设置方法,点击ens33 然后选择ipv4、

  • 点击Manual 手动添加ip地址

    • subnet:192.168.x.xxx/24 (子网掩码)
    • address:192.168.x.xxx(静态IP地址)
    • Geteway:192.168.x.1(网关)
    • Name servers:(DNS服务器地址:)
    • search domains:
    1. 华为云DNS 122.112.208.1 139.9.23.90
    2. 114.115.192.11 116.205.5.1
    3. 116.205.5.30 122.112.208.175

2.2 设置镜像源地址

国内镜像地址:

华为源:https://mirrors.huaweicloud.com/ubuntu/

阿里源 http://mirrors.aliyun.com/ubuntu/

网易163 http://mirrors.163.com/ubuntu/

2.3 磁盘分区

  1. /boot:这里存放的是启动 Linux 时使用的一些核心文件,包括一些连接文件以及镜像文件。
  2. /home:用户的主目录
  3. /srv:该目录存放一些服务启动之后需要提取的数据。
  4. /usr:应用程序
  5. /boot 2G
  6. / 其他
  1. /bin
  2. bin Binaries (二进制文件) 的缩写, 这个目录存放着最经常使用的命令。
  3. /boot
  4. 这里存放的是启动 Linux 时使用的一些核心文件,包括一些连接文件以及镜像文件。
  5. /dev
  6. dev Device(设备) 的缩写, 该目录下存放的是 Linux 的外部设备,在 Linux 中访问设备的方式和访问文件的方式是相同的。
  7. /etc
  8. etc Etcetera(等等) 的缩写,这个目录用来存放所有的系统管理所需要的配置文件和子目录。
  9. /home
  10. 用户的主目录,在 Linux 中,每个用户都有一个自己的目录,一般该目录名是以用户的账号命名的,如上图中的 alicebob eve
  11. /lib
  12. lib Library(库) 的缩写这个目录里存放着系统最基本的动态连接共享库,其作用类似于 Windows 里的 DLL 文件。几乎所有的应用程序都需要用到这些共享库。
  13. /lost+found
  14. 这个目录一般情况下是空的,当系统非法关机后,这里就存放了一些文件。
  15. /media
  16. linux 系统会自动识别一些设备,例如U盘、光驱等等,当识别后,Linux 会把识别的设备挂载到这个目录下。
  17. /mnt
  18. 系统提供该目录是为了让用户临时挂载别的文件系统的,我们可以将光驱挂载在 /mnt/ 上,然后进入该目录就可以查看光驱里的内容了。
  19. /opt
  20. opt optional(可选) 的缩写,这是给主机额外安装软件所摆放的目录。比如你安装一个ORACLE数据库则就可以放到这个目录下。默认是空的。
  21. /proc
  22. proc Processes(进程) 的缩写,/proc 是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,这个目录是一个虚拟的目录,它是系统内存的映射,我们可以通过直接访问这个目录来获取系统信息。
  23. 这个目录的内容不在硬盘上而是在内存里,我们也可以直接修改里面的某些文件,比如可以通过下面的命令来屏蔽主机的ping命令,使别人无法ping你的机器:
  24. echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all
  25. /root
  26. 该目录为系统管理员,也称作超级权限者的用户主目录。
  27. /sbin
  28. s 就是 Super User 的意思,是 Superuser Binaries (超级用户的二进制文件) 的缩写,这里存放的是系统管理员使用的系统管理程序。
  29. /selinux
  30. 这个目录是 Redhat/CentOS 所特有的目录,Selinux 是一个安全机制,类似于 windows 的防火墙,但是这套机制比较复杂,这个目录就是存放selinux相关的文件的。
  31. /srv
  32. 该目录存放一些服务启动之后需要提取的数据。
  33. /sys
  34. 这是 Linux2.6 内核的一个很大的变化。该目录下安装了 2.6 内核中新出现的一个文件系统 sysfs
  35. sysfs 文件系统集成了下面3种文件系统的信息:针对进程信息的 proc 文件系统、针对设备的 devfs 文件系统以及针对伪终端的 devpts 文件系统。
  36. 该文件系统是内核设备树的一个直观反映。
  37. 当一个内核对象被创建的时候,对应的文件和目录也在内核对象子系统中被创建。
  38. /tmp
  39. tmp temporary(临时) 的缩写这个目录是用来存放一些临时文件的。
  40. /usr
  41. usr unix shared resources(共享资源) 的缩写,这是一个非常重要的目录,用户的很多应用程序和文件都放在这个目录下,类似于 windows 下的 program files 目录。
  42. /usr/bin
  43. 系统用户使用的应用程序。
  44. /usr/sbin
  45. 超级用户使用的比较高级的管理程序和系统守护程序。
  46. /usr/src
  47. 内核源代码默认的放置目录。
  48. /var
  49. var variable(变量) 的缩写,这个目录中存放着在不断扩充着的东西,我们习惯将那些经常被修改的目录放在这个目录下。包括各种日志文件。
  50. /run
  51. 是一个临时文件系统,存储系统启动以来的信息。当系统重启时,这个目录下的文件应该被删掉或清除。如果你的系统上有 /var/run 目录,应该让它指向 run

2.4 设置主机用户名与密码及服务器名称

2.5 安装 SSH服务

2.6 选择预置服务安装

  1. mkdir /disk# 设置root密码
  2. sudo passwd
  3. # 添加用户
  4. adduser -m 【用户名】
  5. # 设置密码
  6. passwd 【用户名】
  7. #修改用户
  8. usermod [参数] 【用户名】
  9. #创建用户组
  10. groupadd【参数】【用户组名】
  11. #修改组
  12. groupmod【参数】【用户组名】
  13. # 删除用户组
  14. groupdel 【用户组名】
  15. #硬盘挂载
  16. # 显示硬盘及所属分区情况
  17. sudo fdisk -l
  18. # 查看分区信息
  19. df -h
  20. sudo apt install net-tools
  21. mkdir /disk
  22. sudo fdisk /dev/sdb
  23. Welcome to fdisk (util-linux 2.34).
  24. Changes will remain in memory only, until you decide to write them.
  25. Be careful before using the write command.
  26. Device does not contain a recognized partition table.
  27. Created a new DOS disklabel with disk identifier 0xd3891d8e.
  28. Command (m for help): m
  29. Help:
  30. DOS (MBR)
  31. a toggle a bootable flag
  32. b edit nested BSD disklabel
  33. c toggle the dos compatibility flag
  34. Generic
  35. d delete a partition
  36. F list free unpartitioned space
  37. l list known partition types
  38. n add a new partition
  39. p print the partition table
  40. t change a partition type
  41. v verify the partition table
  42. i print information about a partition
  43. Misc
  44. m print this menu
  45. u change display/entry units
  46. x extra functionality (experts only)
  47. Script
  48. I load disk layout from sfdisk script file
  49. O dump disk layout to sfdisk script file
  50. Save & Exit
  51. w write table to disk and exit
  52. q quit without saving changes
  53. Create a new label
  54. g create a new empty GPT partition table
  55. G create a new empty SGI (IRIX) partition table
  56. o create a new empty DOS partition table
  57. s create a new empty Sun partition table
  58. Command (m for help):
  59. # 分区
  60. Command (m for help): n
  61. Partition type
  62. p primary (0 primary, 0 extended, 4 free)
  63. e extended (container for logical partitions)
  64. # 扩展分区
  65. Select (default p): e
  66. Partition number (1-4, default 1):
  67. First sector (2048-1953525167, default 2048):
  68. Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525167, default 1953525167):
  69. Created a new partition 1 of type 'Extended' and of size 931.5 GiB.
  70. #保存
  71. Command (m for help): w
  72. The partition table has been altered.
  73. Calling ioctl() to re-read partition table.
  74. Syncing disks.
  75. #重新加载硬盘信息
  76. partprobe
  77. root@yuximing:/# fdisk -l
  78. Disk /dev/loop0: 61.98 MiB, 64966656 bytes, 126888 sectors
  79. Units: sectors of 1 * 512 = 512 bytes
  80. Sector size (logical/physical): 512 bytes / 512 bytes
  81. I/O size (minimum/optimal): 512 bytes / 512 bytes
  82. Disk /dev/loop1: 46.98 MiB, 49242112 bytes, 96176 sectors
  83. Units: sectors of 1 * 512 = 512 bytes
  84. Sector size (logical/physical): 512 bytes / 512 bytes
  85. I/O size (minimum/optimal): 512 bytes / 512 bytes
  86. Disk /dev/loop2: 67.83 MiB, 71106560 bytes, 138880 sectors
  87. Units: sectors of 1 * 512 = 512 bytes
  88. Sector size (logical/physical): 512 bytes / 512 bytes
  89. I/O size (minimum/optimal): 512 bytes / 512 bytes
  90. Disk /dev/loop3: 55.63 MiB, 58314752 bytes, 113896 sectors
  91. Units: sectors of 1 * 512 = 512 bytes
  92. Sector size (logical/physical): 512 bytes / 512 bytes
  93. I/O size (minimum/optimal): 512 bytes / 512 bytes
  94. Disk /dev/loop4: 139.43 MiB, 146194432 bytes, 285536 sectors
  95. Units: sectors of 1 * 512 = 512 bytes
  96. Sector size (logical/physical): 512 bytes / 512 bytes
  97. I/O size (minimum/optimal): 512 bytes / 512 bytes
  98. Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
  99. Disk model: Phison SATA SSD
  100. Units: sectors of 1 * 512 = 512 bytes
  101. Sector size (logical/physical): 512 bytes / 512 bytes
  102. I/O size (minimum/optimal): 512 bytes / 512 bytes
  103. Disklabel type: gpt
  104. Disk identifier: 6A4DC71F-0A25-485A-BFD2-20EA5848FB5B
  105. Device Start End Sectors Size Type
  106. /dev/sda1 2048 2203647 2201600 1.1G EFI System
  107. /dev/sda2 2203648 6397951 4194304 2G Linux filesystem
  108. /dev/sda3 6397952 500115455 493717504 235.4G Linux filesystem
  109. Disk /dev/sdb: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
  110. Disk model: ST1000LM035-1RK1
  111. Units: sectors of 1 * 512 = 512 bytes
  112. Sector size (logical/physical): 512 bytes / 4096 bytes
  113. I/O size (minimum/optimal): 4096 bytes / 4096 bytes
  114. Disklabel type: dos
  115. Disk identifier: 0xd3891d8e
  116. Device Boot Start End Sectors Size Id Type
  117. /dev/sdb1 2048 1953525167 1953523120 931.5G 5 Extended
  118. # 硬盘格式化
  119. root@yuximing:/# sudo mkfs -t ext4 /dev/sdb
  120. mke2fs 1.45.5 (07-Jan-2020)
  121. Found a dos partition table in /dev/sdb
  122. Proceed anyway? (y,N) y
  123. Creating filesystem with 244190646 4k blocks and 61054976 inodes
  124. Filesystem UUID: efaddfd7-3605-4cff-aa74-90afa84e6093
  125. Superblock backups stored on blocks:
  126. 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
  127. 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
  128. 102400000, 214990848
  129. Allocating group tables: done
  130. Writing inode tables: done
  131. # 挂载硬盘分区 | Mount hard disk partition
  132. # 显示硬盘挂载情况
  133. root@yuximing:/# df -l
  134. Filesystem 1K-blocks Used Available Use% Mounted on
  135. udev 3948852 0 3948852 0% /dev
  136. tmpfs 798996 1700 797296 1% /run
  137. /dev/sda3 241873372 6904184 222609868 4% /
  138. tmpfs 3994964 0 3994964 0% /dev/shm
  139. tmpfs 5120 0 5120 0% /run/lock
  140. tmpfs 3994964 0 3994964 0% /sys/fs/cgroup
  141. /dev/loop0 63488 63488 0 100% /snap/core20/1611
  142. /dev/sda2 1992552 111124 1760188 6% /boot
  143. /dev/sda1 1098632 6216 1092416 1% /boot/efi
  144. /dev/loop2 69504 69504 0 100% /snap/lxd/22753
  145. /dev/loop1 48128 48128 0 100% /snap/snapd/16292
  146. tmpfs 798992 0 798992 0% /run/user/1000
  147. /dev/loop3 56960 56960 0 100% /snap/core18/2721
  148. /dev/loop4 142848 142848 0 100% /snap/docker/2746
  149. root@yuximing:/# mount /dev/sdb /disk/disk1/
  150. root@yuximing:/# df -l
  151. Filesystem 1K-blocks Used Available Use% Mounted on
  152. udev 3948852 0 3948852 0% /dev
  153. tmpfs 798996 1700 797296 1% /run
  154. /dev/sda3 241873372 6904184 222609868 4% /
  155. tmpfs 3994964 0 3994964 0% /dev/shm
  156. tmpfs 5120 0 5120 0% /run/lock
  157. tmpfs 3994964 0 3994964 0% /sys/fs/cgroup
  158. /dev/loop0 63488 63488 0 100% /snap/core20/1611
  159. /dev/sda2 1992552 111124 1760188 6% /boot
  160. /dev/sda1 1098632 6216 1092416 1% /boot/efi
  161. /dev/loop2 69504 69504 0 100% /snap/lxd/22753
  162. /dev/loop1 48128 48128 0 100% /snap/snapd/16292
  163. tmpfs 798992 0 798992 0% /run/user/1000
  164. /dev/loop3 56960 56960 0 100% /snap/core18/2721
  165. /dev/loop4 142848 142848 0 100% /snap/docker/2746
  166. /dev/sdb 960303848 28 911449308 1% /disk/disk1
  167. root@yuximing:/# blkid /dev/sdb
  168. /dev/sdb: UUID="efaddfd7-3605-4cff-aa74-90afa84e6093" TYPE="ext4"
  169. # 配置硬盘在系统启动自动挂载
  170. root@yuximing:/# vim /etc/fstab
  171. UUID="efaddfd7-3605-4cff-aa74-90afa84e6093" /disk/disk1 ext4 defaults 1 1
  172. mount -a
  173. # 查看分区情况
  174. root@yuximing:/# lsblk -f
  175. NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
  176. loop0 squashfs 0 100% /snap/core20/1611
  177. loop1 squashfs 0 100% /snap/snapd/16292
  178. loop2 squashfs 0 100% /snap/lxd/22753
  179. loop3 squashfs 0 100% /snap/core18/2721
  180. loop4 squashfs 0 100% /snap/docker/2746
  181. sda
  182. ├─sda1 vfat 70C6-61A1 1G 1% /boot/efi
  183. ├─sda2 ext4 c26bb1bf-6abc-44bc-bb85-50cbb6caaa09 1.7G 6% /boot
  184. └─sda3 ext4 0c2d162a-6c59-46d6-9143-2bf2e3d9979d 212.3G 3% /
  185. sdb ext4 efaddfd7-3605-4cff-aa74-90afa84e6093 869.2G 0% /disk/disk1

3.webmin

【官网】https://webmin.com/

https://blog.csdn.net/weixin_52802362/article/details/117112557

  1. apt-get install webmin
  2. # 访问github困难,下载通过xftp上传安装
  3. wget https://github.com/webmin/webmin/releases/download/2.021/webmin_2.021_all.deb
  4. dpkg --install webmin_2.021_all.deb
  5. root@yuximing:/home/vector# dpkg --install webmin_2.021_all.deb
  6. Selecting previously unselected package webmin.
  7. (Reading database ... 72234 files and directories currently installed.)
  8. Preparing to unpack webmin_2.021_all.deb ...
  9. Unpacking webmin (2.021) ...
  10. dpkg: dependency problems prevent configuration of webmin:
  11. webmin depends on libnet-ssleay-perl; however:
  12. Package libnet-ssleay-perl is not installed.
  13. webmin depends on libauthen-pam-perl; however:
  14. Package libauthen-pam-perl is not installed.
  15. webmin depends on libio-pty-perl; however:
  16. Package libio-pty-perl is not installed.
  17. webmin depends on unzip; however:
  18. Package unzip is not installed.
  19. dpkg: error processing package webmin (--install):
  20. dependency problems - leaving unconfigured
  21. Errors were encountered while processing:
  22. webmin
  23. [依赖安装]
  24. apt install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python
  25. apt --fix-broken install -y
  26. dpkg --install webmin_2.021_all.deb
  27. root@yuximing:/home/vector# sudo ufw allow 10000/tcp
  28. Rule added
  29. Rule added (v6)
  30. root@yuximing:/home/vector# ufw status verbose
  31. Status: active
  32. Logging: on (low)
  33. Default: deny (incoming), allow (outgoing), deny (routed)
  34. New profiles: skip
  35. To Action From
  36. -- ------ ----
  37. 22/tcp (OpenSSH) ALLOW IN Anywhere
  38. 10000/tcp ALLOW IN Anywhere
  39. 22/tcp (OpenSSH (v6)) ALLOW IN Anywhere (v6)
  40. 10000/tcp (v6) ALLOW IN Anywhere (v6)
  41. Webmin默认安装到/usr/share/webmin
  42. 访问地址:ip:10000
  43. 配置:

4.ufw

https://blog.csdn.net/fd214333890/article/details/115410168

  1. # 列举出你系统上所有的应用配置
  2. sudo ufw app list
  3. # 在启用 UFW 防火墙之前,你必须显式允许进来的 SSH 连接。否则,你将永远都无法连接到机器上
  4. sudo ufw allow OpenSSH
  5. #开启关闭ufw服务
  6. systemctl start ufw
  7. systemctl stop ufw
  8. #禁用 启用ufw服务
  9. systemctl disable ufw
  10. systemctl enable ufw
  11. # 开启关闭ufw
  12. ufw enable
  13. ufw disable
  14. # 默认禁止
  15. ufw default deny
  16. # 默认允许
  17. ufw default allow
  18. # 状态
  19. ufw status verbose
  20. # 开端口
  21. ufw allow port_number/protocol

5.samba

  1. sudo apt-get update
  2. sudo apt-get install samba
  3. # 配置防火墙
  4. sudo ufw allow Samba
  5. # 创建用户 用配置密码, 密码用专门的smbpasswd命令进行设置
  6. sudo useradd sbuser
  7. sudo smbpasswd -a sbuser
  8. #创建要共享的文件夹
  9. $ sudo mkdir /disk
  10. # 修改文件夹的所有者与上面新建的用户一致, 否则会导致没有权限进行访问
  11. $ sudo chown sbuser /disk
  12. # 配置samba
  13. $ sudo vim /etc/samba/smb.conf
  14. [home] #共享名,该共享标签,可随意取,该名字为在其他电脑上看到的共享名
  15. comment = home directories #该共享描述
  16. path = /disk #共享路径
  17. public = yes #指定该共享是否允许guest账户访问
  18. writable = yes #writable用来指定该共享路径是否可写
  19. valid users = 用户名 #设置访问用户
  20. valid users = @组名 #设置访问组
  21. read only = no #读写
  22. browseable = yes #可以被所有用户浏览到资源名称,
  23. # 重启samba服务
  24. sudo systemctl restart smbd
  25. # 查看samba服务状态
  26. sudo systemctl status smbd
  27. reboot

6.docker

https://hub.docker.com/

7.aria2

https://hub.docker.com/r/p3terx/aria2-pro

https://zhuanlan.zhihu.com/p/466573640

https://p3terx.com/archives/docker-aria2-pro.html

对以上映射的目录进行用户权限设置,aria2c 核心进程会以所设定的用户运行。当使用非 root 用户进行管理时非常重要,这关乎到安全性和文件是否能正常访问。你不应该错过这个细节,否则可能导致不必要的麻烦。

  • -e PUID=$UID - 用户映射。设置文件管理账户的UID(用户 ID)。忽略则默认为nobady用户,并权限最大化。
  • -e PGID=$GID - 用户组映射。设置文件管理账户的GID(用户组 ID)。忽略则默认为nogroup用户组,并权限最大化。

科普: 在常规的 Linux 发行版中$UID$GID这两个环境变量分别为当前登录账户的UIDGID值,所以通过 CLI 启动容器可以直接使用这两个变量。但需要注意可能有部分系统$GID没有被定义。

  1. docker pull p3terx/aria2-pro
  2. # 替换<TOKEN>字段(RPC密钥) VECTOR
  3. docker run -d --name aria2-pro --restart unless-stopped --log-opt max-size=1m --network host -e PUID=$UID -e PGID=$GID -e RPC_SECRET=VECTOR -e RPC_PORT=6800 -e LISTEN_PORT=6888 -v /disk/disk1/aria2-config:/config -v /disk/disk1/aria2-downloads:/downloads p3terx/aria2-pro
  4. docker run -d --name ariang --log-opt max-size=1m --restart unless-stopped -p 6880:6880 p3terx/ariang

8.plex

https://ubunlog.com/zh-CN/plex介质服务器安装ubuntu-20-04/

https://linuxize.com/post/how-to-install-plex-media-server-on-ubuntu-20-04/

  1. https://www.plex.tv/media-server-downloads/#plex-media-server
  2. #[方式1] 使用.deb文件
  3. # 下载
  4. wget https://downloads.plex.tv/plex-media-s erver-new/1.32.0.6918-6f393eda1/debian/plexmediaserver_1.32.0.6918-6f393eda1_amd64.deb?_gl=1*16kkgdv*_ga*MTAyNzU4MzUzNi4xNjgxNTgxNTI5*_ga_G6FQWNSENB*MTY4MTU5MTA5OC4zLjEuMTY4MTU5MjMzMi4wLjAuMA..
  5. # 安装
  6. sudo dpkg -i
  7. # 检查程序状态
  8. sudo systemctl status plexmediaserver.service
  9. # 卸载
  10. sudo apt remove plemediaserver
  11. #[方式2]使用Plex存储库
  12. # 从存储库导入GPG密钥
  13. curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
  14. # 将存储库添加到系统
  15. echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  16. sudo apt update
  17. sudo apt install plexmediaserver
  18. sudo systemctl status plexmediaserver.service
  19. sudo apt remove plexmediaserver
  20. # 开放端口
  21. sudo ufw allow proto tcp from any to any port 32400,3005,8324,32469 comment 'Plex Media Server TCP'
  22. sudo ufw allow proto udp from any to any port 1900,5353,32410:32414 comment 'Plex Media Server UDP'
  23. sudo ufw status
  24. sudo ufw reload
  25. # 访问地址
  26. http://direccion-ip:32400/web

9.emby

10.NextCloud

11.Kodi

官网:http://www.kodiplayer.cn/

11.1 Android电视安装Kodi

  1. adb
  2. 打开电视的adb调试开关
  3.   进入设置 > 系统 > 系统信息,遥控器依次按下“上”、“下”、“左”、“右”,即可看到页面中跳出adb开关,将ADB设为开启状态.
  4. adb devices
  5. adb connect ip:5555
  6. adb shell
  7. # 打开第三方应用安装权限
  8. setprop persist.tcl.debug.installapk 1
  9. setprop persist.tcl.installapk.enable 1
  10. exit退出
  11. adb install xxx.apk

11.2 Kodi安装Plex插件

安装Plex插件:http://www.kodiplayer.cn/plugins/2918.html

12.FFMpeg

https://blog.csdn.net/annjeff/article/details/105748428

报错问chatGPT

  1. sudo aptitude install llibvpx-dev
  2. ./configure --prefix=/home/vector/FFmpeg --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-lzma --enable-zlib --enable-gmp --enable-libvorbis --enable-libvo-amrwbenc --enable-libspeex --enable-libxvid --enable-libaom --enable-avisynth --enable-libopenmpt --enable-libfdk-aac --enable-nonfree

12.1ubuntu20.04安装avisynth

  1. To install Avisynth on Ubuntu 20.04, you can follow these steps:
  2. Open a terminal window by pressing "Ctrl + Alt + T".
  3. Update the package list and upgrade the system packages:
  4. sql
  5. Copy code
  6. sudo apt update
  7. sudo apt upgrade
  8. Install the required dependencies for Avisynth:
  9. Copy code
  10. sudo apt install autoconf automake libtool libavformat-dev libavcodec-dev libswscale-dev libjpeg-dev libpng-dev libtiff-dev libz-dev libbz2-dev liblzo2-dev liblzma-dev libfontconfig1-dev libfreetype6-dev libxml2-dev yasm nasm
  11. Download the latest version of Avisynth from its official website: http://avisynth.nl/index.php/Main_Page
  12. Extract the downloaded archive:
  13. Copy code
  14. tar -xf avisynth-x.y.z.tar.gz
  15. Replace "x.y.z" with the actual version number of Avisynth.
  16. Navigate to the extracted directory:
  17. bash
  18. Copy code
  19. cd avisynth-x.y.z
  20. Configure the build:
  21. bash
  22. Copy code
  23. ./autogen.sh
  24. ./configure
  25. Compile and install Avisynth:
  26. go
  27. Copy code
  28. make
  29. sudo make install
  30. Verify that Avisynth has been installed successfully:
  31. css
  32. Copy code
  33. avs2yuv --version
  34. This command should display the version number of Avisynth.
  35. That's it! You have now installed Avisynth on Ubuntu 20.04.

ERROR: gnutls not found using pkg-config

This error message suggests that the GnuTLS library is not installed on your system or the pkg-config tool is unable to find it.

To fix this error, you can try the following steps:

  1. Install the GnuTLS library and its development headers. You can do this by running the following command:

    1. arduinoCopy code
    2. sudo apt-get install libgnutls28-dev
  2. After installing the GnuTLS library, run the following command to update the pkg-config database:

    1. Copy code
    2. sudo ldconfig
  3. If the above steps do not work, you can try setting the PKG_CONFIG_PATH environment variable to the directory containing the GnuTLS .pc file. For example, if the file is located in the "/usr/local/lib/pkgconfig" directory, you can set the PKG_CONFIG_PATH variable as follows:

    1. javascriptCopy code
    2. export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

    Alternatively, you can add the above line to your ~/.bashrc file so that the variable is set automatically every time you open a new terminal.

  4. After setting the PKG_CONFIG_PATH variable, try running the command again. If the error still persists, you can try reinstalling the GnuTLS library and its development headers.

I hope this helps you to resolve the error.

error

ffmpeg: error while loading shared libraries: libavdevice.so.60: cannot open shared object file: No such file or directory

This error message suggests that the ffmpeg program is unable to find the libavdevice.so.60 shared library file. This can happen if the library is missing or not installed on your system, or if the library path is not included in the library search path.

To fix this error, you can try the following steps:

  1. Check if the libavdevice.so.60 library is installed on your system. You can do this by running the following command:

    1. Copy code
    2. sudo updatedb && locate libavdevice.so.60

    If the library is not found, you may need to install it by installing the ffmpeg package or building ffmpeg from source.

  2. If the library is found, you can try adding its path to the library search path. You can do this by running the following command:

    1. bashCopy code
    2. export LD_LIBRARY_PATH=/path/to/lib:$LD_LIBRARY_PATH

    Replace "/path/to/lib" with the directory containing the libavdevice.so.60 library file.

    Alternatively, you can add the above line to your ~/.bashrc file so that the variable is set automatically every time you open a new terminal.

  3. After setting the LD_LIBRARY_PATH variable, try running the ffmpeg command again. If the error still persists, you may need to check if the library path is correct or try reinstalling the ffmpeg package or rebuilding ffmpeg from source.

I hope this helps you to resolve the error.

sudo: updatedb: command not found

The "updatedb" command is a part of the "mlocate" package, which may not be installed on your system. You can install it using the following command:

  1. arduinoCopy code
  2. sudo apt-get install mlocate

After installing the package, you should be able to use the "updatedb" command.

更新/etc/profile配置

To update the /etc/profile configuration file, you can follow these steps:

  1. Open a terminal window and log in as the root user by running the following command:

    1. Copy code
    2. sudo su

    Enter your password if prompted.

  2. Open the /etc/profile file in a text editor. You can use any text editor of your choice, for example, nano or vim. Here, we will use nano:

    1. bashCopy code
    2. nano /etc/profile
  3. Make the necessary changes to the file. For example, you can add environment variables or update the system-wide PATH variable.

  4. Save the changes and exit the text editor. In nano, you can do this by pressing "Ctrl + X", then "Y", and then "Enter".

  5. To make the changes take effect, either log out and log back in, or run the following command:

    1. bashCopy code
    2. source /etc/profile

    This will reload the /etc/profile file and apply the changes.

That's it! You have now updated the /etc/profile configuration file.

13.jellyfin

可道云

更换镜像源

Ubuntu Server20.04

  1. sudo vi /etc/apt/sources.list
  2. deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  3. deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
  4. deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  5. deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
  6. deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  7. deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
  8. # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  9. # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  10. deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  11. deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
  12. sudo apt update
  13. sudo apt-get upgrade

原文链接:https://www.cnblogs.com/vectorqiu/p/17323518.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号