3

I need to change the MTU size in my newly installed ubuntu 18.04. This can be done with ifconfig. But i can not install ifconfig. Whenever i run command sudo apt install net-tools i get the following errors.

Err:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1ubuntu1
  Could not resolve 'archive.ubuntu.com'
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/net-tools/net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb  Could not resolve 'archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Then i tried sudo apt-get update and got the following

asif@asif-HP:~$ sudo apt-get update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease                                                                        
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                               
  Could not resolve 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease            
  Could not resolve 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Could not resolve 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu bionic-security InRelease
  Could not resolve 'archive.ubuntu.com'
Err:6 http://archive.canonical.com/ubuntu bionic InRelease
  Could not resolve 'archive.canonical.com'
Reading package lists... Done           
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.canonical.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.canonical.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not resolve 'archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Actually i am trying change MTU size to solve the problem Could not resolve 'archive.canonical.com' so im kind of in deadlock. What do i do now?

N.B: I changed ubuntu archive server but always same error occurs.

mahfuj asif
  • 133
  • 1
  • 8
  • 1
    Two thoughts. (a) log out of update, restart and log back into update. (b) try the netplan command https://ubuntu.com/blog/ubuntu-bionic-netplan MTU may be governed by your router. – John Oct 08 '20 at 16:45
  • @John Can you please elaborate (a)? I don't understand how to log out update. – mahfuj asif Oct 08 '20 at 16:53
  • I used (a) when my Ubuntu update app failed to work. I have not used (b) because I have no need to change MTU. Go to Live Patch, turn it off, restart and when you run Live Patch again, you will have to log in. – John Oct 08 '20 at 16:58
  • ifconfig is depreciated... You should use 'ip' as noted in the answer below. That said, you typically don't do this at the device level, but at the router level. What makes you believe you have a mtu size issue? – acejavelin Oct 08 '20 at 18:02

1 Answers1

10

You can use ip, which should already be installed. For example,

ip link set mtu 1200 eth0
roaima
  • 2,889
  • 1
  • 13
  • 27