当前位置: 首页 > news >正文

ubuntu的快速安装与配置

文章目录

  • 前言
  • 一、快速安装
  • 二 、基础配置
    • 1 Sudo免密码
    • 2 ubuntu20.04 pip更新源
    • 3 安装和配置oneapi(infort/mpi/mkl) apt下载
      • 第一次下载的要建立apt源
      • apt下载(infort/mpi/mkl)
    • 4 安装一些依赖库等
    • 5 卸载WSL
  • python
  • 总结


前言

win11系统
ubuntu20.04


提示:以下是本篇文章正文内容,下面案例可供参考

一、快速安装

在这里插入图片描述

wsl.exe --list -o

在这里插入图片描述

wsl.exe --install Ubuntu-20.04

在这里插入图片描述

  • 输入用户名和密码
    在这里插入图片描述


二 、基础配置

1 Sudo免密码

  • 给/etc/sudoers增加写的权限
gpasswd -a 用户名 sudo
  • 添加信息
visudo

在这里插入图片描述

  • 重新进入管理员模式
ctrl+x 直接退出
sudo -i

2 ubuntu20.04 pip更新源

cbb@qbchen:~/bin$ cd /etc/apt/
  • 复制原本文件
cbb@qbchen:/etc/apt$ sudo cp -r sources.list sources.list.bak
cbb@qbchen:/etc/apt$ sudo vi sources.list
  • 注意每个源的版本对应ubuntu的版本 不要选错了 我的是ubuntu20.04的版本
    全部替换
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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://mirrors.aliyun.com/ubuntu/ focal universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal universe
deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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://mirrors.aliyun.com/ubuntu/ focal multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-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://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partnerdeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security universe
deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
# deb-src https://apt.repos.intel.com/oneapi all main
esc
:wq
  • 更新源以及更新软件 如果报错没有权限 提升为管理员权限就好了
cbb@qbchen:/etc/apt$ apt update
cbb@qbchen:/etc/apt$ apt upgrade

3 安装和配置oneapi(infort/mpi/mkl) apt下载

  • 官网:https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html?operatingsystem=linux&distributions=aptpackagemanager

第一次下载的要建立apt源

root@qbchen:sudo -iroot@qbchen:~# ls
intelroot@qbchen:~# cd /etc/apt/root@qbchen:/etc/apt# ls
apt.conf.d  auth.conf.d  preferences.d  sources.list  sources.list.bak  sources.list.d  trusted.gpg.droot@qbchen:/etc/apt# cd sources.list.d/
root@qbchen:/etc/apt/sources.list.d# wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null--2023-03-07 15:03:04--  https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
Resolving apt.repos.intel.com (apt.repos.intel.com)... 104.71.139.144, 2600:1417:8000:b86::4b23, 2600:1417:8000:b92::4b23
Connecting to apt.repos.intel.com (apt.repos.intel.com)|104.71.139.144|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3796 (3.7K) [binary/octet-stream]
Saving to: ‘STDOUT’-                             100%[=================================================>]   3.71K  --.-KB/s    in 0s2023-03-07 15:03:05 (616 MB/s) - written to stdout [3796/3796]--2023-03-07 15:03:05--  http://%20/
Resolving   ( )... failed: Name or service not known.
wget: unable to resolve host address ‘ ’
FINISHED --2023-03-07 15:03:05--
Total wall clock time: 1.0s
Downloaded: 1 files, 3.7K in 0s (616 MB/s)
root@qbchen:/etc/apt/sources.list.d# lsroot@qbchen:/etc/apt/sources.list.d# echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.listroot@qbchen:/etc/apt/sources.list.d# ls
oneAPI.listroot@qbchen:/etc/apt/sources.list.d# cat oneAPI.list
deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all mainroot@qbchen:/etc/apt/sources.list.d# apt update

更新出apt里面的包 就算建立完成
在这里插入图片描述

apt下载(infort/mpi/mkl)

  • 下载
root@qbchen:~# apt install intel-oneapi-mkl intel-oneapi-mpi intel-oneapi-compiler intel-oneapi-compiler-fortran
  • 查看ifx icc ifort 看到这几个文件存在 说明安装完成
