GVKun编程网logo

ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖

1

在这篇文章中,我们将为您详细介绍ubuntu18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖的内容。此外,我们还会涉及一些关于apt-getupdate失败ubunt

在这篇文章中,我们将为您详细介绍ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖的内容。此外,我们还会涉及一些关于apt-get update 失败 ubuntu:Tempory failure resolving 'cn.archive.ubuntu.com ubuntu、install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd、Intel RealSense D435i Installation on Linux (Ubuntu 16.04 and Ubuntu 18.04)、Kurento 源码安装(Ubuntu 14.04 和 Ubuntu 16.04)的知识,以帮助您更全面地了解这个主题。

本文目录一览:

ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖

ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖

 

Netplan 是 Ubuntu 17.10 中引入的一种新的命令行网络配置实用程序,用于在 Ubuntu 系统中轻松管理和配置网络设置。 它允许您使用 YAML 格式的描述文件来抽像化定义网络接口的相关信息。

Netplan 可以使用 NetworkManager 或 Systemd-networkd 的网络守护程序来做为内核的接口。Netplan 的默认描述文件在 /etc/netplan/*.yaml 里,Netplan 描述文件采用了 YAML 语法。

在 Ubuntu 18.04 中如果再通过原来的 ifupdown 工具包继续在 /etc/network/interfaces 文件里配置管理网络接口是无效的。

所以本文主要利用Netplan配置静态ip并实现上网

 

1.route -n 查看网关地址(如果route -n不能用,按照提示按照命令包,可以使用动态ip,保证ubuntu18.04 虚拟机可以上网,然后安装必要的软件)

 

2.使用Netplan配置静态ip

vim /etc/netplan/01-network-manager-all.yaml

@H_301_57@

ens33  #是虚拟机的网卡名称

gateway4:192.168.90.2  # 虚拟机的网关,这里配置为route -n 查看到的网关

dhcp4 :no  #no代表不是用dhcp动态获取ip,yes代表使用dhcp动态获取ip

nameservers:      #是dns地址
addresses: [8.8.8.8,8.8.4.4]

search:[localdomain]  虚拟机所在的domain

设置完成后netplan apply保存配置,会立即生效,这时候虚拟机就可以上网了

 

3.解决resolv.conf配置文件被覆盖,首先安装resolvconf 软件

执行 sudo resolvconf -u  生成base head tail 三个文件,head提示不可编辑,所以修改base和tail两个文件

vim /etc/resolvconf/resolv.conf.d/base   #如果没有这个文件的手动创建

vim /etc/resolvconf/resolv.conf.d/base  #如果没有这个文件的手动创建

 然后reboot重启虚拟机发现/etc/resolv.conf多了几行配置 

 

 参考:https://blog.csdn.net/weixin_42776979/article/details/81450213

https://unix.stackexchange.com/questions/174349/what-overwrites-etc-resolv-conf-on-every-boot

https://www.hi-linux.com/posts/49513.html#%E4%BD%BF%E7%94%A8-networkd-%E5%90%8C%E6%97%B6%E9%85%8D%E7%BD%AE%E5%A4%9A%E5%BC%A0%E7%BD%91%E5%8D%A1

apt-get update 失败 ubuntu:Tempory failure resolving 'cn.archive.ubuntu.com ubuntu

apt-get update 失败 ubuntu:Tempory failure resolving 'cn.archive.ubuntu.com ubuntu

当运行apt-get update后出现如下错误时:
E: Some index files Failed to download,they have been ignored,or old ones used instead.

可以将目录下/var/lib/apt/lists/partial/所有的文件清掉,再次运行apt-get update即可!自带源在大陆不好。


出现以下错误:

ubuntu:Tempory failure resolving ''cn.archive.ubuntu.com ubuntu


修改dns:

1,重启生效:

sudovi/etc/resolvconf/resolv.conf.d/base(这个文件默认是空的)

在里面插入:
nameserver8.8.8.8
nameserver8.8.4.4

如果有多个DNS就一行一个

修改好保存,然后执行

sudoresolvconf-u

再看/etc/resolv.conf,最下面就多了2行:

cat/etc/resolv.conf
#Dynamicresolv.conf(5)fileforglibcresolver(3)generatedbyresolvconf(8)
#DONOTEDITTHISFILEBYHAND--YOURCHANGESWILLBEOVERWRITTEN
可以看到我们的设置已经加上了,然后再ping一个域名,当时就可以解析了,无需重启。


2,重启失效:

配置文件地址 /etc/resolv.conf

使用编辑器打开

改为如下内容:
search localdomain
nameserver 202.96.128.86 希望修改成的DNS
nameserver 202.96.128.166 备用DNS

重启网络:sudo /etc/init.d/networking restart。即可

install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd

install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd

Intel RealSense D435i Installation on Linux (Ubuntu 16.04 and Ubuntu 18.04)

Intel RealSense D435i Installation on Linux (Ubuntu 16.04 and Ubuntu 18.04)

1. Install 3rd-party dependencies

1.1 apt-get update

sudo apt-get update
  • 1

1.2 install libusb-1.0, libglfw, freeglut,

sudo apt-get install libusb-dev libusb-1.0-0-dev libglfw3 libglfw3-dev freeglut3 freeglut3-dev
  • 1

1.3 Install libpng12-dev

1.3.1 On Ubuntu 16.04, run the following command:

sudo apt-get install libpng12-dev

1.3.2 On Ubuntu 18.04, run the following command:

wget -q -O /tmp/libpng12.deb http://security.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1.1_amd64.deb

sudo dpkg -i /tmp/libpng12.deb

2. Debian Package Installation

2.1 Add Intel server to the list of repositories :

echo 'deb http://realsense-hw-public.s3.amazonaws.com/Debian/apt-repo xenial main' | sudo tee /etc/apt/sources.list.d/realsense-public.list
  • 1

It is recommended to backup /etc/apt/sources.list.d/realsense-public.list file in case of an upgrade.

2.2 Register the server’s public key :

sudo apt-key adv --keyserver keys.gnupg.net --recv-key 6F3EFCDE
sudo apt-key adv --keyserver keys.gnupg.net --recv-key C8B3A55A6F3EFCDE || sudo apt-key adv -- keyserver hkp://keyserver.ubuntu.com:80 --recv-key C8B3A55A6F3EFCDE
  • 1
  • 2

Refresh the list of repositories and packages available :

sudo apt-get update
  • 1

2.3 Install the librscalibrationtool package which includes Intel® RealSense™ Dynamic Calibrator:

sudo apt-get install librscalibrationtool
  • 1

说明:

librscalibrationtool适用设备为 Intel RealSense D400, D410, D415, D420, D430, D435.
安装后的使用说明见: /usr/share/doc/librscalibrationtool/README.md

2.4 Failure – (Optional) Developers shall also install librscalibrationapi package:

sudo apt-get install librscalibrationapi
  • 1

Problem:

librscalibrationapi : Depends: libpng12-dev but it is not installable
分析: 自Ubuntu18.04以后,libpng12-dev已经被弃用

3. Checking Package Installation

After the debian package install finishes, check for files installed. Under debian convention, the executables are installed under /usr/bin, library files under /usr/lib, and other files including sample code under /usr/share/doc.
For example, for Calibration Tool, librscalibrationtool, the files are installed as below:

sudo dpkg -L librscalibrationtool
  • 1

4. Video4Linux backend

  1. In order to run demos install:
sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
  • 1
  • 2

The above two lines will deploy librealsense2 udev rules, kernel drivers, runtime library and executable demos and tools.
Reconnect the Intel RealSense depth camera and run: realsense-viewer

  1. Developers shall install additional packages:
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg
  • 1
  • 2

With dev package installed, you can compile an application with librealsense using g++ -std=c++11 filename.cpp -lrealsense2 or an IDE of your choice.

  1. Verify that the kernel is updated :
modinfo uvcvideo | grep "version:" 
  • 1

should include realsense string

5. Test Installation

  1. Print the tool version to screen:
/usr/bin/Intel.Realsense.DynamicCalibrator -v
  • 1
  1. To print device information to screen, connect a camera device to the system and execute the following command:
/usr/bin/Intel.Realsense.DynamicCalibrator -list
  • 1

6. Perform Calibration for Camera

/usr/bin/Intel.Realsense.DynamicCalibrator
  • 1

* Problem (not fixed):

I can see the RGB, Depth and Gyro information without problems when I run realsense-vieweror subscribe to the realsense-ros topics. But when I run/usr/bin/Intel.Realsense.DynamicCalibrator
And click on Start Calibration I get the Failed to start Calibration Error as seen:

PS: relative issue discussion on github:
https://github.com/IntelRealSense/librealsense/issues/3990

Kurento 源码安装(Ubuntu 14.04 和 Ubuntu 16.04)

Kurento 源码安装(Ubuntu 14.04 和 Ubuntu 16.04)

1. 进入 Home 目录

cd ~

2. 添加镜像源 

 ubuntu 14.04

echo "deb http://ubuntu.kurento.org trusty-dev kms6" | sudo tee /etc/apt/sources.list.d/kurento-dev.list

ubuntu 16.04

echo "deb http://ubuntu.kurento.org xenial-dev kms6" | sudo tee /etc/apt/sources.list.d/kurento-dev.list

3. 下载 kurento.gpg.key

wget -O - http://ubuntu.kurento.org/kurento.gpg.key | sudo apt-key add -

4. 更新

sudo apt-get update

5. 安装 git (已安装跳过)

sudo apt-get install git

6. 安装 build-essential

sudo apt-get install build-essential

7. 下载 KMS

git clone https://github.com/Kurento/kurento-media-server.git

8. 进入 KMS 目录

cd kurento-media-server

9. 安装 KMS 依赖

sudo apt-get install $(cat debian/control | sed -e "s/$/\!\!/g" | tr -d ''\n'' | sed "s/\!\! / /g" | sed "s/\!\!/\n/g" | grep "Build-Depends" | sed "s/Build-Depends: //g" | sed "s/([^)]*)//g" | sed "s/, */ /g")

