Linux ubuntu обновление пакетов

How to install updates via command line?

I tried apt-get update then apt-get upgrade but each time I log in I still see the message about updates. How do I install them?

9 Answers 9

sudo apt update # Fetches the list of available updates sudo apt upgrade # Installs some updates; does not remove packages sudo apt full-upgrade # Installs updates; may also remove some packages, if needed sudo apt autoremove # Removes any old packages that are no longer needed 

Documentation about each apt option can be found in the the manpages for apt. These are also available by running man apt in your terminal.

Use of both upgrade and full-upgrade together is usually not needed, but it may help in some cases: see Debian documentation about Upgrades from Debian 9.

Just pointing out that apt full-upgrade performs the same function as apt-get dist-upgrade , if, like me, you’re comparing the commands with other answers in this question.

@hellboy It will tell you if a reboot is required. Also it’s unclear whether you’re asking if rebooting command line is required — the answer is No. It doesn’t matter how you restart the machine.

Execute all the commands by typing sudo once:

sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get full-upgrade -y; apt-get autoremove -y; apt-get autoclean -y' 

or even shorter in a for loop (thanks @dessert!):

sudo bash -c 'for i in update upgrade auto; do apt-get $i -y; done' 

This is normal behavior.

The message you see on login has been appended to the server status ‘Message-Of-The-Day’, which is only updated each calendar day (or on server boot / startup). Have a look at the contents, using

Читайте также:  Linux работает только skype

Still seeing the same updates available, after running

sudo apt-get update && sudo apt-get upgrade 

is to be expected. If you then re-run this command you will only be prompted for any further updates if even further (newer) updates have been released.

I’m noticing that any file changes in the whole system doesn’t show until the next calendar day, is there a way for like «refresh» to start seeing changes right away?

Do you mean updates for the content of Message-Of-The-Day, or not getting what you want after running sudo apt-get update && sudo apt-get upgrade ?

This is no longer true on 16.04. After «apt-get dist-upgrade» and a reboot I see «0 packages can be upgraded».

Once your log into your server, run the command below.

It should do the trick. Maybe you just need to restart your server.

Thank you for your answer but I did try sudo apt-get upgrade. Restarting the server is out of the question because I have sites on it.

if you installed an update that directly affects the kernel or it’s a driver update or it’s a critical security update, you need to restart the server.

In my case, I had an incorrect or not accessible URL in /etc/apt/sources.list. After removing this URL, I was able to update all packages successfully.

sudo vi /etc/apt/sources.list sudo apt-get update && sudo apt-get upgrade 

My (really late, I like necromancer badges 🙂 ) solution:

sudo apt-get install wajig 

You may also need to do this —

If you run apt-get update again after apt-get upgrade has been concluded, those messages at ssh login should go away.

Читайте также:  Какие линукс сервера есть

this script is handy to automate updates including removing unneeded packages and performing a reboot only if the OS wants one

remote_user=usernamehere remote_host=example.com ssh -A -n -o StrictHostKeyChecking=no $@$ && \ sudo apt-get update && \ sudo apt-get -f install -y && \ sudo apt-get -o Dpkg::Options::="--force-confnew" -yy dist-upgrade -y && \ sudo apt-get autoremove -y && \ [ -f /var/run/reboot-required ] && \ echo "sudo reboot now" && \ sudo reboot now 

to run on your local box just leave off that first line doing the ssh

here is an alias I save in ~/.bashrc

alias doit='echo; kill $( ps -eafww|grep update-manager|grep -v grep | grep update-manager | tr -s " " |cut -d" " -f2 ) > /dev/null 2>&1; echo "sudo apt-get update && sudo apt-get dist-upgrade && [ -f /var/run/reboot-required ] && echo && echo reboot required && echo";echo;sudo apt-get update && sudo apt-get dist-upgrade && [ -f /var/run/reboot-required ] && echo && echo reboot required && echo ' 

then on terminal I just issue doit

Источник

Обновление Ubuntu

Обновление Ubuntu Linux

Периодически появляются новые версии программного обеспечения, утилит, новые версии ядра и других компонентов системы. Ubuntu позволяет централизованно (автоматически) обновлять пакеты, когда новые версии пакетов появляются в репозиториях системы.

В данной статье рассматривается процесс обновления пакетов в Ubuntu, но не обновление самого дистрибутива до новой версии. Смотрите также наше руководство по обновлению Ubuntu до новой версии.

Ubuntu можно обновить, используя графическую утилиту Менеджер обновлений или использовать командную строку. Рассмотрим оба способа.

Обновление пакетов в Ubuntu, используя графическую утилиту

Запустим утилиту Менеджер обновлений (в системе она называется «Обновление приложений» или «Software Updater»). Для этого откройте лаунчер, нажав сочетание клавиш Super+A . В лаунчере найдите иконку Обновление. или же введите в строку поиска «update»

Читайте также:  Linux terminal are you root

Запуск Менеджера обновлений Ubuntu

Поиск Менеджера обновлений в Лаунчере Ubuntu

Утилита выполнит проверку обновлений. Это может занять несколько секунд.

Проверка обновлений Ubuntu

Появится окно Менеджера обновлений. В нем представлен список компонентов, которые готовы для обновления. По умолчанию все компоненты помечены галочками. Можно снять галочку напротив какого-либо компонента, чтобы не обновлять его. Для запуска процесса обновления нажмите кнопку Установить сейчас .

Список обновлений Ubuntu

Появится запрос на ввод пароля пользователя. Введите пароль и нажмите кнопку Подтвердить .

Ввод пароля для обновления Ubuntu

Начнется процесс обновления Ubuntu.

Процесс обновления Ubuntu

Можно нажать Подробно , чтобы развернуть информационное окно, в котором отображается текущий процесс обновления.

Процесс обновления Ubuntu

Процесс обновления Ubuntu

В некоторых случаях, после завершения обновления, требуется перезагрузка компьютера. Для выполнения перезагрузки нажмите кнопку Перезагрузить сейчас или перезагрузите компьютер позже.

Перезагрузка компьютера

Обновление Ubuntu через командую строку

Рассмотрим, как обновить Ubuntu Linux через командную строку (через терминал). Для обновления пакетов в Ubuntu используется утилита apt.

Откройте терминал. Это можно сделать, нажав сочетание клавиш Ctrl+Alt+T

Выполните в терминале следующую команду:

sudo apt update && sudo apt upgrade -y

Появится запрос на ввод вашего пароля пользователя. Введите пароль и нажмите Enter . При вводе пароля на экране не выводится никакой индикации ввода.

Начнется процесс обновления Ubuntu.

Обновление Ubuntu из командной строки

Когда обновление завершится, в терминале снова появится приглашение ко вводу новой команды.

Источник

Оцените статью
Adblock
detector