root@qbchen:~# cd /opt/intel/oneapi/compiler/latest/linux/bin
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin# ls
aocl-ioc64  fpp  icx-cc  icx-cl  icx.cfg  ifx  ifx.cfg  intel64  ioc64  sycl-ls  sycl-post-link
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin# cd intel64/
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# ls
codecov  fpp    ifort.cfg        map_opts  profmerge          proforder  xiar      xild
fortcom  ifort  libcilkrts.so.5  profdcg   profmergesampling  tselect    xiar.cfg  xild.cfg

在这里插入图片描述

  • 配置环境变量
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# vi /etc/profile.d/intel.sh

输入以下内容

oaroot=/opt/intel/oneapi
source $oaroot/mkl/latest/env/vars.sh
source $oaroot/mpi/latest/env/vars.sh
source $oaroot/compiler/latest/env/vars.sh
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# . /etc/profile.d/intel.sh
  • 安装成功
root@qbchen:/opt/intel/oneapi/compiler/latest/linux/bin/intel64# ifortifort: command line error: no files specified; for help type "ifort -help"

4 安装一些依赖库等

apt install build-essential 
apt install cmake

5 卸载WSL

  • 打开cmd
  • 查看版本号
wsl --list
  • 注销ubuntu
wsl --unregister <你的ubuntu的版本号>
  • win系统卸载
    在这里插入图片描述

python

  • ubuntu20.04默认装了python 名字叫python3 默认在/usr/bin
    指向usr/lib目录下面的python3.8
    在这里插入图片描述

总结

相关文章:

ubuntu的快速安装与配置

文章目录前言一、快速安装二 、基础配置1 Sudo免密码2 ubuntu20.04 pip更新源3 安装和配置oneapi(infort/mpi/mkl) apt下载第一次下载的要建立apt源apt下载&#xff08;infort/mpi/mkl)4 安装一些依赖库等5 卸载WSLpython总结前言 win11系统 ubuntu20.04 提示&#xff1a;以下…...

人工智能AI工具汇总(AIGC ChatGPT时代个体崛起)

NameCategoryWebsiteDescription描述《AIGC时代&#xff1a;超级个体的崛起》小报童https://xiaobot.net/p/SuperIndividual 介绍AIGC&#xff0c;ChatGPT&#xff0c;使用技巧与搞钱方式。Masterpiece Studio3Dhttps://masterpiecestudio.comSimplifying 3D Creation with AI…...

【rust-grpc-proxy】在k8s中,自动注入代理到pod中,再不必为grpc调试而烦恼

目录前言原理sidecarwebhook实现安装k8s设置webhook使用尾语前言 rust-grpc-proxy 目前功能基本完善。是时候上环境开始应用了。 之前考虑是gateway模式或者sidecar模式。 思考良久之后&#xff0c;觉得两种模式都有使用场景&#xff0c;那就都支持。本次就带来sidecar模式的食…...

VisualStudio2022制作多项目模板及Vsix插件

一、安装工作负载 在vs2022上安装“visual studio扩展开发 ”工作负载 二、制作多项目模板 导出项目模板这个我就不再多说了&#xff08;项目→导出模板→选择项目模板&#xff0c;选择要导出的项目→填写模板信息→完成&#xff09;。 1.准备模板文件 将解决方案中的多个…...

仿写简单IOC

目录 TestController类: UserService类: 核心代码SpringIOC&#xff1a; Autowired和Component注解 SpringIOCTest 类 ​编辑 总结&#xff1a; TestController类: Component public class TestController {Autowiredprivate UserService userService;public void test…...

liunx下安装node exporter

1 建立文件夹 cd /opt mkdir software 下载最新的包&#xff0c;并解压 https://prometheus.io/download/ 下载 curl -LO https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz 3.解压 tar -xvf node_exporter-0.…...

lambda函数

Lambda(函数指针)lambda 是c11非常重要也是最常用的特性之一&#xff0c;他有以下优点&#xff1a;可以就地匿名定义目标函数或函数对象&#xff0c;不需要额外写一个函数lambda表达式是一个匿名的内联函数lambda表达式定义了一个匿名函数&#xff0c;语法如下&#xff1a;[cap…...

【Python入门第二十七天】Python 日期

Python 日期 Python 中的日期不是其自身的数据类型&#xff0c;但是我们可以导入名为 datetime 的模块&#xff0c;把日期视作日期对象进行处理。 实例 导入 datetime 模块并显示当前日期&#xff1a; import datetimex datetime.datetime.now() print(x)运行实例 2023-0…...

