Why I am asking this –
So I was just learning the ubuntu file system and other things related to bash, where I found that sources.list in /etc/apt is the key file for all the repositories.
I also found that every system and ubuntu release has its own sources.list, So here is where I was a little bit in an experimental mood!
I was on Ubuntu 18.04 LTS(64 bit), While just browsing and seeing different sources.list files. In which I found something interesting. So, as of now, there are a lot of new ubuntu versions that had just arrived. I was willing to upgrade mine too to 21.04 ( because of gnome 40)
So I found that I can upgrade ubuntu by the sudo do-release-upgrade command but that command Will goes to the next release, instead of the latest release. So that was Very time consuming and internet consuming (I don’t have like 20GB of the internet)
The only way I found was to Reinstall from ISO, But I don’t want to refresh all data or packages as they also take a little time to install.
So what I did is a little stupid, I changed the contents of my sources.list to –
#deb cdrom:[Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420)]/ hirsute main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute universe
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu hirsute partner
# deb-src http://archive.canonical.com/ubuntu hirsute partner
deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
# deb-src http://security.ubuntu.com/ubuntu hirsute-security main restricted
deb http://security.ubuntu.com/ubuntu hirsute-security universe
# deb-src http://security.ubuntu.com/ubuntu hirsute-security universe
deb http://security.ubuntu.com/ubuntu hirsute-security multiverse
# deb-src http://security.ubuntu.com/ubuntu hirsute-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
Then I ran
sudo apt update && sudo apt full-upgrade && sudo apt dist-upgrade
Then My system and everything was changed to 21.04
So that was a little bit of big brain probably?
What I want to ask
Will this harm my system? Are there some benefits? What can go wrong?
-
All my packages were upgraded and new packages were installed.
-
My system is up to date
-
I just want to know if this could be harmful or could do something bad
-
To be honest, it took only 1804 Mb to upgrade so it is much lighter.
-
Till now (used for two hours) there is no issue.
>Solution :
Congratulations, you have discovered the original Debian method of migrating between Debian releases: editing sources and then running dist-upgrade.
The Ubuntu do-release-upgrade method uses dist-upgrade under the hood, but also includes some additional features that most users can appreciate:
- Standardized new sources.list, and automated editing of that file.
- Disabling of PPAs to prevent broken upgrades.
- Autoremove after the new package installs.
- Scripted migrations when required.
- Snap refresh
- Common upgrade paths are repeatedly tested and debugged by volunteers during pre-release
Could this be harmful or could do something bad?
Sure. If you use an unwise set of new sources, you can easily break your system.
Apt is a great and elegant tool, but it’s not smart. It will try to do exactly what you order it to do, regardless of how foolish that order might be.
It’s quite possible to use dist-upgrade to ride an untested path between releases — like from 20.04 to 21.10. Apt will do it. But it’s not tested. Maybe it will work well; maybe it won’t. You might encounter unexpected problems that nobody else can reproduce. We didn’t test it (that’s what "untested" means). YOU are testing it.
Generally, debugging severe failures caused by untested dist-upgrades is a waste of everybody’s time — certain paths are tested and supported; off those marked paths you are on your own. It’s faster and easier to simply re-install the desired release of Ubuntu instead. If you pay attention during the install process, you can overwrite Ubuntu while preserving your data.
If a group of dist-upgrade enthusiasts want to get together and debug additional upgrade paths and provide support, they are welcome to. The current system is determined by the number of volunteer testers and developer hours available.