Ubuntu虚拟机下载与安装

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介: Ubuntu虚拟机下载与安装

sonic

https://sonic-cloud.gitee.io/#/Deploy

img

CentOS7下载地址

http://isoredirect.centos.org/centos/7/isos/x86_64/

http://centos.nethub.com.hk/7.9.2009/isos/x86_64/

教程https://blog.51cto.com/u_8224502/3606357

Ubuntu安装

https://blog.csdn.net/weixin_41805734/article/details/120698714

Ubuntu下载-清华

Ubuntu虚拟机下载与安装,基础设置

下面这些链接是csdn博主写的特别好,我安装的时候就是按照他的思路搞的

Ubuntu虚拟机下载与安装

https://blog.csdn.net/weixin_45912291/article/details/108894737

Ubuntu系统下载(清华大学开源软件镜像站)

https://blog.csdn.net/weixin_45912291/article/details/108900602

ubuntu设置中文环境

https://blog.csdn.net/gymaisyl/article/details/100981982

ubuntu中文输入法安装

https://blog.csdn.net/a805607966/article/details/105874756

Windows与Ubuntu跨系统复制粘贴

打开终端,手动输入以下命令,再重启ubuntu系统就可以了

即通过安装VMtools实现了Windows与Ubuntu跨系统复制粘贴,也实现了Ubuntu窗口自适应

sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop

参考:Copy/paste and drag&drop not working

