<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal</title>
<meta name="description" content="Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal - Savefile - Tin Tức -...">
<meta name="author" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :.">
<meta name="copyright" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :. [admin@nguoicodonvn2008.info]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;cach-sua-loi-apt-get-command-not-found-trong-linux-terminal-7973.html">
<meta property="og:site_name" content=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.">
<meta property="og:url" content="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/cach-sua-loi-apt-get-command-not-found-trong-linux-terminal-7973.html">
<link rel="shortcut icon" href="https://nguoicodonvn2008.info/favicon.ico">
<link rel="canonical" href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/cach-sua-loi-apt-get-command-not-found-trong-linux-terminal-7973.html">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/karaoke-dual/" title="Tin Tức - Karaoke Dual" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nhac-tre/" title="Tin Tức - Nhạc trẻ" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tru-tinh/" title="Tin Tức - Trữ tình" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nuoc-ngoai/" title="Tin Tức - Nước ngoài" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/remix/" title="Tin Tức - Remix" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tam-su-tinh-yeu/" title="Tin Tức - Tâm sự tình yêu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tho-suu-tam/" title="Tin Tức - Thơ sưu tầm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/cuoc-song/" title="Tin Tức - Cuộc sống" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/phan-mem/" title="Tin Tức - Phần mềm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/kien-thuc-may-tinh/" title="Tin Tức - Kiến thức máy tính" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/hoc-tap/" title="Tin Tức - Học tập" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tai-lieu/" title="Tin Tức - Tài liệu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://nguoicodonvn2008.info/themes/default/css/news.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">.&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.</h2>
		<p class="pull-right"><a title=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;." href="https://nguoicodonvn2008.info/">https://nguoicodonvn2008.info</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal</h1>
		<ul class="list-inline">
			<li>Thứ năm - 18/01/2024 03:23</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
		</div>
				<div class="imghome">
			<img alt="Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal" src="https://st.quantrimang.com/photos/image/2016/04/27/lenh-linux-0-size-80x80-znd.png" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<p style="text-align: justify;">Nếu bạn muốn cài đặt phần mềm trên bản phân phối Linux dựa trên Debian, apt-get là một lệnh terminal đáng tin cậy. Tuy nhiên, đôi khi bạn có thể gặp rắc rối với lỗi “command not found” dưới dạng phản hồi.</p>

<p style="text-align: justify;">Dưới đây là cách xử lý lỗi &quot;apt-get: command not found&quot;.</p>

<h2 style="text-align: justify;">apt-get là gì?</h2>

<p style="text-align: justify;">Công cụ apt-get là trình quản lý gói dòng lệnh cho các bản phân phối dòng Debian. Nó cho phép bạn cài đặt, cập nhật và gỡ bỏ phần mềm. Cách sử dụng của apt-get như sau:</p>

<div class="codebar" style="text-align: justify;"></div>

<pre class="language- language-none prettyprint" id="pre0">
<code>apt-get &#91;tùy chọn&#93; &#91;lệnh&#93;</code></pre>

<p style="text-align: justify;">Vì vậy, để cài đặt phần mềm chụp ảnh màn hình scrot, bạn sẽ sử dụng:</p>

<div class="codebar" style="text-align: justify;"></div>

<pre class="language- language-none prettyprint" id="pre1">
<code>apt-get install scrot</code></pre>

<p style="text-align: justify;">Nói đúng ra, apt-get không được dùng nữa, điều đó có nghĩa là nó không được sử dụng cho bất kỳ cài đặt tương tác nào (tức là nhấn <strong>Y</strong> hoặc <strong>N</strong> hoặc nhập bất kỳ lệnh nào khác theo yêu cầu). Thay vào đó, lệnh apt ngắn hơn (bao gồm các lệnh apt-get) được khuyến khích, trong khi apt-get được chấp thuận cho các script.</p>

<p style="text-align: justify;">Tuy nhiên, nếu bạn chỉ cần cài đặt một số phần mềm thì cả hai đều hoạt động.</p>

<p style="text-align: justify;">Nhưng nếu apt-get không hoạt động thì sao?</p>

<h2 style="text-align: justify;">Nhận được lỗi &quot;apt-get: command not found&quot; trên CentOS hoặc RHEL?</h2>

<p style="text-align: justify;">Lệnh apt-get thường hoạt động mà không gặp vấn đề gì, nhưng nếu không thì sao?</p>

<p style="text-align: justify;">Nếu bạn đang sử dụng bản phân phối không sử dụng apt-get thì đơn giản là nó sẽ không hoạt động. (Ví dụ, đây là một lỗi dễ mắc phải khi truy cập web server từ xa.) Để giải quyết vấn đề này, bạn phải cài đặt bằng trình quản lý gói chính xác.</p>

<p style="text-align: justify;">Đây có thể là pacman, zypper, yum hoặc dnf, tùy thuộc vào bản phân phối Linux.</p>

<p style="text-align: justify;">Ví dụ, nếu bạn ở trong CentOS server và muốn cài đặt phần mềm, thay vì apt-get (hoặc apt), bạn sẽ sử dụng yum:</p>

<div class="codebar" style="text-align: justify;"></div>

<pre class="language- language-none prettyprint" id="pre2">
<code>yum install PACKAGE_NAME</code></pre>

<p style="text-align: justify;">(Trong đó “PACKAGE_NAME” liên quan đến gói có sẵn để cài đặt.)</p>

<p style="text-align: justify;">Bài so sánh của Quantrimang.com về apt, yum và dnf sẽ giải thích thêm điều này.</p>

