Score:2

How can you verify the /etc/apt/sources.list is current?

cn flag

I am using Ubuntu 20.04.

I follow the apt-update process but is there a way to verify the sources.list file is current?

And does the update process use any auto-notification files on my server, like the one that notifies you of updates when you log in?

Score:6
cn flag

Your sources.list file should remain constant through the life of a release.

As an example, let's look at a very basic sources.list file.

deb http://archive.ubuntu.com/ubuntu/ focal main universe
deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe
deb http://security.ubuntu.com/ubuntu focal-security main universe

You can see in this example that nothing changes during the life of the focal release. Someday, when this system release-upgrades from 20.04 to 22.04 (focal to jammy), the do-release-upgrade script will change the name of the release...and nothing else.

The file is not required to remain static. You can add/delete pockets of the Ubuntu repositories (like multiverse) at any time. You can add/delete other non-Ubuntu sources...though best practice is to add non-Ubuntu sources to sources.list.d/

  • Pro Tip: After you make ANY change to ANY apt source, remember to run sudo apt update so your local database of available packages is accurate.

A stock install of Ubuntu routinely and automatically downloads and installs security upgrades via both deb and snap channels without notifying you (why would it? It's routine).

Those upgrades are logged, so you can satisfy your curiosity:

  • apt: /var/log/apt/history.log
  • snap: journalctl -u snapd

The login notification text ("like the one that notifies you of updates when you log in") is part of MOTD, and is triggered by each run of apt update. However, if the last run of apt update was 12 hours ago, then that information might be stale; use it as a prompt or reminder, not an accurate-to-the-minute count.

Of course, there's not much to prompt you for: Security upgrades are already handled automatically for you. Non-security upgrades are mostly bugfixes, and you can wait to install those anytime you wish...or never. If you are not affected by the bug, you won't see much difference. If you ARE affected by a specific bug, you should subscribe to the bug report; then you will be notified when the bugfix is ready for you to apt upgrade.

Manuel Jordan avatar
kz flag
About _though best practice is to add non-Ubuntu sources to sources.list.d/_, agree, but if an upgrade happens, let says from 20.04 to 22.04, therefore those `.list` files within the `sources.list.d` directory must be updated manually right? it about from _focal_ to _jammy_ - Am I correct?. I confirmed that the `do-release-upgrade` command updates the `sources.list` file as you indicated
user535733 avatar
cn flag
@ManuelJordan best practice is to uninstall all non-Ubuntu software and sources, returning your system to as close to stock condition as possible, before a release-upgrade. After the release-upgrade, re-adding the sources and re-installing the software would --of course-- use the new release name. Folks who add a lot of non-Ubuntu sources to get newer software should consider using the standard (6-month) release of Ubuntu instead to avoid all that hassle. Or snaps. Snaps are good for this too.
Manuel Jordan avatar
kz flag
Thanks for the quick reply. I see. I have this situation for some tools installed such as MySQL and Docker.
user535733 avatar
cn flag
For complex tools like SQL databases and containers, best practice is to be fully prepared for a complete reinstall before beginning a release-upgrade. Notes and instructions, backups, LiveUSB. No matter what could possibly go wrong, you have the full recovery toolbox at your fingertips before starting. Turn that disaster into a mere minor annoyance. Fortune favors the prepared.
Manuel Jordan avatar
kz flag
Thanks for the feedback I assumed that `do-release-upgrade` through with an internal script or something else would scan the `sources.list.d` directory and updates each `.list` file too. The other assumption was that is mandatory by the user/developer/admin do a manual update.
user535733 avatar
cn flag
Since Ubuntu has mysql (and mariadb) and docker already in the tested and supported Ubuntu repositories, we generally suggest using those versions instead of going upstream (non-Ubuntu) to get versions that we have not tested and integrated into Ubuntu. It means you are volunteering to do that testing and integration. Again, folks who want the latest generally should not be using LTS. When you go outside the Ubuntu repositories, you are responsible for administering your own sources. Alternately, many flavors of SQL and Docker are available as snaps, some directly from upstream.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.