Очистка манджаро линукс через терминал

rumansaleem / clean-up-arch-linux.md

Edit:
About home .cache normally there are no problems to delete this, but a good practice would not delete only the old caches.

# find ~/.cache/ -type f -atime +30 -delete

About home .config: If you use VSCode don’t do it without careful.

Another thing I find now useful is to remove the cache of all uninstalled packages using:

r : Remove packages
u : specifies uninstalled packages,
k0 : «keep» 0 versions

Is this really for removing unused packages sudo pacman -Qtdq ? Like, There is linux-rt-manjaro
in my list of unused packages which is kernel module

@cybersexurity69 linux-rt-manjaro sounds more like the real time manjaro linux kernel and not as a kernel module (https://wiki.archlinux.org/title/Unofficial_user_repositories#realtime).

What -Qtdq will do according to the man page is ( -Q stands for querying the package database):

 -d, --deps Restrict or filter output to packages installed as dependencies. This option can be combined with -t for listing real orphans - packages that were installed as dependencies but are no longer required by any installed package. -t, --unrequired Restrict or filter output to print only packages neither required nor optionally required by any currently installed package. Specify this option twice to include packages which are optionally, but not directly, required by another package. -q, --quiet Show less information for certain query operations. This is useful when pacman’s output is processed in a script. Search will only show package names and not version, group, and description information; owns will only show package names instead of "file is owned by pkg" messages; group will only show package names and omit group names; list will only show files and omit package names; check will only show pairs of package names and missing files; a bare query will only show package names rather than names and versions. 

Which means that you have not directly installed this package, but it was installed as a dependency which was later removed. So if you are sure you want to keep this package (since you use it), you can just reinstall the package: sudo pacman -S linux-rt-manjaro and it should not be shown in the list of packages which get removed.

Not sure if Manjaro in general handles things differently, such that any of the above information is not valid in that case. It should be valid for Arch itself.

Источник

System Maintenance

This article contains tips and best practices for keeping your system in optimal condition.

The hidden .cache folder in your home directory is used by many parts of your system. This includes downloads, thumbnails, desktop resources, and more.
While it is generally safe to remove everything in your ~/.cache folder, it may be more advisable to inspect its contents and selectively remove items instead.

Читайте также:  Sort by type in linux

To generate a sorted list of contents and sizes:

To automatically purge all .cache files that have not been accessed in 100 days:

Log files & the systemd journal do the same thing in different ways. They keep a record of everything that happens on your system.
For more information and tips on automated maintenance please see the dedicated page Limit the size of .log files & the journal

Systemd Journal

The journal keeps logs of system activity. This can be important for troubleshooting, but sometimes the log size can grow rather large.

To report the current size:

To remove all but the most recent entries by size or time:

To set a maximum size for the journal you can uncomment and edit the following line in /etc/systemd/journald.conf :

System logs at /var/log/*

While most things use the newer systemd journal (journalctl), there is still some software that uses the older /var/log/ directory.
For more information and some tips on maintaining it, please see the relevant section of this page.

Keeping your System Updated

On a rolling release distribution it is essential to keep your system fully updated. Manjaro provides a few ways to keep your system updated.

  • You can use the GUI tool Pamac directly or via the update notifier
  • You can use the GUI tool Octopi directly or via the update notifier
  • You can use the Pamac CLI
  • You can use the Pacman CLI

Avoiding Partial Updates

It is of critical importance to ensure you don’t end up in a state where your system is partially upgraded.
It is not uncommon for systems in partially updated state to end up in a critical failure state.
Here are some rules to help you avoid this undesired situation.

  • Don’t update the local package database (metadata) without also updating the system
  • You may install a single package using pacman -S but this may yield a 404 error if your metadata is not current
  • Don’t use pacman -Sy , pacman -Syy , pacman -Syuw as this will update the metadata but not sync the packages to your system
  • Always sync metadata and packages together pacman -Syu
  • Don’t add packages to pacman’s or pamac’s ignore list
  • If you just want to check to see what updates are available use the command checkupdates . This provides a safe way to check for upgrades to installed packages without pulling metadata at the same time
  • When switching branches or switching mirrors always sync your systems metadata and packages using pamac update or pacman -Syu
  • If you get 404 in connection with a branch switch you may force sync metadata by doubling the y argument pacman -Syyu

Removing Orphans

As packages are added, built and removed it is not uncommon to have unneeded dependencies, also called orphans, building up over time. While orphans are not harmful, they take up space on the disk and consume network bandwidth as they are continually updated. Luckily, there are a couple of easy ways to view and remove orphans.

Читайте также:  Linux no such file or directory but file is there

Package Cache

By default both pamac and pacman keep a cache of downloaded packages on the system. This can be helpful if you need to copy or downgrade a package.
But the cache can grow to include dozens of each package resulting in gigabytes of space.

Pacnew and Pacsave files

A .pacnew file may be created during a package upgrade to avoid overwriting a file which already exists. A .pacsave file may be created during a package removal, or by a package installation of a package that was removed. These files require manual intervention from the user and it is good practice to handle them regularly. The program pacdiff can help manage this process. For example, here is what it looks like when the /etc/default/grub grub file has changed:

sudo DIFFPROG=diff pacdiff|result= ==> pacnew file found for /etc/default/grub :: (V)iew, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/s/r/o/q]
  • V shows the differences between the two files
  • S skips to the next change and allows you to deal with it later or manually
  • R keeps your existing file and delete the new file
  • O overwrites the existing file with the new file
  • Q quits the process without making further changes

Unfortunately, there is no perfect road map for how to deal with these files. If you keep the original config file, and the syntax has changed, the program may stop working or fail to use the existing config. If you remove the original file and use the new file without any changes, all your configuration settings can be overwritten. Sometimes, you need to combine pieces from the new and old files to make everything to work. In these situations it is better to integrate the files manually.

For more detailed information, please see review the Arch Wiki linked below.

Msm-time-date.png

Keeping the system time accurate may seem unimportant but certain network related services may malfunction if the time is out of sync.

The easiest way to ensure the time is being properly synchronized is the GUI tool included in Manjaro Settings Manager which is pictured to the left. Simply check the box next to «Set time and date automatically».

An alternative is to use systemd via the systemd-timesyncd service. This can be easily enabled with one of these commands:

Источник

Базовые команды дистрибутива Manjaro

Добрый день всем, кто оказался на данном сайте. Давайте сегодня разберем базовые команды такого дистрибутива как Manjaro. Но, сначала небольшое отступление. Сам дистрибутив Manjaro основывается на пакетной базе Arch Linux. Использует пакетный менеджер Pacman. Так же полностью совместим с Arch Linux. А у Arch есть замечательная кладовая под названием Arch Wiki, где можно найти ответы практически на все вопросы. Стоит отметить, что эти команды так же подходят и для остальных Arch производных. Например таких как Arco Linux, Chakra ну и конечно же Manjaro. И так, вернемся к командам. Что бы обновить систему, нужно в терминале набрать следующую команду:

Обновление системы

Что бы выполнить обновление вашей системы, достаточно выполнить несложную команду в терминале:

Manjaro pacman 1

Что бы синхронизировать вашу систему с репозиториями, нужно ввести команду:

Manjaro pacman 2

Так же можно одновременно синхронизировать и следом обновить вашу систему при помощи следующей команды:

Читайте также:  Executing program in linux

Manjaro pacman 3

Поиск пакетов

Так же в терминале при помощи пакетного менеджера можно осуществлять поиск нужных вам программ. Для этого введите команду:

pacman -Ss и название программы или пакета.

Например нам нужен офис, для этого вводим команду:

Manjaro pacman 4

Можно так же искать те пакеты, которые уже установлены в вашей системе. Для этого выполните команду:

pacman -Qs и название пакета

Manjaro pacman 5

Что бы узнать всю имеющуюся информацию о пакете, достаточно выполнить команду:

pacman -Qii и название пакета

Manjaro pacman 6

Что бы узнать о всех установленных пакетах в вашей системе, выполните команду:

Manjaro pacman 7

Иногда при удалении какого то пакета, например, вы установили тот же Libreoffice и затем удалили его, в вашей системе могут остаться зависимости. Что бы их найти их, введите команду:

Manjaro pacman 8

Для удаления всех зависимостей, можно выполнить команду:

sudo pacman -Rs $(pacman -Qdtq)

Manjaro pacman 9

Установка пакетов

Для установки пакетов из репозиториев, нужно ввести следующую команду:

sudo pacman -S и название пакета

Приведу пример все на том же Libreoffice. Для его установки потребуется ввести команду:

sudo pacman -S libreoffice

Manjaro pacman 10

Что бы скопировать нужные вам пакеты, но не устанавливать их в систему, существует команда:

sudo pacman -Sw и название пакета

Manjaro pacman 11

Удаление пакетов

Теперь давайте разберем некоторые спсобы удаления установленых пакетов. Для того что бы удалить ненужный пакет, введите команду:

sudo pacman -R и название пакета
sudo pacman -R libreoffice

Manjaro pacman 12

Что бы удалить не только пакет, но и его зависимости, введите комануд:

sudo pacman -Rs и название пакета

Manjaro pacman 13

А вот что бы удалить пакет, в том числе и конфигурационные файлы от него, введите команду:

sudo pacman -Rns и название пакета

Manjaro pacman 14

Очистка кэша

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

Manjaro pacman 15

Для полной очистки, выполните следующую команду:

Manjaro pacman 16

Это были самые базовые команды, которые нужны в повседневной работе с Manjaro. Для более глубокого изучения пакетного менеджера pacman, можно воспользоваться справочной командой:

А на этом сегодня все. Надеюсь, данная статья будет вам полезна.

Manjaro pacman 17 Manjaro pacman 18

Вам также может понравиться

Разное оформления окон в XFCE 4.16

Разное оформления окон в XFCE 4.16

Безопасность Linux - Пароли и Шифрование

Безопасность Linux – Пароли и Шифрование

Установка LetsEncrypt на web сервер

Установка LetsEncrypt на web сервер

7 комментариев к « Базовые команды дистрибутива Manjaro »

pacman это пакетный менеджер в Arch и всех дистрах от него типа manjaro. Это самый быстрый пакетный менеджер.

$ sudo pacman -Syyu
:: Обновление баз данных пакетов…
core 170,9 KiB 3,09 MiB/s 00:00 [######################] 100%
extra 1900,4 KiB 2,60 MiB/s 00:01 [######################] 100%
community 6,8 MiB 1279 KiB/s 00:05 [######################] 100%
multilib 175,2 KiB 1460 KiB/s 00:00 [######################] 100%
ошибка: не удалось получить файл ‘custom.db’ из диск : Couldn’t open file /home/custompkgs/custom.db
ошибка: не удалось обновить custom (ошибка в библиотеке загрузки)
archlinuxfr 9,8 KiB 3,18 MiB/s 00:00 [######################] 100%
ошибка: failed to synchronize all databases что делать для исправления ошибки?

Добавить комментарий Отменить ответ

Использование материалов разрешено только при наличии активной ссылки на источник.

Мы используем cookie-файлы для наилучшего представления нашего сайта. Продолжая использовать этот сайт, вы соглашаетесь с использованием cookie-файлов.

Источник

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