<h2 style="text-align: justify;">Sửa lỗi “apt-get: command not found” trên Debian, Ubuntu hoặc Raspberry Pi OS</h2>

<p style="text-align: justify;">Điều gì sẽ xảy ra nếu bạn đang sử dụng bản phân phối dòng Debian như Ubuntu, Pop!_OS hoặc Raspberry Pi OS và gặp phải lỗi “apt-get: command not found”?</p>

<p style="text-align: justify;">Thật đáng kinh ngạc, điều này có thể xảy ra, nhưng phải làm gì để khắc phục lỗi?</p>

<ul>
	<li style="text-align: justify;"><strong>Cài đặt lại hệ điều hành</strong>. Đây là cách nhanh nhất, ít tốn công sức nhất để giải quyết vấn đề.</li>
	<li style="text-align: justify;">Ngoài ra, hãy tải xuống <strong>apt.deb</strong> từ trang web của Ubuntu và cài đặt bằng <strong>sudo dpkg -i apt_&#91;VERSION&#93;.deb</strong> (thay đổi tên file để khớp với file đã tải xuống).</li>
</ul>

<p style="text-align: justify;">Người dùng Raspberry Pi OS có thể thấy rằng <strong>apt-get install</strong> (hoặc <strong>sudo apt-get install)</strong> không hoạt động. Trong trường hợp này, hãy thử <strong>apt install</strong> thay thế.</p>

<p style="text-align: justify;">Ngoài ra, nếu bạn thử <strong>apt-get install</strong> và gặp một lỗi khác (dọc theo dòng &quot;Temporary failure resolving&quot; theo sau là URL máy chủ) thì vấn đề là về kết nối. Vì vậy, hãy thực hiện các kiểm tra sau:</p>

<ul>
	<li style="text-align: justify;">Kết nối mạng</li>
	<li style="text-align: justify;">Đồng hồ và ngày hệ thống</li>
	<li style="text-align: justify;">Sử dụng ping để xác nhận máy tính của bạn có thể truy cập bất kỳ trang web nào (ví dụ: Google)</li>
</ul>

<p style="text-align: justify;">Sau khi thực hiện những điều chỉnh cần thiết, hãy khởi động lại máy tính và thử lại.</p>

<h2 style="text-align: justify;">Các cách khác để khắc phục lỗi “apt-get: command not found”</h2>

<p style="text-align: justify;">3 vấn đề khác có thể dẫn đến lỗi “apt-get: command not found”.</p>

<p style="text-align: justify;">Đầu tiên, bạn có viết đúng chính tả lệnh không? Lỗi chính tả có thể gây ra sự tàn phá trong bất kỳ hệ thống tập trung vào văn bản nào, từ tìm kiếm của Google đến tìm từ hoặc cụm từ trên một trang. Linux Terminal cũng không khác gì. Hãy dành thời gian để đảm bảo bạn đã nhập “apt-get” chính xác!</p>

<p style="text-align: justify;">Thứ hai, có thể quyền của bạn không đủ? Thay vì <strong>“apt-get”</strong>, hãy thử <strong>“sudo apt-get”</strong> - lỗi “command not found” giờ đây sẽ được loại bỏ.</p>

<p style="text-align: justify;">Cuối cùng, nếu bạn thấy lỗi “sudo: command not found” cụ thể hơn xuất hiện và bạn đã thử mọi cách ở trên thì vấn đề thực sự có thể là do sudo, chứ không phải apt-get.</p>

<div style="text-align: justify;">&nbsp;</div>
		</div>
				<div id="author">
						<p>
				<strong>Nguồn tin:</strong>
				Quantrimang.com
			</p>
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/cach-sua-loi-apt-get-command-not-found-trong-linux-terminal-7973.html" title="Cách sửa lỗi &quot;apt-get&#x3A; command not found&quot; trong Linux Terminal">https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/cach-sua-loi-apt-get-command-not-found-trong-linux-terminal-7973.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; .&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.
		</div>
		<div id="contact">
			<a href="mailto:admin@nguoicodonvn2008.info">admin@nguoicodonvn2008.info</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://nguoicodonvn2008.info/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
		</script>
		<div class="car-top">
  <span><img src="https://nguoicodonvn2008.info/themes/default/images/car.png" alt=""></span>
</div>
<div id="run_cronjobs" style="visibility:hidden;display:none;"><img alt="cron" src="/index.php?second=cronjobs&amp;p=m34MU25B" width="1" height="1" /></div>
<script src="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4c_e856T",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://nguoicodonvn2008.info/assets/js/language/vi.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/global.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/site.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/news.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/main.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://nguoicodonvn2008.info",
            "logo": "https://nguoicodonvn2008.info/uploads/angel.gif"
        }
        </script>
<script src="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js"></script>
<script type="text/javascript">
var $scrolltop = $('.car-top');
$scrolltop.on('click', function () {
    $('html,body').animate({
        scrollTop: 0
    }, 800);
    $(this).addClass("car-run");
    setTimeout(function(){ $scrolltop.removeClass('car-run');}, 1000);
    return false;
});
$(window).on('scroll', function ()
{ 
    if($(window).scrollTop() >= 200)
    {
        $scrolltop.addClass("show");
        $scrolltop.addClass("car-down");
    }
    else
    {
       $scrolltop.removeClass("show");
       setTimeout(function(){ $scrolltop.removeClass('car-down');}, 300);
    }
});
</script>
</body>
</html>