linux-Ubuntu安装后续工作小结-flag

2023-05-16

flage目的: 1.由于操作不熟练,被某人鄙视了一次。。。。。。。。

                   2.常温习,防遗忘,快速解决,提高效率。。。。。。。

1 安装Ubuntu

(1)制作ubuntu启动U盘--制作用rufus软件,用过UltrISO制作不行;软件自down,教程自查;

 (2)下载镜像文件

      -有服务器版本(全是命令行,没有桌面,鼠标没卵用)和桌面版本(像Windows一样,鼠标有用,安装文件占据空间大),后期熟悉了,后期建议用服务端版本,理由是操作快-也很锻炼字节命令行的操作能力,对编码有益;

(2)参考博客开始安装-https://blog.csdn.net/u012267304/article/details/80647980 

帖子第八步之前的网络设置,如果不知道网络IP,不建议在装机的时候设置网口IP和DNS等网络设置。应该选择最后一项;

(我也是按照该教程执行的,后续修改IP)

记住用户名和密码!!!(由于没记住,又重装了一遍,日了狗!)

2.安装后续工作

(1)IP修改--先修改IP网络,保证可以连接外网

(连接外网后,可以上网,安装各种软件,很关键)

1)首先ifconfig -a 查看所有网卡

 结果如下----如图所示, enp4s0(数字0不是字母O)到enp7s0是四个网卡的名称, 一般的只有两个网口, 此处不重要, 如果网卡中显示了IP地址,那么可以跳过进行第3步如果没有IP地址, 那么记住网卡的名称然后执行下一步

2)设定静态IP

Linux为全命令行操作, 如果设置静态IP要通过文件操作, 首先执行命令打开文件, sudo vi /etc/network/interfaces 会弹出类似另外一个窗口, 如下图,大部分电脑默认的配置文件都是这些内容, 如果你的不是, 不要紧, 按照我说的设置就可以了;

还记得上一步通过ipconfig -a查看到的网卡名称吗, 我的是enp4s0 enp5s0 enp6s0 enp7s0,
由于大部分机子只有两个网卡, 本次我们就设置两个网卡, 即使你的有三个网卡, 我们仍然设置两个网卡的配置。
所以我们在后面加入
auto enp4s0 
iface enp4s0 inet static
address 192.168.1.105
netmask 255.255.255.0
gateway 192.168.1.1

auto enp5s0 
iface enp5s0 inet static
address 192.168.2.105
netmask 255.255.255.0
gateway 192.168.2.1
dns-nameserver 8.8.8.8
dns-nameserver 8.8.4.4

输入完成的文件内容如右图:

 

其中enp4s0 和 enp5s0 为刚才ifconfig查看的网卡名, 不要忘记了,address为需要设置的静态IP地址, 理论上, 网卡1的IP地址是不更改的, netmask为固定的255.255.255.0,gateway为IP地址同一网段的内容最后的一位是1, 千万记得, 设置的IP地址最后一位不能为0、1、255

vim输入不进去?
由于linux全命令行操作, 文件编辑器也是命令行操作的。在输入之前,首先先输入i或a,左下角会显示insert,此时就可以输入了,如果要修改某处的文件, 先用命令dd删除本行, 再键入i进入insert模式将想要输入的内容输入到文件当中, 整体输入完成后, 键入esc退出insert模式, 再输入:wq即可保存文件。(如果想要了解更多的输入方式, 可以自行百度vi或者vim使用教程)此时, ip地址已经设置完成了, 相信已经回到了linux的命令行界面了, 输入完reboot即可重启, 重启之后登录进行下一步。

3)验证:输入ifconfig -a, 结果如下

(2)如果是虚拟机安装桌面版ubuntu的,可以需要安装基本工具vmware tool

安装了vmware tools 后 ,可以使用- ”立即适应客户机 ”

安装了vmware tools 后  ,可以使用复制本机-粘贴操纵

安装报错-以及解决方法:https://blog.csdn.net/u013346000/article/details/50024565

A previous installation of VMware Tools has been detected.
The previous installation was made by the tar installer (version 4).
Keeping the tar4 installer database format.
You have a version of VMware Tools installed. Continuing this install will 
first uninstall the currently installed version. Do you wish to continue? 
(yes/no) [yes]
Error: Unable to find the binary installation directory (answer BINDIR)
in the installer database file "/etc/vmware-tools/locations".
Uninstall failed. Please correct the failure and re run the install.
Execution aborted.

解决方法:(亲测有效!!!)

root@MT:/home/dnt/vmware-tools-distrib# rm -rf /etc/vmware-tools
root@MT:/home/dnt/vmware-tools-distrib# rm -rf /tmp/vm*
root@MT:/home/dnt/vmware-tools-distrib# ./vmware*.pl

(3)配置基本工具 vim/samba/xshell

         !如果更新和下载有问题(比如updata/upgrade有错),可以看(4)

1)vim使用

https://www.cnblogs.com/mrcln/p/5720435.html

2)配置和安装samba

https://blog.csdn.net/carotong/article/details/52175994

3)xshell和Xftp的安装和配置

https://blog.csdn.net/m0_37482190/article/details/86246226

4)安装gcc-对C语言的编译器

安装g++-实现对C++语言的编译器(apt-get安装包管理工具 Ubuntu下安装)

apt-get install gcc
apt-get install g++

yum安装包管理工具-CentOS下安装


yum install gcc
yum install g++  

(4)更换源conf-使用清华源

地址:-教程:https://blog.csdn.net/weixin_40289171/article/details/88180549

源下载地址:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

apt-get update出错各种错

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'us.archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

改正用清华的源如下

W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial/InRelease  Failed to connect to mirrors.tuna.tsinghua.edu.cn port 443: No route to host
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-updates/InRelease  Failed to connect to mirrors.tuna.tsinghua.edu.cn port 443: No route to host
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-backports/InRelease  Failed to connect to mirrors.tuna.tsinghua.edu.cn port 443: No route to host
W: Failed to fetch https://mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/xenial-security/InRelease  Failed to connect to mirrors.tuna.tsinghua.edu.cn port 443: No route to host
W: Some index files failed to download. They have been ignored, or old ones used instead.

重启一下就好了,可以使用

不过这类问题的解决思路蛮多的;有将本地的DNS添加到/etc/resolvconf/resolv.conf中,然后更换源的-参考https://blog.csdn.net/qq_15437667/article/details/50719874

 

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

linux-Ubuntu安装后续工作小结-flag 的相关文章

随机推荐