参阅

工藤新喵.ubuntu-in-termux.Gitee.[1]
xiliuya.termux-linux.Github.[2]

centos安装

脚本——这个脚本还可以安装很多其它的操作系统,而且下载速度还不赖

1
2
3
4
5
# 运行脚本,根据提示输入对应的系统
# 建议装8-stream,目前9还有一些东西不支持
bash install_linux.sh
>centos
>9

换源(9-stream)

1
2
3
# 清华源
mv /etc/yum.repos.d/centos.repo /etc/yum.repos.d/centos.repo.bk
touch /etc/yum.repos.d/centos.repo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 手动复制一下
[baseos]
name=CentOS Stream $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[appstream]
name=CentOS Stream $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

换源(8-stream)

更新

1
yum makecache && yum update -y

ubuntu安装

脚本

换源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# souces.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ jammy universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-backports main restricted universe multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ jammy-security multiverse
deb https://download.webmin.com/download/repository sarge contrib

常用软件

1
2
apt install vim
apt install ssh

mysql数据库

1
sudo apt-get install mysql-server

/var/log/mysql/error.log

Plugin mysqlx reported: ‘Setup of bind-address: ‘127.0.0.1’ port: 33060 failed, socket() failed with error: Permission denied(13)’

1
2
3
4
# 尝试使用user=root启动
# 直接使用mysqld启动
# usermod -a -G aid_inet,aid_net_raw mysql
# usermod -a -G aid_inet,aid_net_raw root

vnc服务器

1
# 待续

声卡驱动

1
2
3
4
5
sudo apt install pulseaudio
sudo apt install pavucontrol
pactl list sources short
echo 'load-module module-simple-protocol-tcp rate=44100 format=s16le channels=2 source=0 record=true port=23217'>> /etc/pulse/default.pa
pulseaudio --start

宝塔面板

Ubuntu

1
wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec

问题方案

dpkg: error processing package mariadb-common (–configure):
installed mariadb-common package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
mariadb-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

1
2
3
cd /var/lib/dpkg
sudo mv info info.bak
sudo mkdir info

debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78.)

1
apt install dialog

sudo: /etc/sudo.conf is owned by uid 10187, should be 0
sudo: /etc/sudo.conf is owned by uid 10187, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin “sudoers_policy”
sudo: /usr/libexec/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins

1
2
3
4
5
6
chown root:root /etc/sudo.conf;
chown root:root /usr/libexec/sudo/sudoers.so;
chown root:root /etc/sudoers;
chown root:root /etc/sudoers.d -R
# chown root:root /etc/sudoers.d/README
chown root:root /etc/sudo -R

[/usr/sbin/service: line 3: /etc/init.d/functions: No such file or directory](/usr/sbin/service: line 3: /etc/init.d/functions: No such file or directory)

1
yum install -y initscripts

W: GPG error: https://download.webmin.com/download/repository sarge Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY D97A3AE911F63C51
E: The repository ‘https://download.webmin.com/download/repository sarge Release' is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D97A3AE911F63C51

Running in chroot, ignoring command ‘start’

1
2
3
4
5
6
wget https://github.com/smaknsk/servicectl/archive/1.0.tar.gz
tar -xf 1.0.tar.gz -C /usr/local/lib/
ln -s /usr/local/lib/servicectl-1.0/servicectl /usr/bin/servicectl
ln -s /usr/local/lib/servicectl-1.0/serviced /usr/bin/serviced
mv /usr/bin/systemctl /usr/bin/systemctl.bak
mv /usr/bin/servicectl /usr/bin/systemctl

/usr/bin/systemctl: 16: [: -ne: unexpected operator
/usr/bin/systemctl: 23: Syntax error: “(“ unexpected

1
2
3
# 解释器错误
# 修改首行 shebang
#!/bin/sh ->#!/bin/bash

子进程 已安装 post-installation 脚本 返回了错误号 1

1
2
3
4
5
6
7
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old 
sudo mkdir /var/lib/dpkg/info
sudo apt-get update
sudo apt-get -f install
sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old
sudo rm -rf /var/lib/dpkg/info
sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info

hostname: Name or service not known
make-ssl-cert: Could not get FQDN, using ‘localhost’.
make-ssl-cert: You may want to fix your /etc/hosts and/or DNS setup and run
make-ssl-cert: ‘make-ssl-cert generate-default-snakeoil –force-overwrite’
make-ssl-cert: again.

/usr/bin/deb-systemd-helper: error: systemctl preset failed on ubuntu-advantage.service: No such file or directory

invoke-rc.d: could not determine current runlevel
Scheduling reload of GNOME Display Manager configuration gdm3 setpriv: setresgid failed: Operation not permitted
invoke-rc.d: initscript gdm3, action “reload” failed.

setpriv: setresgid failed: Operation not permitted

1
2
chmod a+s /bin/su
chmod a+s /bin/sudo

Failed to execute child process “dbus-launch“

1
sudo apt-get install dbus-x11

W: [pulseaudio] main.c: 不应以 root 身份运行本程序(除非指定 –system 参数)。
E: [autospawn] core-util.c: Home directory not accessible: 权限不够
W: [autospawn] lock-autospawn.c: 不能访问自动执行锁。
E: [pulseaudio] main.c: Failed to acquire autospawn lock

1
2
sudo chown root:root $HOME/
sudo chown -R $USER:$USER $HOME/

The connection was refused by the computer

1
2
# .vnc/config
echo localhost=no >> .vnc/config

新用户tab无法补全

1
2
# 修改解释器为SHELL=/bin/bash
vim /etc/default/useradd

N: [pulseaudio] main.c: User-configured server at 127.0.0.1:23217, refusing to start/autospawn.

1
2
3
# 找到问题所在了
# 是 linux deploy在/etc/profile.d/下的pulse.sh脚本的问题
# 解决方案是移出脚本或注释所以内容

Connection failure: Connection refused
pa_context_connect() failed: Connection refused

1

赋予root网络相关权限,解决apt update的连接错误提示(应该是用这个解决的,也可能是通过修改linuxdeploy的dns配置为自动)

1
usermod -a -G aid_inet,aid_net_raw root