[

](https://blog.csdn.net/weixin_41805734/article/details/120698714)

查看Ubuntu的ip并连接

#在终端输入命令  
sudo apt install openssh-server
#再执行命令:
sudo apt install net-tools
#安装完成后输入命令:
ifconfig

img

红框里面的就是你自己电脑要连接Ubuntu的IP

192.168.111.128

验证

img

使用finalshell连接成功

img

img

进入root文件夹权限不够

问题描述:

在Ubuntu系统中使用普通用户登录进去,执行一些命令时会提示Permission denied,权限不足问题,这是由于我们使用的是普通用户,而不是系统管理员,有一些文件夹或者命令的操作权限是只有管理员才有的,所以需要对管理员账户进行设置

解决方案:

1.给管理员账户设置密码,使用管理员执行命

Ubuntu安装好后,root初始密码(默认密码)是不知道的,也没有进行设置,这里需要设置一下密码才可以使用root用户登录

1.1 先用安装Ubuntu时创建的用户登录到系统

1.2 输入命令:sudo passwd 然后按回车

1.3 提示输入新密码,重复输入新密码,两遍输入没问题后提示 passwd: password updated successfully,此时已完成root密码的设置

1.4 输入su root命令,切换到root身份登录到系统

此时执行命令就不会报错Permission denied错误了

img

img

卸载python3,安装指定版本

卸载了Ubuntu图形化界面就全没了,别去干这事

我下载的这个Ubantu自带的python是3.10,我的项目大部分是3.8,为了后续不出奇奇怪怪的问题,这里我选择重装

#卸载python3
apt-get remove python3
#卸载python3及其依赖
apt-get remove --auto-remove python3
#清除python3
apt-get purge python3

安装python3.8(可以作为直接安装)

1.安装Python软件工具
sudo apt-get install software-properties-common

2. 添加仓库镜像源
sudo add-apt-repository ppa:fkrull/deadsnakes
或
sudo vim /etc/apt/sources.list.d/fkrull-ubuntu-deadsnakes-xenial.list
添加源:deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu xenial main
3.  更新源
sudo apt-get update 
sudo apt-get install python3.8

报错解决

没有用

没有图形化界面了

1.更新软件:
sudo apt-get update
2.重新安装:
sudo apt-get install ubuntu-desktop

sudo add-apt-repository ppa:fkrull/deadsnakes 该命令报错如下

https://blog.csdn.net/qq494370/article/details/105258412

N: 无法安全地用该源进行更新,所以默认禁用该源。 
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

Ubuntu安装mysql

sudo apt-get install mysql-server
sudo apt-get install mysql-client
mysql -h localhost -u root -p  #然后输入sudo的密码即可
#新建库
create database xiaozai; #sonic

img

windows连接Ubuntu的Mysql

1.ubuntu中的mysql不能远程访问,在/etc/mysql/mysql.conf.d/mysqld.cnf中找到bind-address = 127.0.0.1,将其改成bind-address = 0.0.0.0。ubuntu默认只允许本地访问mysql,这是因为mysql的bind-address=127.0.0.1,要支持远程连接的话需要把bind-address改成0.0.0.0.

\2. 重启数据库
service mysql restart

img

报错

img

处理方案

#1、先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql;
mysql -u root -p;# 进入数据库
use mysql;

#2、执行:
select host from user where user = 'root';
#发现, host的值就是localhost。

#将它的值改掉:
update user set host='%' where user = 'root';

#3、修改完成后,执行:
flush privileges;
#将修改内容生效,再次配置时,用IP地址或者localhost就能够正常连接到MySQL数据库了。

img

mysql> select host from user where user = 'root';
+-----------+
| host      |
+-----------+
| localhost |
+-----------+
1 row in set (0.00 sec)
mysql> update user set host='%' where user = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;

第一次安装更改账户密码

https://blog.csdn.net/m0_50510220/article/details/120267240

https://blog.csdn.net/guotianqing/article/details/108750405

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql>  select user,plugin from user;
+------------------+-----------------------+
| user             | plugin                |
+------------------+-----------------------+
| root             | auth_socket           |
| debian-sys-maint | caching_sha2_password |
| mysql.infoschema | caching_sha2_password |
| mysql.session    | caching_sha2_password |
| mysql.sys        | caching_sha2_password |
+------------------+-----------------------+
5 rows in set (0.00 sec)

update user set authentication_string='' where user='root';//root不设置密码
service mysql restart //不需要密码可以登录了
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456'; //root密码为12345【mysql8.0以上这样修改】

卸载mysql

https://blog.csdn.net/qq_42257666/article/details/124007185

设置成的是无密码登录

img

CREATE USER 'xiaozai'@'%' IDENTIFIED BY '123456'; #创建一个远程可以连接的账户名为xiaozai,密码为123456

#参考https://blog.csdn.net/weixin_39939012/article/details/103013022

授权数据库"sonic"所有表的所有操作给xiaozai用户:
远程使用:
grant all privileges on sonic.* to 'xiaozai'@'%';

虚拟机连手机

https://jingyan.baidu.com/article/c74d6000b1ef1b0f6a595d14.html

虚拟机安装adb

https://blog.csdn.net/m0_37105371/article/details/114541652

1、adb 驱动安装

安装adb驱动到ubuntu系统下:

更新一遍软件源:

sudo apt-get update

安装adb工具:

sudo apt-get install android-tools-adb

检查安装是否成功:

adb version

2、列出当前的adb设备

sudo adb devices

3、添加USB设备到adb配置文件

在当前目录下查找.android目录。

在.android目录下创建一个adb_usb.ini,touch adb_usb.ini。

添加要接入设备的USB VID到该文件中。

设备的USB VID可以通过lsusb命令查找。

例:lsusb命令显示的USB设备如下:

Bus 003 Device 006: ID 2dee:4d20

其中2dee就是VID idVendor,4d20是idProduct

需要在adb_usb.ini中添加一行:0x2dee

4、重启adb服务

sudo adb kill-server

sudo adb devices

5、常用adb命令

查看连接的设备

adb devices

登陆设备

adb shell

退出登陆

exit

上传文件到设备

adb push 文件名 设备端存储路径

adb push 不仅用于上传单个文件,也可以上传多个文件

adb push . 就可以上传当前目录下所有文件。

下载设备上的文件

adb pull 设备端文件 本地存储路径

[

](https://blog.csdn.net/m0_37105371/article/details/114541652)

相关报错

VMware安装linux报错(Intel VT-x 禁用)确认 BIOS/固件设置中启用了 Intel VT-x 并禁用了“可信执行”

VMware10安装linux(ubuntu_14.1.0)出现如下错误:

(1) 确认 BIOS/固件设置中启用了 Intel VT-x 并禁用了“可信执行”。

(2) 如果这两项 BIOS/固件设置有一项已更改,请重新启动主机。

(3) 如果您在安装 VMware Workstation 之后从未重新启动主机,请重新启动。

(4) 将主机的 BIOS/固件更新至最新版本。

查看电脑BIOS主板信息

按快捷键“win+r”进入运行,输入“dxdiag”点击确定,查看BIOS信息,再对应去网上搜索这个主板是什么型号的

再进入BIOS界面,再去搜索打开

img

a.进入BIOS,选择Configuration选项,选择Intel Virtual Technology并回车。注意:若无VT选项或不可更改,则表示你的电脑不支持VT技术。此时该选项应该是disabled(关闭)的;

b.将光标移动至Enabled处,并回车确定。

c.保存退出。

N: 无法安全地用该源进行更新,所以默认禁用该源。

打开软件软件和更新(不是换源)

img

然后点击其它软件
里边有一个网址与你报错的网址一样,而且是勾选状态的

取消选择,然后关闭

img

回到终端再执行命令就成功了

还是不成功的话参考以下文章

https://blog.csdn.net/chenbetter1996/article/details/80255552

这个下载自的源。 对应文件是 /etc/apt/sources.list.d #这个目录下的文件都带有.save的备份

可以看到

img

删除显示的文件

这些错误是说add-apt-repository的远程仓库没有这个文件,这个IP也是ping不通的。

添加的仓库保存在 /etc/apt/sources.list.d目录下。删除对应的错误仓库文件即可

相关文章
|
3天前
|
Ubuntu Linux Python
Linux(15)Ubuntu安装ninja构建工具
Linux(15)Ubuntu安装ninja构建工具
14 0
|
3天前
|
Ubuntu Linux 数据安全/隐私保护
Linux(7)Ubuntu20.04 arm64安装Docker
Linux(7)Ubuntu20.04 arm64安装Docker
15 0
|
4天前
|
存储 Ubuntu Docker
如何在 Ubuntu 上安装 Docker?
【4月更文挑战第17天】
42 8
如何在 Ubuntu 上安装 Docker?
|
7天前
|
Ubuntu Docker 索引
ubuntu 20.04 安装docker教程和安装中遇到的问题解决方案(超详细 附加图文教程)
ubuntu 20.04 安装docker教程和安装中遇到的问题解决方案(超详细 附加图文教程)
30 0
|
9天前
|
Ubuntu 数据安全/隐私保护
在UBUNTU虚拟机上安装R软件包
在UBUNTU虚拟机上安装R软件包
13 0
|
9天前
|
存储 编解码 Ubuntu
0-零基础安装ubuntu(超详细安装步骤)
0-零基础安装ubuntu(超详细安装步骤)
|
10天前
|
Ubuntu Linux 定位技术
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
手把手教你优雅的安装虚拟机 Ubuntu —— 图文并茂
|
20天前
|
Ubuntu Python
WSL ubuntu 20.04安装python3
通过以上步骤,你可以在WSL的Ubuntu 20.04上成功安装Python 3。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
21 1
|
20天前
|
Ubuntu Python
ubuntu安装python3.9
通过以上步骤,你可以在Ubuntu上成功安装Python 3.9。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
31 1
|
20天前
|
Ubuntu 网络安全 数据安全/隐私保护
ubuntu篇-配置FTP服务,本机和docker安装
通过以上步骤,你可以在Ubuntu上配置FTP服务,无论是本机安装还是Docker内安装,都可以提供FTP文件传输服务。 买CN2云服务器,免备案服务器,高防服务器,就选蓝易云。百度搜索:蓝易云
20 1