标签 ubuntu 下的文章

安装

$ sudo apt install mysql-server

查看默认账号密码

$ sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = debian-sys-maint
password = JRvfA0JiQGk5qhnz
socket   = /var/run/mysqld/mysqld.sock

修改密码

$ mysql -udebian-sys-maint -pJRvfA0JiQGk5qhnz
mysql>USE mysql;

// mysql 5.7
mysql>UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql>update mysql.user set authentication_string=password('xxx') where User='root' and Host='localhost';
// mysql 8.0
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxx';

mysql>flush privileges;
mysql>exit;

需要手动添加dns服务器才能解析网址:
修改/etc/netplan/00-installer-config.yaml内容如下,注意enp0s3需要修改

# This is the network config written by 'subiquity'
network:
  ethernets:
    enp0s3:
      addresses: []
      dhcp4: true
      gateway4: 192.168.0.1
      nameservers:
          addresses: [223.5.5.5, 223.6.6.6]
  version: 2

重启网络
sudo netplan apply

Qemu在Linux安装新系统一次成功,在window下卡启动报告~

安装 qemu

apt-get instll qemu qemu-utils qemu-system-x86

新建虚拟机,安装系统

qemu-img create -f qcow2 ubunut18_x86_64.img 10G
qemu-img info ubunut18_x86_64.img
qemu-system-x86_64 --enable-kvm -m 1G -smp 2 -boot order=dc -hda /home/u0u0/works/qemu-images/ubuntu18.img -cdrom /home/u0u0/ubuntu-18.04.5-live-server-amd64.iso

阅读剩余部分

安装gcc7和g++7

sudo apt install gcc-7 g++-7

添加配置

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7

切换gcc版本

sudo update-alternatives --config gcc

错误信息:

Failed to Set MokListRT: Invalid Parameter
Could not create mokListRT: Invalid Parameter
Importing MOK states has failed: import_mok_state() failed: Invalid Parameter
Continuing boot since secure mode is disabled.

修正:

sudo su -
cd /boot/efi/EFI/ubuntu
cp grubx64.efi shimx64.efi
reboot

参考:(Ubuntu 20.04 Failed to Set MokListRT: Invalid Parameter)[https://askubuntu.com/questions/1279602/ubuntu-20-04-failed-to-set-moklistrt-invalid-parameter]