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:~$
kortewegdevries
  • 400
  • 2
  • 12
Daniel Kaplan
  • 171
  • 11
  • Please edit your question to show us the *complete output* of of `sudo apt-get update` and of `sudo apt-get upgrade`. – user535733 Sep 12 '20 at 19:07
  • 3
    Does `sudo apt dist-upgrade` update them? Don't worry, this won't upgrade you to 20.04 (Focal) despite the name. – Brian Turek Sep 12 '20 at 20:21
  • @user535733 Added the output to the bottom of OP – Daniel Kaplan Sep 12 '20 at 20:52
  • 1
    https://askubuntu.com/questions/601/ In general you can force them but they have a high chance of breaking the system. – kortewegdevries Sep 13 '20 at 02:42
  • 1
    Does this answer your question? [Why use apt-get upgrade instead of apt-get dist-upgrade?](https://askubuntu.com/questions/194651/why-use-apt-get-upgrade-instead-of-apt-get-dist-upgrade) – mchid Sep 13 '20 at 08:20

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
  • 42,315
  • 7
  • 94
  • 147
  • 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](https://askubuntu.com/questions/537669/script-doesnt-work-when-it-is-run-using-bin-sh) 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