Linux系统之Ubuntu学习之路

文章目录

  • 1. 操作记录
    • 1. Win10安装Ubuntu16.04双系统操作记录
    • 2. 安装搜狗输入法
    • 3. 安装VSCode
    • 4. git命令行操作
      • 命令行更多操作
      • 配置
        • (0) 设置账号密码(免得每次push都要输)
        • (1) 克隆代码
        • (2) 提交前拉代码
        • (3) commit操作
        • (4) push操作
    • 5. 安装.deb安装包
    • 6. vi快捷键
    • 7. 显示显卡信息
    • 8. 更新源
    • 9. py3安装numpy错误记录
    • 10. dpkg: error: dpkg status database is locked by another process
    • 11. 搭载服务器
      • 1. 安装s,但是最后两步无果。
      • 2. 转而安装qt版本
    • 12. ubuntu解压tar.gz
    • 13. 安装tensorflow-gpu太慢小笔记
    • 14. 安装keras-gpu小笔记
    • 15. 查看已安装的python包的命令
  • 2. 注意事项
    • 1. run time out
    • 2. TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
    • 3. mnist.load()下载地址

鸟哥的linux私房菜pdf:https://legacy.gitbook.com/book/wizardforcel/vbird-linux-basic-4e/details

1. 操作记录

1. Win10安装Ubuntu16.04双系统操作记录

https://blog.csdn.net/fesdgasdgasdg/article/details/54183577
https://blog.csdn.net/flyyufenfei/article/details/79187656
https://www.cnblogs.com/Duane/p/5424218.html

2. 安装搜狗输入法

https://blog.csdn.net/areigninhell/article/details/79696751

3. 安装VSCode

https://blog.csdn.net/u010648921/article/details/82624768

4. git命令行操作

https://blog.csdn.net/tiandao2009/article/details/80085545

命令行更多操作

https://www.jianshu.com/p/46ffff059092

配置

git config --global user.name “用户名”

git config --global user.email “用户的邮箱名”

(0) 设置账号密码(免得每次push都要输)

1、先cd到根目录,执行git config --global credential.helper store命令

[root@iZ25mi9h7ayZ ~]# git config --global credential.helper store

2、执行之后会在vim .gitconfig文件中多加红色字体项

[user]
name = thomas
email = [email protected]
[credential]
helper = store

3、之后cd到项目目录,执行git pull命令,会提示输入账号密码。输完这一次以后就不再需要,并且会在根目录生成一个.git-credentials文件

[root@iZ25mi9h7ayZ test]# git pull
Username for ‘https://git.oschina.net’: [email protected]
Password for ‘https://[email protected]@git.oschina.net’:

[root@iZ25mi9h7ayZ ~]# vim .git-credentials
https://Username:[email protected]

4、之后pull/push代码都不再需要输入账号密码了~

(1) 克隆代码

git clone

(2) 提交前拉代码

git fetch --dry-run
git pull

(3) commit操作

git status
git add -A
git commit -m “description”

(4) push操作

git push

5. 安装.deb安装包

https://blog.csdn.net/zhuhan_june/article/details/79823562

sudo dpkg -i

6. vi快捷键

https://www.cnblogs.com/jing1617/p/6417226.html

  • 跳转行号::n
  • 显示行号::set nu

7. 显示显卡信息

lspci | grep -i vga

8. 更新源

为了下载更快
https://blog.csdn.net/xiaojin21cen/article/details/81318049

9. py3安装numpy错误记录

  • 老提示要升级pip You should consider upgrading via the 'pip install --upgrade pip' command.
    https://blog.csdn.net/u012033124/article/details/84000005
curl https://bootstrap.pypa.io/get-pip.py | python3
pip3 install numpy
  • from pip import main
    https://blog.csdn.net/qq_38522539/article/details/80678412
sudo vi /usr/bin/pip3
原文:from pip import main 
修改后:from pip._internal import main

10. dpkg: error: dpkg status database is locked by another process

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

11. 搭载服务器

http://www.pianshen.com/article/8919290921/

1. 安装s,但是最后两步无果。

https://blog.csdn.net/qq_31746287/article/details/83471857

2. 转而安装qt版本

https://blog.csdn.net/qq_41621362/article/details/88810577

成功, 然后配置terminal。
https://blog.csdn.net/qq_41621362/article/details/88830769

12. ubuntu解压tar.gz

https://www.cnblogs.com/nyist-xsk/p/7929859.html

ZIP

zip可能是目前使用得最多的文档压缩格式。它最大的优点就是在不同的操作系统平台,比如Linux, Windows以及Mac OS,上使用。缺点就是支持的压缩率不是很高,而tar.gz和tar.gz2在压缩率方面做得非常好。闲话少说,我们步入正题吧:

我们可以使用下列的命令压缩一个目录:

# zip -r archive_name.zip directory_to_compress

下面是如果解压一个zip文档:

# unzip archive_name.zip

TAR

Tar是在Linux中使用得非常广泛的文档打包格式。它的好处就是它只消耗非常少的CPU以及时间去打包文件,他仅仅只是一个打包工具,并不负责压缩。下面是如何打包一个目录:

# tar -cvf archive_name.tar directory_to_compress

如何解包:

# tar -xvf archive_name.tar.gz

上面这个解包命令将会将文档解开在当前目录下面。当然,你也可以用这个命令来捏住解包的路径:

# tar -xvf archive_name.tar -C /tmp/extract_here/

TAR.GZ

这种格式是我使用得最多的压缩格式。它在压缩时不会占用太多CPU的,而且可以得到一个非常理想的压缩率。使用下面这种格式去压缩一个目录:

# tar -zcvf archive_name.tar.gz directory_to_compress

解压缩:

# tar -zxvf archive_name.tar.gz

上面这个解包命令将会将文档解开在当前目录下面。当然,你也可以用这个命令来捏住解包的路径:

# tar -zxvf archive_name.tar.gz -C /tmp/extract_here/

TAR.BZ2

这种压缩格式是我们提到的所有方式中压缩率最好的。当然,这也就意味着,它比前面的方式要占用更多的CPU与时间。这个就是你如何使用tar.bz2进行压缩。

# tar -jcvf archive_name.tar.bz2 directory_to_compress

上面这个解包命令将会将文档解开在当前目录下面。当然,你也可以用这个命令来捏住解包的路径:

# tar -jxvf archive_name.tar.bz2 -C /tmp/extract_here/

13. 安装tensorflow-gpu太慢小笔记

https://blog.csdn.net/cufe_shang/article/details/90297940

sudo python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu==1.2.0

14. 安装keras-gpu小笔记

cuda和cudnn版本匹配:
https://blog.csdn.net/cufe_shang/article/details/90297940
Linux系统之Ubuntu学习之路_第1张图片一些可参考的帖子:
https://sthsf.github.io/wiki/Algorithm/DeepLearning/Tensorflow%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Tensorflow%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86—Tensorflow-gpu%E7%89%88%E6%9C%AC%E5%AE%89%E8%A3%85.html

GPU显卡对应的配置:

http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

15. 查看已安装的python包的命令

查看python2安装的:python2 -m pip list
查看python3安装的:python3 -m pip list

2. 注意事项

1. run time out

在命令后面加上

--default-timeout=100

2. TypeError: unsupported operand type(s) for -=: ‘Retry’ and ‘int’

https://blog.csdn.net/zhangpeterx/article/details/83653040

python -m pip install --upgrade pip
python -m pip install xxx

3. mnist.load()下载地址

将mnist.pkl.gz下载到本地路径~/.keras/datasets/

你可能感兴趣的:(Linux系统之Ubuntu学习之路)