- Debian linux update all
- Предварительная подготовка
- Поехали!
- С помощью Synaptic
- С помощью Aptitude
- С помощью Apt-get
- How to Update Debian from Terminal
- Keeping Debian up-to-date
- Updating Debian
- Checking for updates
- Upgrading packages
- Updating APT cache and upgrading packages simultaneously
- Automating Debian update
- Final thoughts
- About the author
- Sidratul Muntaha
- How to Update Debian Linux
- Updating Debian explained
- sudo apt update
- sudo apt upgrade
- sudo apt update && sudo apt upgrade -y
Debian linux update all
Обновление дистрибутива с версии на версию ответственный шаг. Это принесёт много приятных изменений в повседневную работу. Но так же может вызвать ряд проблем вызванных переходом на новые версии программ и библиотек, изменение настроек программ. Проблемы могут возникать из-за изменения расположения конфигурационных файлов. Исключения из дистрибутива одних программ и включения других.
На самом деле разработчики проделывают большую работу для максимально безболезненного перехода с версии на версию дистрибутива. И всё на самом деле не так уж страшно или сложно. Автор лично переводил свою систему с sarge на lenny и, в последствии на squeeze.
Но в тоже время, если вы планируете обновление системы, стоит задуматься не просто об обновлении, а о полной переустановки системы. Это позволит использовать различные нововведения добавленные в новую версию Debian, на все сто. Например при обновлении с «lenny» на «squeeze» всех преимуществ нового способа загрузки и файловой системы ext4, вы не получите.
Предварительная подготовка
Безусловно первым вашим действием должно стать резервное архивирование ваших данных и файлов настроек. Даже если /home вынесен на отдельный раздел, расслабляться не стоит.
Поехали!
Правим sources.list:
Находим в строках описывающих репозитории из которых устанавливаются пакеты и меняем имя старого стабильного дистрибутива на имя стабильного. Например меняем sarge на lenny. Если хотим перейти на тестируемый или нестабильный, то вписываем соответствующие имена дистрибутивов. Сохраняем.
Также вместо имён дистрибутивов можно использовать их «состояния» — stable, testing, unstable.
Все три способа дают один и тот же результат, поэтому используйте тот, который считаете наиболее удобным.
Разработчики рекомендуют для управления пакетами использовать aptitude.
С помощью Synaptic
С помощью Aptitude
# aptitude install aptitude
С помощью Apt-get
How to Update Debian from Terminal
Debian is a Linux distro composed of free and open-source software (FOSS). It’s developed by the Debian Project, a community-driven project. It’s one of the oldest operating systems based on the Linux kernel. Debian is at the core of many popular operating systems like Ubuntu, Linux Mint, MX Linux, Deepin, and much more.
This guide will demonstrate how to keep Debian’s packages up-to-date from the terminal.
Keeping Debian up-to-date
A Linux operating system is a combination of numerous packages connected with each other in a very complex network. All these packages deliver all the necessary files and binaries that make the operating system.
These packages are generally updated regularly. It may be bug fixes, security patches, or feature improvements. It’s important to keep all the packages up-to-date.
Debian uses APT to manage packages. The package updates are directly available from the official Debian package repos. APT can also work with third-party repos. However, it’s up to you to determine whether the third-party repo is trustworthy and updating their packages.
Updating Debian
We can use APT to perform a check whether any package update is available. If available, we can update the target packages.
It’s also possible to configure automatic updates on Debian using unattended upgrades.
Updating packages require root permission. To perform the actions demonstrated, you need to have access to the root user. Alternatively, you need a non-root user who can execute the sudo command. Learn more on managing sudo permission for users on Debian.
Checking for updates
Open up the terminal and run the following command.
As the output suggests, APT will check for updates on each of the repos configured and update its package catalog. If any update is available, APT will notify you that updates are available.
To check the list of available package updates, run the following APT command.
Upgrading packages
The APT cache is updated with the latest available package catalog. We now also know what package updates are available. Time to install them.
To upgrade a target package, run the following command. Here, APT will only upgrade the target package. If the package weren’t installed already, it wouldn’t be installed.
To upgrade all the packages at once, run the following command instead. Here, APT will download and upgrade all the available package updates.
Before downloading and upgrading packages, APT will ask for confirmation to perform the action. If you don’t want APT to ask for confirmation, add the flag “-y”.
Updating APT cache and upgrading packages simultaneously
Instead of performing these steps simultaneously, we can combine them both in a single command. If you’re running the bash shell, then the following command will check for package updates and upgrade packages simultaneously.
Here, the symbol “&&” ties both the update and upgrade commands together. It’s basically a logical AND operator. There are numerous bash operators and symbols that carry special functions and meanings. Check out this big list of bash operators and their implementations.
Automating Debian update
So far, we’ve updated Debian packages manually. However, manual updating is inconvenient in the long run, not to mention enterprise/professional environment where you may need to manage multiple remote servers at the same time. Updating all of them manually is a tedious process. It’s possible to use Ansible to manually update remote Debian/Ubuntu systems at once but running it manually regularly is not practical.
This is where we can use unattended upgrades. It’s a tool that will automatically check and download package updates whenever available. It requires a little bit of configuration.
First, we need to install the package. Open a terminal, update the APT cache, and install the package.
Next, we need to tweak the APT configuration file for unattended-upgrades. Open it in a text editor.
Uncomment the following lines from the configuration file. It will tell the tool to automate the update process.
The configuration file is updated. Run the following dpkg configuration command to put it into action.
After successful execution, a dialog box will appear on the terminal. Select “Yes”.
The tool will now automatically download and install updates on Debian. However, we need to make sure that it’s working as intended. Check the service status.
It’s showing that the service status is Active (In Progress), meaning it’s working perfectly. Check out this guide on unattended upgrades for full in-depth info and demonstrations.
Final thoughts
Updating Debian is a very simple task. Debian is a well-maintained project with up-to-date packages directly available from its package servers. All you need is to tell APT to do the job.
Debian follows a long-term release cycle. So, you don’t have to upgrade your distro often. If you’re using an older Debian, then instead of updating the packages, it’s recommended to upgrade the distro. At the time of writing this guide, Debian 10 is the latest stable release. Check out this guide on how to upgrade from Debian 9 to Debian 10.
About the author
Sidratul Muntaha
Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.
How to Update Debian Linux
Learn to update Debian Linux system in one single command. Yes, it’s that easy and straightforward.
If you want to update Debian Linux system, here’s what you need to do.
Update the local package database cache with:
And then update all the installed software, kernel and other system components at once using:
Press Y key when you are asked to confirm.
Combine the above two commands
Alternatively, you can combine the above two commands with the help && operator. You can also provide the conformation automatically using -y :
sudo apt update && sudo apt upgrade -y
Updating Debian explained
Let me explain what you are doing here to update Debian.
apt or the older apt-get are command line based package manager for Debian Linux.
With the apt command, you can install, remove or manage software packages. You can use it to update all the software on your system at once. This includes Linux kernel updates provided by Debian.
sudo apt update
It may seem like this command will update the system but that’s not true.
The apt package manager works on a local database of metadata (name, version, description and repository information) about software packages.
When you run the apt update command, it updates this local cache from the Debian repository.
Thanks to this your system can see if an installed package has new version available. In fact, you can see the packages that can be upgraded using:
sudo apt upgrade
This is the command that actually updates your Debian system.
It is important to run the apt update command before so that your system is aware about the availability of the new version of packages.
With that information, the apt upgrade command fetches the new version of the packages from the Debian repositories and installs them.
Thus, all the software component of your Debian systems are upgraded to the newer version.
sudo apt update && sudo apt upgrade -y
The && option is one of the ways to run multiple Linux commands at once.
With && , the second command apt upgrade -y , runs automatically after the first command finishes successfully.
Why is the -y option used here? Because the apt upgrade needs your conformation before downloading and updating the system. You can save some time by supplying it with yes thanks to the -y .
This way, you don’t need a manual intervention while updating Debian. Everything is done in a single command even if it is a combination of multiple commands.
I hope you liked this Debian beginner tip. Do become a member for more Linux tips and tutorials.