10. 新建 build 目录

mkdir -p build

11. 进入 build 目录

cd build

12. 生成 makefile

cmake ..

13. 编译 KMS

make -j4

14. git submodule

cd ..

git submodule update --recursive --init

15. deb 打包

dpkg-buildpackage -us -uc

16. 安装 KMS

sudo dpkg -i ../kurento_<version>_<arch>.deb

17. 启动 KMS

sudo service kurento-media-server start

18. 停止 KMS

sudo service kurento-media-server stop

 

我们今天的关于ubuntu 18.04配置静态ip,解决无法上网问题,解决resolv.conf配置文件被覆盖的分享就到这里,谢谢您的阅读,如果想了解更多关于apt-get update 失败 ubuntu:Tempory failure resolving 'cn.archive.ubuntu.com ubuntu、install nginx on ubuntu install ubuntu usb install ubuntu 14.04 ubuntu install jd、Intel RealSense D435i Installation on Linux (Ubuntu 16.04 and Ubuntu 18.04)、Kurento 源码安装(Ubuntu 14.04 和 Ubuntu 16.04)的相关信息,可以在本站进行搜索。

本文标签:

上一篇Ubuntu 启动zookeeper报错(ubuntu安装zookeeper)

下一篇Ubuntu 18.04 基于NVIDIA 2080安装TensorFlow-GPU 1.13.1(ubuntu18.04安装2080ti显卡驱动)