C++基础知识【5】数组和指针

目录 一、概述 数组 指针 二、数组 2.1、数组的声明 2.2、数组的初始化 2.3、数组的访问 2.4、多维数组 2.5、数组作为函数参数 三、指针 3.1、指针的声明 3.2、指针的赋值 3.3、指针的访问 3.4、指针运算 3.5、指针数组和数组指针 3.6、二级指针 四、数组和指…...

Vim使用操作命令笔记

Vim使用操作命令笔记在普通模式下&#xff0c;输入 : help tutor 就可以进入vim的教学       在 terminal 中输入 vim 文件名 就可以打开文件    vim有两种模式   normal mode &#xff08;普通模式&#xff09;→ 指令操作   insert mode &#xff08;输入模式&…...

【论文阅读】Robust Multi-Instance Learning with Stable Instances

1、摘要与引言 以往的MIL算法遵循i.i.d假设&#xff1a;训练样本与测试样本都分别来自于同一分布中&#xff0c;而这一假设往往与现实应用中有所出入。研究人员通过计算训练样本与测试样本之间的密度比对训练样本进行加权&#xff0c;以解决分布变化带来的问题。 分布的变化发…...

洛谷 P5116 [USACO18DEC]Mixing Milk B

题目链接&#xff1a;P5116 [USACO18DEC]Mixing Milk B - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 题目描述 农业&#xff0c;尤其是生产牛奶&#xff0c;是一个竞争激烈的行业。Farmer John 发现如果他不在牛奶生产工艺上有所创新&#xff0c;他的乳制品生意可能就会受…...

华为OD机试 - 最左侧冗余覆盖子串(C 语言解题)【独家】

最近更新的博客 华为od 2023 | 什么是华为od,od 薪资待遇,od机试题清单华为OD机试真题大全,用 Python 解华为机试题 | 机试宝典【华为OD机试】全流程解析+经验分享,题型分享,防作弊指南)华为od机试,独家整理 已参加机试人员的实战技巧文章目录 使用说明本期题目:最左侧冗…...

《Netty》从零开始学netty源码(三)之SelectorProvider

...

实验7 图像水印

本次实验大部分素材来源于山大王成优老师的讲义以及冈萨雷斯&#xff08;MATLAB版&#xff09;&#xff0c;仅作个人学习笔记使用&#xff0c;禁止用作商业目的。 文章目录一、实验目的二、实验例题1. 数字图像水印技术2. 可见水印的嵌入3. 不可见脆弱水印4. 不可见鲁棒水印一、…...

如何实现大文件断点续传、秒传

大家先来了解一下几个概念&#xff1a; 「文件分块」&#xff1a;将大文件拆分成小文件&#xff0c;将小文件上传\下载&#xff0c;最后再将小文件组装成大文件&#xff1b; 「断点续传」&#xff1a;在文件分块的基础上&#xff0c;将每个小文件采用单独的线程进行上传\下载&…...

备战蓝桥python——完全平方数

完全平方数 链接: 完全平方数 暴力解法&#xff1a; n int(input()) for i in range(1, n1):if(((i*n)**0.5)%10.0):print(i)break运用数论相关知识求解 任意一个正整数都可以被分解成若干个质数乘积的形式&#xff0c;例如 :2022∗5120 \ 2^{2}*5^{1}\,20 22∗51 由此…...

WebRTC中的NAT穿透

NAT简介 我们知道&#xff0c;WebRTC会按照内网、P2P、中转的顺序来尝试连接。在大部分的情况下&#xff0c;实际是使用P2P或者中转的。这里P2P的场景主要使用的技术就是NAT穿透。 我们先简单了解下NAT。NAT在真实网络中是常见的&#xff0c;它的出现一是为了解决ipv4地址不够…...

SpringCloud-高级篇(一)

目录&#xff1a; &#xff08;1&#xff09;初识Sentinel-雪崩问题的解决方案 &#xff08;2&#xff09;服务保护Sentinel和Hystrix对比 &#xff08;3&#xff09;Sentinel初始-安转控制台 &#xff08;4&#xff09;整合微服务和Sentinel 微服务高级篇 &#xff08;1&…...

