1

As a disclaimer I am barely familiar with Linux. I know enough to install my own server and the packages I needed. What I have is:

Distributor ID:   Ubuntu 
Description:      Ubuntu 18.04.5 LTS 
Release:          18.04
Codename:         bionic

Everytime I log in my welcome screen is:

Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-117-generic x86_64)
  • Documentation: https://help.ubuntu.com * Management:

https://landscape.canonical.com * Support:
https://ubuntu.com/advantage

System information as of Sat Sep 12 14:25:50 EDT 2020

System load: 0.35 Processes: 167 Usage of /: 24.5% of 228.23GB Users logged in: 0 Memory usage: 32% IP address for wls1: 192.168.0.12 Swap usage: 0%

  • Kubernetes 1.19 is out! Get it in one command with:

    sudo snap install microk8s --channel=1.19 --classic

    https://microk8s.io/ has docs and details.

  • Canonical Livepatch is enabled.

    • All available patches applied.

3 packages can be updated. 0 updates are security updates.

Running apt list --upgradeable returns:

base-files/bionic-updates 10.1ubuntu2.10 amd64 [upgradable from: 10.1ubuntu2.9] 
ubuntu-server/bionic-updates 1.417.5 amd64 [upgradable from: 1.417.4]

Other than three update shown above, I do get notified of other updates, and running sudo apt-get upgrade gets and installs all updates, except for the three shown below.

The two commands I use are sudo apt-get upgrade and sudo apt-get update

Can anyone tell me what is wrong, or more likely what it is that I am doing incorrectly?

Here are the results for sudo apt-get update and sudo apt-get update:

server:~$ sudo apt-get update  
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease 
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                 
Hit:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease               
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease           
 Reading package lists... Done
server:~$ sudo apt-get upgrade 
 Reading package lists... Done 
 Building dependency tree
 Reading state information... Done 
 Calculating upgrade... Done 
The following packages have been kept back:   
 base-files ubuntu-server 
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 
server:~$

1 Answers1

2

You want to first run:

sudo apt update
sudo apt dist-upgrade

and then if it doesn't update the packages, run the following command:

sudo apt install base-files ubuntu-server

If there is a problem, it will let you know what the problem is before installing. You will have the option to select Y or N.

If there is no problem, you can select Y and then press ENTER.

mchid
  • 43,546
  • 8
  • 97
  • 150
  • I have the first two lines in a bash file, so I can just type ./up.sh Is it safe to add that third line to the bash file? Or is that something that should never be run casually? Thank you – Daniel Kaplan Sep 29 '20 at 05:09
  • 1
    @DanielKaplan The first line had a typo. It's best to run these commands one by one. If it's a bash file, it should have a shebang on the first line #!/bin/bash￰ ￰ . I don't see anything inherently wrong with running the commands from a file except that you would need to run this file from a terminal so you would get prompts so that you can review the output before you enter Y to prevent breaking the system. So, I would recommend against it but I don't see anything actually wrong with it either. – mchid Sep 30 '20 at 02:47
  • 1
    @DanielKaplan The typo was sudo apt udpate when it should've said sudo apt update. Additionally, we generally don't usually put sudo in a script. Usually, you would run the script with sudo instead. – mchid Sep 30 '20 at 02:51
  • So I did as you said, just curious why it worked without the #!/bin/bash line before? – Daniel Kaplan Oct 01 '20 at 23:35
  • @DanielKaplan It works but I feel it's good practice to always specify the interpreter. The short answer is that when you run a script with no shebang from a Bash shell, the script will run as Bash by default. However, sometimes the system, or other shells, will default to /bin/sh (Dash) instead. Here, it wouldn't be a problem but sometimes Bash scripts won't run properly using /bin/sh. – mchid Oct 02 '20 at 02:13
  • 1
    @DanielKaplan This is a good question and if you ask this as a separate question I can go into more detail and others will be glad to explain as well. I assumed you were just messing around for practice and experience so I figured I'd recommend this as a pointer for writing scripts. – mchid Oct 02 '20 at 02:14