电脑自动重启是什么原因?详细解说

案例&#xff1a;电脑自动重启是什么原因&#xff1f; “一台用了一年的电脑&#xff0c;最近使用&#xff0c;每天都会一两次莫名其妙自动重启&#xff0c;看了电脑错误日志&#xff0c;看不懂什么意思&#xff0c;一直找不到答案。有没有高手知道怎么解决这个问题的。” 当…...

浅谈 React Hooks

React Hooks 是 React 16.8 引入的一组 API&#xff0c;用于在函数组件中使用 state 和其他 React 特性&#xff08;例如生命周期方法、context 等&#xff09;。Hooks 通过简洁的函数接口&#xff0c;解决了状态与 UI 的高度解耦&#xff0c;通过函数式编程范式实现更灵活 Rea…...

stm32G473的flash模式是单bank还是双bank?

今天突然有人stm32G473的flash模式是单bank还是双bank&#xff1f;由于时间太久&#xff0c;我真忘记了。搜搜发现&#xff0c;还真有人和我一样。见下面的链接&#xff1a;https://shequ.stmicroelectronics.cn/forum.php?modviewthread&tid644563 根据STM32G4系列参考手…...

调用支付宝接口响应40004 SYSTEM_ERROR问题排查

在对接支付宝API的时候&#xff0c;遇到了一些问题&#xff0c;记录一下排查过程。 Body:{"datadigital_fincloud_generalsaas_face_certify_initialize_response":{"msg":"Business Failed","code":"40004","sub_msg…...

微信小程序之bind和catch

这两个呢&#xff0c;都是绑定事件用的&#xff0c;具体使用有些小区别。 官方文档&#xff1a; 事件冒泡处理不同 bind&#xff1a;绑定的事件会向上冒泡&#xff0c;即触发当前组件的事件后&#xff0c;还会继续触发父组件的相同事件。例如&#xff0c;有一个子视图绑定了b…...

【JavaEE】-- HTTP

1. HTTP是什么&#xff1f; HTTP&#xff08;全称为"超文本传输协议"&#xff09;是一种应用非常广泛的应用层协议&#xff0c;HTTP是基于TCP协议的一种应用层协议。 应用层协议&#xff1a;是计算机网络协议栈中最高层的协议&#xff0c;它定义了运行在不同主机上…...

CMake基础:构建流程详解

目录 1.CMake构建过程的基本流程 2.CMake构建的具体步骤 2.1.创建构建目录 2.2.使用 CMake 生成构建文件 2.3.编译和构建 2.4.清理构建文件 2.5.重新配置和构建 3.跨平台构建示例 4.工具链与交叉编译 5.CMake构建后的项目结构解析 5.1.CMake构建后的目录结构 5.2.构…...

LeetCode - 394. 字符串解码

题目 394. 字符串解码 - 力扣&#xff08;LeetCode&#xff09; 思路 使用两个栈&#xff1a;一个存储重复次数&#xff0c;一个存储字符串 遍历输入字符串&#xff1a; 数字处理&#xff1a;遇到数字时&#xff0c;累积计算重复次数左括号处理&#xff1a;保存当前状态&a…...

【Java_EE】Spring MVC

目录 Spring Web MVC ​编辑注解 RestController RequestMapping RequestParam RequestParam RequestBody PathVariable RequestPart 参数传递 注意事项 ​编辑参数重命名 RequestParam ​编辑​编辑传递集合 RequestParam 传递JSON数据 ​编辑RequestBody ​…...

Unit 1 深度强化学习简介

Deep RL Course ——Unit 1 Introduction 从理论和实践层面深入学习深度强化学习。学会使用知名的深度强化学习库&#xff0c;例如 Stable Baselines3、RL Baselines3 Zoo、Sample Factory 和 CleanRL。在独特的环境中训练智能体&#xff0c;比如 SnowballFight、Huggy the Do…...

Linux部署私有文件管理系统MinIO

最近需要用到一个文件管理服务&#xff0c;但是又不想花钱&#xff0c;所以就想着自己搭建一个&#xff0c;刚好我们用的一个开源框架已经集成了MinIO&#xff0c;所以就选了这个 我这边对文件服务性能要求不是太高&#xff0c;单机版就可以 安装非常简单&#xff0c;几个命令就…...